Stop slow income from rounding to zero or drifting away over a long game
A tiny income per tick, such as a third of a coin, either never arrives or slowly gains and loses cents, so two players with the same city end up with different treasuries. Here is how to count so that nothing is lost, however the time is cut into pieces.
Why this works
A third cannot be stored exactly as a decimal, and rounding at every step either loses coins or invents them. Counting whole units plus a leftover that is never thrown away makes the total depend only on how much time passed, not on how it was cut up.
When not to use it
Wrong when the fractions are the point, such as a smoothly shown fuel level, or when income depends on chance or on bonuses that change every moment. It is also overkill if every income is a whole number already.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 20 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 "Stop slow income from rounding to zero or drifting away over a long game" (read_entry resource-income-without-rounding-loss) 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