Dwarf Fortress Bug Tracker - Dwarf Fortress
View Issue Details
0001307Dwarf FortressDwarf Mode -- Jobs, Farming/Farmer's Workshoppublic2010-04-18 15:282010-08-19 13:10
normalminorhave not tried
PCWindows XP SP3
0001307: Harvesting dwarf assigned to burrow trying to drop off plant outside
I have a dwarf assigned to a burrow that contains a farm and a stockpile for the product this farm produces. When it comes time to harvest, the dwarf harvests then gets stuck trying to deliver the resulting plants to a stockpile nearby, but outside the burrow. Fails repeatedly, spamming the message log with cancellations.

Other things of note:
* The stockpile inside the burrow is the closest of all stockpiles, even disregarding obstacles.
* The stockpile the dwarf is trying to deliver to contains a non-full barrel of the same food, while the stockpile inside the burrow is barrel-free. Mix food is turned off.

I can provide a save if that would be helpful.
burrow, farming, harvesting, hauling, spam
child of 0000600new  haulers in burrows seem to stand around contemplating hauling jobs they can't perform 
Issue History
2010-04-18 15:28EricNew Issue
2010-04-18 15:29EricNote Added: 0004125
2010-04-18 15:30EricTag Attached: burrow
2010-04-18 15:30EricTag Attached: farming
2010-04-18 15:30EricTag Attached: hauling
2010-04-18 15:30EricTag Attached: spam
2010-04-18 15:30EricTag Attached: harvesting
2010-04-18 15:34EricIssue Monitored: Eric
2010-04-18 15:36FootkerchiefNote Added: 0004128
2010-04-18 15:36FootkerchiefRelationship addedchild of 0000600
2010-04-18 15:48EricNote Added: 0004131
2010-04-18 18:48Khym ChanurIssue Monitored: Khym Chanur
2010-08-19 02:12SnickersnakNote Added: 0011914
2010-08-19 09:09KumquatNote Added: 0011921
2010-08-19 09:11KumquatNote Edited: 0011921bug_revision_view_page.php?bugnote_id=0011921#r4631
2010-08-19 13:10SnickersnakNote Added: 0011930
2010-08-19 13:19SnickersnakNote Edited: 0011930bug_revision_view_page.php?bugnote_id=0011930#r4639

2010-04-18 15:29   
Seems to be related to 0000597 and 0000600, but I can't figure out how to add a relationship.
2010-04-18 15:36   
This does look like 0000600, yeah. I don't think reporters are allowed to add relationships, just managerial types. The save would probably be helpful, you can upload it to http://dffd.wimbli.com/ [^]
2010-04-18 15:48   
The save is available at http://dffd.wimbli.com/file.php?id=2147 [^] . Please note that the creature_standard.txt is slightly modded to make children turn adult sooner and make large litters more frequent, for dwarves. Nothing that should matter, but worth mentioning.
2010-08-19 02:12   
I'm playing version 0.31.12 and I've had this sort of trouble with stockpiles. I noticed my smelter was delivering coke to a bar stockpile a ways away when there was a stockpile for coke right next to it. I thought something might be up with my stockpile settings and switched it to accept all bars and blocks. It still wouldn't use it and the glass furnace right next to it making glass blocks wouldn't use it either. I thought I might have placed the stockpile AFTER I started it on a repeat task of making coke and that might have something to do with it. So I switched off repeat, waited for the smelter to become idle and turned it back on. The smelter immediately started using the stockpile, as did the glass furnace.

While my smelter was still smelting coke I made the stockpile next to it accept nothing and the haulers emptied it out. I then re-enabled it for all bars/blocks and neither glass blocks nor coke were stored there by the workers themselves or my haulers. Only after the glass furnace canceled a job order (needed pearlash) did the bars of coke start being stored there. I imagine the glass furnace did a last scan of stockpiles looking for pearlash and added the newly available bar/block stockpile to some sort of usable stockpile list and so the smelter was able to 'see' it again.

I figured the same sort of thing was affecting my farms with them NEVER (in many in-game years) having used the stockpile conveniently placed right next to them, instead trekking miles out of their way and losing precious harvest/planting time. It's not as easy to turn off farms as it is other workshops so I simply disabled accepting plants at all other stockpiles. After the first plant went into the stockpile next to the farms I re-enabled my other stockpiles and they continued using the closest one.

In short, workshops seem not to be updating their list of available stockpiles periodically, instead they seem to decide what stockpile they'll use as the workshop goes into production and then they never change until something makes them become aware of the new stockpile. Farms seem to have major troubles with this because they are almost always in use, thus they seem locked into one particular stockpile until you 'reset' by forbidding/re-enabling or deleting/re-creating all other stockpiles. I imagine that letting the farms lay fallow for a season might also accomplish this but I haven't tried it.

Hopefully this has been of some help to you.
2010-08-19 09:09   
(edited on: 2010-08-19 09:11)
This is probably an unforeseen consequence of the STORE_DIST_X_COMBINE values in d_init.txt. They are currently extremely aggressive (1000) which means that a half-empty plant barrel will appear to be 1000 steps closer to the dorf contemplating where to haul a newly harvested plant than an empty barrel (or, apparently, an empty stockpile. Though it does not quite explain the weirdness of stone stockpiles.) Very few paths in a fortress are 1000 steps in length.

Therefore the end result is that if there's a partially filled barrel or bin anywhere in the fort, for the dorf it will appear to be right under his nose, and he'll haul that lonely plump helmet through the deepest caverns and Hell itself (unless interrupted by a demon or a deer, of course) to get to that half empty barrel - if that happens to be the shortest path, that is.

I suppose that path lengths are clamped to zero, so that they cannot be negative after the adjustment, so if the dorf tries to find nearest such bin he'll end up to the first or last on the list of all bins, with an apparent distance of zero.

Furthermore, it seems that bins outside the burrow are not removed from the list, probably pending pathfinding rewrite.

2010-08-19 13:10   
(edited on: 2010-08-19 13:19)
I suspect there's more to this than just those values however. Using my smelter story as an example eventually the bin in the far stockpile would become full. This would remove the COMBINE values from consideration and the true distance would be used causing them to use the closer stockpile from then on. This did not happen.

I would bet that the determination of which stockpile is 'closer' happens when the job is queued instead of when the product becomes available. This would tend to maintain the use of the far stockpile until something happens to force a reconsideration.

Unfortunately tasks such as 'Store item in barrel' don't seem to respect burrow restrictions right now. If you restrict your lumberjacks to a burrow then designate trees to be chopped outside their burrow those tasks aren't put on the jobs list until the lumberjacks are released from restriction. It seems to work the same with the stockpiles themselves. For instance if you place a refuse stockpile outside a burrow (with no refuse stockpiles inside the burrow) you'll see refuse pile up but no jobs will be created to store it until you release your dwarves. God help you though if they want to store something in a barrel INSIDE a stockpile that happens to be outside of their burrow. You'll get constant cancellation spam and pathing lock-ups. If you look at your jobs list you'll see that 'Store item in barrel/bin' and 'Store item in stockpile' are actually different jobs, one seemingly affected by burrows while the other is not.