Dwarf Fortress Bug Tracker - Dwarf Fortress
View Issue Details
0001416Dwarf FortressDwarf Mode -- Moodspublic2010-04-21 19:582014-12-31 13:08
Toady One 
0001416: Moody dwarves claim workshops outside their burrow, haul infinite number of items, never start construction
See this thread http://www.bay12forums.com/smf/index.php?topic=54959.0 [^] for the full description. The net resault is something like the elborate forbidding trick use in pervious versions, also if the moody dwarf is assigned to a burrow with no stockpiles of required items the dwarf will sit on the workshop until death/insanity.
See the bay12 forum thread. http://www.bay12forums.com/smf/index.php?topic=54959.0 [^]
Artifact, binary patch, burrow, burrows, mood, planepacked, stockpile
related to 0001084resolved Toady One Child making artifact, continues gathering materials forever! 
has duplicate 0002565resolved Footkerchief Moody dwarf assigned to burrow collects materials forever. 
has duplicate 0002569resolved Footkerchief Armorsmith created an iron shield out of 100+ copper&iron bars. Very many images and decorations on shield. Value: 1047600 
has duplicate 0003761resolved Logical2u Never ending strange; keeps grabbing materials 
has duplicate 0003343resolved Logical2u Moody dwarf assigned to burrow collects one material infinitely until un-assigned from burrow. 
has duplicate 0001587resolved Logical2u Dwarves that go into a mood endlessly pick up wood and bring it back to the workshop they claimed. 
Issue History
2010-04-21 19:58nirrelnNew Issue
2010-04-21 19:59nirrelnTag Attached: Artifact
2010-04-21 19:59nirrelnTag Attached: burrows
2010-04-21 19:59nirrelnTag Attached: stockpile
2010-04-21 20:00nirrelnTag Attached: mood
2010-04-27 14:50FootkerchiefSummaryMoody dwarfs unable to use claimed workshops outside of assigned burrows but still haul items from stock piles in their burrow => Moody dwarves claim workshops outside their burrow, bring infinite number of items, never start construction
2010-04-27 14:50FootkerchiefTag Attached: planepacked
2010-04-27 14:51FootkerchiefSummaryMoody dwarves claim workshops outside their burrow, bring infinite number of items, never start construction => Moody dwarves claim workshops outside their burrow, haul infinite number of items, never start construction
2010-05-23 00:24MazkaNote Added: 0007214
2010-07-08 06:06FootkerchiefRelationship addedhas duplicate 0002565
2010-07-08 06:07FootkerchiefRelationship addedhas duplicate 0002569
2010-07-08 06:07FootkerchiefRelationship addedrelated to 0001084
2010-07-17 15:48Khym ChanurIssue Monitored: Khym Chanur
2011-02-05 17:34Logical2uRelationship addedhas duplicate 0003761
2011-02-05 17:34Logical2uRelationship addedhas duplicate 0003343
2011-02-05 17:34Logical2uRelationship addedhas duplicate 0001587
2011-02-05 17:34Logical2uIssue Monitored: Footkerchief
2011-10-27 01:25KogutTag Attached: burrow
2012-05-17 08:38agNote Added: 0022570
2012-05-17 08:39agNote Edited: 0022570bug_revision_view_page.php?bugnote_id=0022570#r8407
2012-05-17 08:39agNote Edited: 0022570bug_revision_view_page.php?bugnote_id=0022570#r8408
2012-05-17 08:39agNote Edited: 0022570bug_revision_view_page.php?bugnote_id=0022570#r8409
2012-05-17 23:06agIssue Monitored: ag
2012-05-27 17:26QuietustNote Added: 0022748
2012-05-27 20:41agNote Added: 0022750
2014-01-27 13:31FootkerchiefTag Attached: binary patch
2014-03-25 13:27DwarfuAssigned To => Dwarfu
2014-03-25 13:27DwarfuStatusnew => acknowledged
2014-08-02 11:33DwarfuStatusacknowledged => confirmed
2014-08-18 13:57KanddakNote Added: 0029254
2014-08-18 14:09TalvienoIssue Monitored: Talvieno
2014-08-18 14:11KanddakNote Edited: 0029254bug_revision_view_page.php?bugnote_id=0029254#r11232
2014-12-31 13:08Toady OneStatusconfirmed => resolved
2014-12-31 13:08Toady OneFixed in Version => Next Version
2014-12-31 13:08Toady OneResolutionopen => fixed
2014-12-31 13:08Toady OneAssigned ToDwarfu => Toady One

2010-05-23 00:24   
Also happened with moody mason. Originally he might have had a different burrow, or no burrow at all.
After being possessed I assigned a stockpile burrow (to pick up native gold) and he kept on hauling gold to workshop.
When the amount of stone grew to ridiculous amounts, I deleted the burrow and he started working right away.
Workshop was not included in original burrow.
2012-05-17 08:38   
(edited on: 2012-05-17 08:39)
OK, I hit this same very problem with my new DFHack api for creating buildings and constructions, and investigated it. Here are the results:

In order to reuse item selection logic from DF, instead of selecting all items beforehand like the game does, I create the construct building job in a fashion similar to workshop jobs, so that it selects materials on the fly. It appears to work quite fine, except when the building is hanging over space; in that case it behaves exactly like strange moods in this bug.

The cause of the problem is that when the code re-checks items already in the holder building agains the item filter, it tests if the unit can path to the item - and both in the burrow and hanging building cases it cannot. Consequently the item quantity check fails, and it selects a new similar item to bring.

This should be fixed by omitting to fill in the unit and position fields of the internal structure used for matching items until after the items within the building have been processed, i.e. changing:

filter.building = building;
filter.unit = unit;
filter.job = job;
filter.pos = unit->pos;

for (...building->items...) ...



filter.building = building;
filter.job = job;

for (...building->items...) ...

filter.unit = unit;
filter.pos = unit->pos;

Of course, I don't have the full code and it might have some other negative effects, but manually clearing those fields in the debugger helps.

2012-05-27 17:26   
The fact that the path test fails and causes another item to be selected is obviously only part of the problem - the big problem is that the original item remains attached to the job and is thus incorporated into it when the job finally finishes.
2012-05-27 20:41   
If the unit doesn't cancel the job, it should be assumed that it can path to the building for the purpose of items too; otherwise it doesn't make any sense.
2014-08-18 13:57   
(edited on: 2014-08-18 14:11)
Still present in 0.40.08. A potter with novice mechanic got a mood, claimed a mechanic workshop in the masonry burrow, and proceeded to haul tons of gypsum out of the kiln input stockpile in the glass/pottery burrow. Removing him as a citizen of the glass/pottery burrow let him accept the stone he had and collect the rest of his mood materials.