My idle game numbers stop growing or turn into Infinity
After enough hours the score stops moving, small gains vanish or the display shows a word instead of a number. Ordinary numbers in the code simply run out of room. Here is a different way to store huge values and how to print them so the player can read them.
Why this works
Ordinary numbers keep a fixed number of exact digits, so very big values lose their small parts and eventually overflow. Splitting a value into its leading digits and a count of zeros keeps the relevant precision at any size, and tiny parts that no longer matter can be dropped honestly.
When not to use it
Skip it when the numbers stay within a few billion, which ordinary numbers hold exactly. The special form is slower and harder to read in the code. Also skip it where exact whole amounts matter at any size, such as counting real items.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 60 lines of example code with 5 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "My idle game numbers stop growing or turn into Infinity" (read_entry idle-numbers-too-big-for-normal-numbers) 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