With Hamster Chase now in its full-on testing phase, it's important to nit pick everything going on in the game to make it as close to perfect as possible. So when I deployed it to my iPhone 4 for the first time, I was shocked that the game was running choppy! Usually I have those problems with Android, and this labyrinth-style game is not as demanding as, say, Hyperspace Pinball. I finally figured out the cause:
My understanding is that by default, Unity will cap the frame rate of an iOS game at 30 FPS. You can change the cap to 60 FPS by altering the Application.targetFrameRate property. I did just that, and now the game runs smoothly on iOS.
Problem solved, right? Not quite...this fix will make any application work harder, and make the device eat through the battery more quickly. The question here is: By how much?
I did a test where I let my game run for an hour at 30 FPS on an initially fully charged iPhone 3GS and iPhone 4. I then repeated the test for 60 FPS. Here are the results in the form of % battery remaining after the hour elapsed:
iPhone 3GS
- 30 FPS: 77%
- 60 FPS: 68%
iPhone 4
- 30 FPS: 87%
- 60 FPS: 83%
The 60 FPS version spent an additional 9% of battery life in an hour on a 3GS, while just an additional 4% on an iPhone 4.
For me, it comes down to the battery performance versus game performance. I don't have an iPhone 5 or 4S to compare with; so really the test is only partially informative. However, it's enough to make me side with game performance, and I'm going to invoke Application.targetFrameRate = 60 for iOS builds and have it thoroughly tested.
One final thought: please do NOT assume that these percentages will hold true for your game. If the Unity profiler is reporting 60 FPS while your game is running, yet your game looks choppy, do these tests on your own devices.