Put goods into the nearest warehouse with room and spill into the next
With several warehouses, a cart of grain should go to the closest one that still has space, and what does not fit should carry on to the next, never be lost and never be split into pieces too small to matter. Taking goods out follows the same order of nearness.
Why this works
People expect goods to go where it is closest and to carry on when that place is full. A fixed order of nearness, with ties settled the same way every time, means everyone sees the same result, and nothing is lost because one place was full.
When not to use it
Skip it when each warehouse has a job of its own, such as one only for food and one only for weapons, or when the player wants to choose the destination. Then route by purpose or by the player's choice, not by distance.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- 30 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 "Put goods into the nearest warehouse with room and spill into the next" (read_entry deposit-nearest-warehouse-then-spill) 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