Dwarf Fortress Bug Tracker - Dwarf Fortress
View Issue Details
0000410Dwarf FortressDwarf Mode -- Jobs, Farming/Farmer's Workshoppublic2010-04-04 11:232011-03-31 12:34
Toady One 
0000410: Creatures get fought over by dwarves trying to milk and cage them
If creature is assigned to be milked and caged simultaneously, sometimes two or more dwarfs will try to execute the orders, and keep taking said creature from each other, so none of them can complete the order.

http://www.bay12games.com/forum/index.php?topic=52460.msg1129581#msg1129581 [^]
1. Cage creature
2. Add milk creature job at farmers workshop
animals, jobs
parent of 0001797resolved Toady One Dwarves play tug of war with caged animals marked for slaughter 
has duplicate 0002797resolved Footkerchief dwarfs playing tug of war with animals trying to be milked. 
has duplicate 0003446resolved Logical2u Milking a caged creature is not possible, the creature gets kidnapped by another dwarf. 
has duplicate 0003874resolved Logical2u Dwarves fight over animals 
related to 0001890resolved Dwarfu Can't milk caged donkeys 
related to 0003959resolved Toady One Penned Animals Get Fought Over For Shearing, Butchering, Etc. 
Issue History
2010-04-04 11:23RusAnonNew Issue
2010-04-04 17:06QloosTag Attached: animals
2010-04-04 17:06QloosTag Attached: jobs
2010-04-23 21:41The ArchitectNote Added: 0004840
2010-04-23 21:41The ArchitectIssue Monitored: The Architect
2010-05-07 14:05FootkerchiefRelationship addedparent of 0001797
2010-05-07 14:06FootkerchiefSummaryMilk and cage a creature => Creatures get fought over by dwarves trying to milk and cage them
2010-05-07 16:14derigoNote Added: 0006385
2010-06-13 17:05caknuckNote Added: 0008349
2010-06-20 06:20LeperousNote Added: 0008765
2010-07-12 17:20RatchetiNote Added: 0010085
2010-07-12 17:20RatchetiNote Edited: 0010085bug_revision_view_page.php?bugnote_id=0010085#r3914
2010-07-23 15:00FootkerchiefRelationship addedhas duplicate 0002797
2010-07-23 15:00FootkerchiefIssue Monitored: madjoe5
2010-07-23 16:06madjoe5Issue End Monitor: madjoe5
2010-09-06 02:08FifthHorsemanNote Added: 0012442
2010-10-21 21:58Logical2uRelationship addedhas duplicate 0001890
2010-10-21 21:58Logical2uRelationship addedhas duplicate 0003446
2010-10-22 04:57GreydwarfNote Added: 0013458
2010-12-30 17:14FucoNote Added: 0014759
2010-12-30 17:15FucoNote Edited: 0014759bug_revision_view_page.php?bugnote_id=0014759#r5610
2010-12-30 17:16FucoNote Edited: 0014759bug_revision_view_page.php?bugnote_id=0014759#r5611
2010-12-30 17:35QuietustNote Added: 0014761
2011-01-04 20:59RiderofDarkNote Added: 0014790
2011-01-04 20:59RiderofDarkNote Edited: 0014790bug_revision_view_page.php?bugnote_id=0014790#r5626
2011-01-04 21:14RiderofDarkIssue Monitored: RiderofDark
2011-01-05 04:51Hieronymous AlloyIssue Monitored: Hieronymous Alloy
2011-01-06 08:25FootkerchiefRelationship replacedrelated to 0001890
2011-01-06 15:37Logical2uRelationship addedhas duplicate 0003874
2011-02-16 14:35jwest23Issue Monitored: jwest23
2011-02-17 12:01DwarfuRelationship addedrelated to 0003959
2011-02-20 06:23Lord HermanIssue Monitored: Lord Herman
2011-02-25 02:15DwarfuTag Attached: Fixed in 0.31.20?
2011-03-06 02:31Toady OneStatusnew => resolved
2011-03-06 02:31Toady OneFixed in Version => 0.31.20
2011-03-06 02:31Toady OneResolutionopen => fixed
2011-03-06 02:31Toady OneAssigned To => Toady One
2011-03-31 12:32RiderofDarkIssue End Monitor: RiderofDark
2011-03-31 12:34FootkerchiefTag Detached: Fixed in 0.31.20?

The Architect   
2010-04-23 21:41   
This is the same for chained creatures. The creature remains assigned to the chain after being removed (good!) but the job to "rechain" it is generated and assigned before the job to milk it is complete.

The two dwarves do indeed simply fight over the creature in the hallway.
2010-05-07 16:14   
more on this:

If you have 2 farmer's workshops with orders to milk a creature, 2 milkers can decide to milk the same creature at the same time. They will tug the creature back and forth in war over who has the rights to drain the creature's precious fluids. :D
2010-06-13 17:05   
This is still an active bug in 31.06. Even disabling animal hauling on the "caging" dwarf does not end the tug-of-war.
2010-06-20 06:20   
Still here in 31.08.
2010-07-12 17:20   
Still present in 31.10.

Here's a save for it. It should be centered on the dwarves already.

http://dffd.wimbli.com/file.php?id=2672 [^]

2010-09-06 02:08   
Confirmed present in 31.12.
2010-10-22 04:57   
still present in 0.31.16 linux native
2010-12-30 17:14   
(edited on: 2010-12-30 17:16)
Any progress on this? It's quite annoying when running a bigger farm (I usually have about 50+ milkable animals).

The fix seems so easy I don't understand why this hasn't been addressed :(

- add a flag to mark the animal being "being used"
- when the job is done, check the "being used" tag and unset it
- when generating "cage/restrain" job, check the "being used" flag first

seems like 10 minutes at most.

2010-12-30 17:35   
While it might seem a simple and straightforward fix to you, you probably don't know how Dwarf Fortress actually works internally, so it's quite possible that making the changes you've suggested could result in very significant side effects (such as savegame incompatibility) or even more bugs (e.g. creatures being flagged as "being used" even when there isn't any task in progress).
2011-01-04 20:59   
I think I know where this is happening.

What I think is specifically happening:

0) Dwarf 2 looking for task
1) Milker goes to cage
2) Milker releases assigned animal
3) Milker looks for assignment for animal
3.1) While milker is looking, Dwarf 2 finds loose animal
3.2) Dwarf 2 tasked with returning animal
3.3) Milker tasked with milking animal
NOTE: Two dwarves are now assigned the same animal
4) Milker leads animal to workshop
4.1) IF Dwarf 2 reaches animal before workshop
4.1.1) Dwarf 2 takes animal
4.1.2) Dwarf 2 returns animal to cage
5) Milker reaches workshop
5.1) IF Milker has animal
5.1.1) Milker processes animal
5.1.2) Milker looks for task IF Milker finds task before Dwarf 2 arrives IF Milker task isn't return milked animal to cage Cancel Task: handling dangerous creature IF Milker task is animal handling-related Milker does task
5.1.3) Dwarf 2 arrives after animal processing Dwarf 2 takes animal back to cage
5.2) IF Milker has no animal
5.2.1) GO TO 1)

Returning animals to cages is not tied to the animal hauling labor. I think this is somewhat related to 0000184.