Why does my game require so much rendering power?

Hey everyone. I made an android game in Unity over the past 3 months and for the past week I’ve been trying to optimize everything to get the game to run at a decent fps. I fixed up all of my scripts, but I still have bad fps. When I check the profiler Unity says my game is using 63% on Device.present under Graphics.PresentAndSync. 43ms!(http://puu.sh/5Xkoa.png this pic is of the profile analyzing the game running on my galaxy tab 10.1) I’ve searched and searched but nothing seems to help. I’m pretty much a beginner with Unity and game making in general so I’m left clueless.

Here’s what I’ve tried doing:

  • Changing the opengl version (no effect)
  • I’ve changed all my shaders to mobile shaders
  • Changed all of my textures to their lowest settings while still being able to keep them looking nice.
  • I’ve put mostly everything into a texture atlas.

More pics:
The title scene http://puu.sh/5XkPd.jpg

The title scene with stats displayed http://puu.sh/5XkKd.jpg

As you can see in this scene I have only 21 draw calls or lower. In-levels I never go over around 17-18. Can someone please help me figure out what the problem is?

Additional Info: Game runs at a constant 60fps on my HTC One, but that’s because it’s brand new. I can’t just exclude any users who don’t have a new device.

EDIT: I forgot to mention my game is a 2D game. For most things, I’m using a texture atlas and unity’s built-in spriting system.

Device.Present is called most often when Unity is waiting for VSync. In other words its simply waiting so that drawing can be in sync with the refresh rate of the device. What is probably happening is that it is taking slightly longer for you to draw a frame than the device can post them to the frame buffer which causes you to wait until the next frame to do anything.

Here are a couple things you can do to fix it:

  1. Checkout the answer to this question. In short, your shaders can prefer OGLESv1 over v2.
  2. Depending on your Unity Version there is either a checkbox or a dropdown to control VSync. Either uncheck it or select Don’t Sync.
  3. Ensure that Application.targetFrameRate is set to your desired target frame rate. Because you state that your HTC One does 60 fps, you may have already done this, but perhaps you have some logic that sets this dynamically and is acting up.
  4. Evaluate your scene for overdraw (transparent textures that overlap); it can cause quite a lot of slow-down on older devices.
  5. Also, try some of Statement’s troubleshooting suggestions / potential fixes.

And, at the end of the day, old devices are not new devices, and will not perform the same. You didn’t mention what device was getting the 15fps, but, in reality, you can exclude some older devices. At my shop, whenever an Android user complains of something not working right, we just remove the device from the allowed devices list on Google Play. It’s just not worth the engineering resources for us to try and support all of those 4k+ devices.