Author Topic: Physics.processing high CPU usage on iPad  (Read 5999 times)

Mazyod

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 8
    • View Profile
Physics.processing high CPU usage on iPad
« on: June 27, 2016, 11:28:49 AM »
Hello,

We started profiling our game recently on the iPad, and realized there are intervals where physics takes tons of CPU cycles, and causes frame rate to drop to 30 FPS.

According to my research, this is an NGUI issue. People have complained about this on the Unity Store reviews, as well as over here for example:
http://answers.unity3d.com/answers/1162136/view.html

Can you please advise us how to resolve this? Our game doesn't use Physics at all...

NGUI: 3.9.9
Unity: 5.4.0b18
Xcode: 7.3.1
iOS: 9.1
iPad: Mini RD 2
macOS: 10.11.4
« Last Edit: June 27, 2016, 03:11:43 PM by Mazyod »

Mazyod

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: Physics.processing high CPU usage on iPad
« Reply #1 on: June 27, 2016, 07:07:02 PM »
I understand that I am not providing sufficient information about the issue, it's because we really aren't doing anything special with the game. It's just super simple game scene with the UIRoot holding a UICamera and two UIPanels. UIPanels have buttons and labels, and that's it.

I am guessing someone must've stumbled across this before, but my search didn't lead me to any practical solution. The post I reference suggests "removing NGUI", but we are already invested in it and love the features it provides.

Thanks in advance,
Maz

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Physics.processing high CPU usage on iPad
« Reply #2 on: June 28, 2016, 09:28:27 AM »
Assuming you didn't get rid of the rigidbody on the UIRoot's game object, there shouldn't be any performance hits coming from moving widgets with colliders around. Worst NGUI does is performs a Physics.Raycast when touches are active. Nothing at all changes if there are no widgets with colliders moving around.

Lastly, make sure your UI's layer isn't set to collide with anything.
« Last Edit: July 01, 2016, 10:11:48 PM by ArenMook »

Mazyod

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: Physics.processing high CPU usage on iPad
« Reply #3 on: June 28, 2016, 12:25:50 PM »
Assuming you didn't get rid of the rigidbody on the UIRoot's game object, there shouldn't be any performance hits coming from moving widgets with colliders around. Worst NGUI does is performs a Physics.Raycast when touches are active. Nothing at all chances if there are no widgets with colliders moving around.

Lastly, make sure your UI's layer isn't set to collide with anything.

Thanks ArenMook. I assume from your response that this is not a known issue as far as you guys know.
I will look closer into the GUI hierarchy and try building a new project on the iPad and see, perhaps on of the sample projects. If that performs poorly, I'm guessing there is something wrong.

Mazyod

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: Physics.processing high CPU usage on iPad
« Reply #4 on: July 30, 2016, 09:40:12 AM »
@Aren In the game, we had the clipping feature enabled because we needed it to implement a certain animation, but that animation was replaced recently with a simpler one. So, while cleaning up the project today, I turned off the clipping feature, and I am finally seeing my game run at 60 FPS without the tiniest of lags!

I'm not interested in finding a solution for the clipping performance issues, since we removed it, but please do keep that in mind as a reference point, in case you or one of your users faces a similar issue.