Build times that stay right when the game is paused or sped up
A timer that stores a finishing time looks fine until the player pauses, speeds up or loads a save. Then buildings finish too early, too late or all at once. Here is the way to count a build so that every speed setting gives the same result.
Why this works
A finishing time is a guess about the future, and it breaks the moment the speed changes. Counting the work already done is always true, whatever the speed, and only the amount added each moment depends on how fast time is running.
When not to use it
Skip it when the finish must be a real-world moment, like a timer that continues while the player is away or a daily reward. Then a fixed end time is right, and pausing or speeding up should not apply.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 24 lines of example code with 3 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Build times that stay right when the game is paused or sped up" (read_entry build-timer-speed-and-pause-as-work) 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