Saving battery

Previous topic - Next topic

Alex_R

Thanks guys for your solutions!!.

When I set LIMITFPS 10 and SLEEP 1 it seems it save battery but I have a little problem. When user taps any button sometimes must do two or three touches with all finger in the screen till the game do something. I think due to SLEEP 1. If I remove the SLEEP command this problem is not solved but the behavior is aceptable (sometimes two taps is required to activate the game). So I need at least 30 FPS to check the user taps for a fine user experience. I'll try kanonet solution. I think it solves this problem.

Thank you again for your help!! This forum is awsome!!  =D

Kitty Hello

Did you try HIBERNATE? That's a sort of an "intelligent SLEEP".

Alex_R

#17
After some little testing with Apple developer tools I have the following results (perhaps can be useful to someone).

Special loop: When user is no tapping the screen the program goes to this special loop doing hibernate, sleep or other test as follows:

Procedure    CPU usage    GPU usage    Touch response
30 fps always   29%-56%   7%-8%   Very good: 10/10

Special loop
Hibernate
No showscreen   50%-51%   0%   Good :8/10

Special loop
Hibernate
Sleep 50
No showscreen   46%   0%   Good :8/10

Special loop
Hibernate
8 FPS reduction
No showscreen   50%-51%   0%   Regular :7/10

Special loop
No hibernate
8 FPS reduction
No showscreen   20%   20-21%   Bad: 4/10

Special loop
Screenshot
Sleep 50
Showscreen   28-29%   11%   Bad: 4/10

Special loop
Screenshot
Hibernate
Showscreen   18%   25%   Very Bad: 4/10

Special loop
Screenshot
8 FPS reduction
Showscreen   18%-21%   19%-25%   Very bad: 3/4


Conclusion: unfortunately the best option is do nothing to save battery. You get the best user experience and the game runs fine.

Note: with this special loop the iPhone gets too warm after 5 minutes.
Note2: with hibernate after showscreen in the main loop I get almost the same CPU and GPU usage that without hibernate

spacefractal

more fps you have, why better control do you have. This is why some users want 60fps, even its a simple game. That is just more responsetive. So there is no reasons to try to save the battery state, except if the user is idle, example like 5 minuttes or such (which im did in Spot Race).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/