Spielerando

Stop two build queues from spending the same wood twice

With a barracks queue and a farm queue running side by side, both see the same wood and both promise to use it. This entry sets resources aside for an order, shows what is still free to promise, and lets a cancelled order give everything back.

Why this works

A promise and a payment are different things, and two promises must not rest on the same goods. Setting resources aside when an order is queued makes the free amount an honest answer, and a cancelled order can return exactly what it took without touching anything else.

When not to use it

Skip it when orders are placed and paid in the same instant, or when only one queue exists. Then reserving adds bookkeeping with no benefit. Simply charge at the moment of ordering, and refund if the order is cancelled.

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
  • 38 lines of example code with 3 checks that pass
  • How your AI shows you that it works

Say this to your AI

Use the Spielerando entry "Stop two build queues from spending the same wood twice" (read_entry reserve-resources-for-queued-builds) 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