Spielerando

Keep a huge material count honest when tiny crafts keep adding to it

After a few hours an idle game counts materials in the trillions, and suddenly a craft that should cost exactly what you have says you are short, or the stock does not move at all. Ordinary numbers drift. This entry shows a small number type that compares fairly and settles tiny leftovers.

Why this works

Computers keep only so many digits, so a huge number swallows a small one and tiny errors pile up. Storing a number as a size and a digit part, comparing with a little give and cleaning up crumbs, keeps what the player sees in line with what is really owned.

When not to use it

Skip this in a game whose numbers stay modest, say below a few billion. Ordinary numbers are exact enough there, and the extra care only slows things down and makes saves harder to read.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 3 common mistakes and the fix
  • 50 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 "Keep a huge material count honest when tiny crafts keep adding to it" (read_entry idle-huge-stock-small-crafts) 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