Make the game run at the same speed on every screen
On a fast monitor the hero runs faster, on a slow computer the jumps change and enemies slip through walls. The AI often ties the game to the screen refresh. This entry gives a loop that steps the game at a steady pace and survives a long stall.
Why this works
A game that steps in equal slices of time behaves the same wherever it runs, because the rules never see how fast the screen happens to be. Drawing is allowed to vary; the world is not. Limiting the catch-up keeps one stall from snowballing into the next.
When not to use it
Skip it for a turn-based or puzzle game where nothing moves between player actions: there is no speed to keep equal, and the extra bookkeeping only adds bugs. Just react to each move when it happens.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- 22 lines of example code with 5 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Make the game run at the same speed on every screen" (read_entry action-fixed-timestep-loop) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP