Search code examples
androidframe-rategame-loop

Android game with constant FPS?


I'm implementing a game loop with constant FPS. I'm thinking about 25-30 FPS should be enough. Any ideas from your own experience? Should I even restrict FPS at all?


Solution

  • 30 to 40 fps is usually good for a fast paced game. Depending on the game and how heavy it is, the platform might not be able to always keep up. It is therefore better to assume that the game can't follow the fps accurately. Instead keep a timer that checks the system clock each frame and figures how much time has elapsed. This way you can calculate the increments to for example physics (an object falling) correctly, even if the game is running at a lower fps.