Spielerando

An upgrade that finishes while the app is closed should pay from the moment it finished

A player starts a long upgrade, closes the game and comes back to a payout that ignores it, or pays the new rate for the whole time. Here is how to split the away time at each finish so the numbers are right.

Why this works

Income follows what was true at each moment, not what is true when the player comes back. Cutting the time away at every change and paying each piece at the rate that held in it is the only way the total matches what really happened.

When not to use it

Skip it when upgrades only take effect once the player is back and has confirmed them, for example in a game where a finished upgrade waits for a tap. Then the old rate for the whole absence is simpler and consistent with the screen.

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 3 checks that pass
  • How your AI shows you that it works

Say this to your AI

Use the Spielerando entry "An upgrade that finishes while the app is closed should pay from the moment it finished" (read_entry idle-upgrade-finishes-while-away) 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