Spielerando

Work out what a base earned while the player was away, without cheating or going negative

When someone comes back after a day, the game must tell them what happened. A plain multiplication of time and rate gives piles above the storage limit, empty stores that go below zero, and absurd rewards after a clock change. Here is the calculation that stays honest.

Why this works

While the player is away nothing is decided, so the result follows from where things started, how fast they change, and the walls at the top and bottom. Working out the end directly is quick, can be explained to the player, and gives the same answer however long the break was.

When not to use it

Wrong for games where what happens while away matters step by step, such as raids on the base or crops that rot. There, replay the time in rough chunks, or simply let nothing happen while the player is gone. It also fails if rates change during the break.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 3 common mistakes and the fix
  • 21 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 "Work out what a base earned while the player was away, without cheating or going negative" (read_entry offline-progress-with-storage-cap) 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