Two queued buildings both count on the same gold
The player queues several buildings while the treasury looks fine for each one alone. Then the first starts and the others fail, or worse, all start and the treasury drops below zero. This entry shows how to keep a promise about money.
Why this works
Money that is promised is not money that is free. Keeping what is owned and what is already spoken for apart means every new purchase is checked against what is truly left, no matter how many wait in line.
When not to use it
Skip it when builds are paid at once and nothing waits, as in a game where each click starts work right away. Then a single check at the moment of payment is enough, and a second figure would only confuse players.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- A diagram of every state
- 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 "Two queued buildings both count on the same gold" (read_entry reserve-gold-before-queued-builds-start) 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