Energy comes back faster on a fast computer than on a slow phone
If a game adds a point whenever a counter passes a limit, the result depends on how many pictures per second the device draws. The same game then plays differently everywhere. Here is the way to make every device agree, and where the error hides.
Why this works
Players expect the same wait on every device, so the rule has to be about real time, not about how many pictures were drawn. Keeping the leftover time after each point means slow and fast screens end up in exactly the same place.
When not to use it
Skip it when the energy comes back in one big step after a long wait, such as a daily refill. There a plain stored finish time is simpler and cannot drift at all.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 23 lines of example code with 4 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Energy comes back faster on a fast computer than on a slow phone" (read_entry regen-same-at-any-frame-rate) 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