Hello everyone. Let’s just get straight to the point. I’m currently developing a mobile game. It’s a simple crossword game, which only use UI objects. And as a crossword game, people will tend to spend a lot of time solving the puzzle. So I recon the game must have very minimal battery-life consumption. So far here are my approaches to achieve it:
- Disable animators when not needed
- Disable scripts with Update/FixedUpdate when not needed
- Being very nitpick in coding the game (using the most efficient practices as possible)
- No custom material of any UI element
- Delete all camera objects!
But even after all that, I still haven’t reached satisfactory result. The game still consumes ~2% of my phone’s battery every 5 minutes even when the game is totally idle and static (stays at title menu), which is totally no good. I made sure that there is no Update/FixedUpdate/Animation running at the title menu. But still the game saps my phone out of its life!
But today, I think I thought of a little interesting idea: which is limiting the frame rate when there is no player activity (by using Application.targetFrameRate btw). I limit it down to 7 FPS (can’t go any further because UI interaction seems to depend on frame update) and reset it back at -1 (using hardware’s default) when player interacts with buttons or some other components. At first I thought this is the best idea I’d produced in a while, and I thought it will truly minimize battery-life consumption as the game will draw/render scene less often. Of course it comes with some hiccups and other user-control issues, but who cares about user right? Annnd, well, after testing, the result is… it gives little to no improvements at all!
I’m confused, why it doesn’t work? Can anyone explain why? Does Unity’s UI already doing this out of the box by not refreshing static part of the screen? If that is the case, does anyone have any idea of what else can I do to optimize my game’s battery consumption? Have I picked the wrong game engine for this game concept?
I don’t know how to profile the game too, as it runs at stable 1400 fps+ on PC, everything seems running at its best.