With two builders and a long queue, work out when each upgrade really finishes
The player queues eight upgrades and has two builders. The game must show when each finishes, also after the player was away, and say what is done, what is running and what is still waiting. Adding all times together is wrong. This entry shows how to hand out jobs and how to read the state at any moment.
Why this works
Work is handed to whoever is free first, so the end time of a job depends on the jobs before it, not on a grand total. Fixing the order of choices makes the plan the same every time, and a finished plan can be read at any moment.
When not to use it
Skip it when jobs can be paused, split between builders or sped up by helpers, or when the player picks who does what. Then a fixed hand-out misleads, so let the player assign and show the result they chose.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- 38 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 "With two builders and a long queue, work out when each upgrade really finishes" (read_entry two-builders-and-a-long-queue-who-finishes-when) 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