Dwarf Fortress Bug Tracker - Dwarf Fortress
View Issue Details
0003190Dwarf FortressDwarf Mode -- Militarypublic2010-09-09 17:242015-06-02 04:37
Nidor 
Toady One 
lowminorhave not tried
resolvedfixed 
0.31.12 
0.40.05 
0003190: "Long patrol duty" thoughts accumulate from all squad orders, including training
Military dwarf gained the "depressed by long patrol duty" thought during seige, was set to inactive until the thought no longer showed up in the thoughts tab. On reactivating the dwarf into active/training another month or two later, they instantly got the long duty thought, and upgraded to "angry about" after just a few minutes of training, repeated the inactive status for a whole season and thought was gone again, went to active/training and is now "enraged about" long duty before they even made it to the barracks to train.
Activate a dwarf for a period of time till they get a negative thought, take them off active training until thought goes away, reactivate (even after a several month break) and see if thought returns/escalates to higher rank of negative as soon as they return to active training.
They were not removed from military service, just set schedule from active to inactive via "s"quad "a" "t" schedule training/active > inactive
binary patch
related to 0001577resolved Toady One High Master Hammerdwarf gets labeled as plain "Hammerdwarf" rather than "Hammerlord" when put back on duty 
related to 0000525resolved Toady One Peasants in the military receive bad thoughts when going off duty. 
related to 0002896new  Military Dwarves have no friends! 
Issue History
2010-09-09 17:24NidorNew Issue
2010-09-15 08:30TelarinNote Added: 0012651
2010-09-15 08:32TelarinNote Edited: 0012651bug_revision_view_page.php?bugnote_id=0012651#r4911
2010-09-21 10:31TelarinIssue Monitored: Telarin
2010-09-21 10:53Hieronymous AlloyIssue Monitored: Hieronymous Alloy
2010-10-05 13:39ShurikaneIssue Monitored: Shurikane
2010-10-05 21:01alexleonIssue Monitored: alexleon
2010-10-24 19:45troasNote Added: 0013500
2010-10-24 19:45troasIssue Monitored: troas
2010-10-24 19:49troasNote Edited: 0013500bug_revision_view_page.php?bugnote_id=0013500#r5225
2010-10-25 04:04Malibu StaceyNote Added: 0013503
2010-10-25 05:38Ogg the Blinky SockNote Added: 0013504
2010-10-25 06:08QuietustNote Added: 0013506
2010-12-07 13:19QuietustNote Added: 0014439
2010-12-07 13:20QuietustNote Edited: 0014439bug_revision_view_page.php?bugnote_id=0014439#r5492
2010-12-07 19:39FootkerchiefRelationship addedrelated to 0001577
2010-12-07 19:39FootkerchiefRelationship addedrelated to 0000525
2011-02-16 14:40jwest23Issue Monitored: jwest23
2012-04-03 14:20mikemaydayNote Added: 0022055
2012-04-03 14:21mikemaydayIssue Monitored: mikemayday
2012-05-15 00:48BuglistIssue Monitored: Buglist
2012-05-15 12:08shinzirilNote Added: 0022532
2012-06-03 17:24QuietustNote Added: 0022824
2012-06-03 17:25QuietustNote Edited: 0022824bug_revision_view_page.php?bugnote_id=0022824#r8493
2012-06-03 17:27QuietustNote Edited: 0022824bug_revision_view_page.php?bugnote_id=0022824#r8494
2012-06-03 19:13kwielandNote Added: 0022829
2012-06-03 19:25QuietustNote Added: 0022830
2012-06-03 20:57QuietustTag Attached: binary patch
2012-06-04 06:11QuietustNote Edited: 0022830bug_revision_view_page.php?bugnote_id=0022830#r8496
2012-06-07 06:18QuietustNote Added: 0022891
2012-06-07 12:31askot bokbondelerNote Added: 0022895
2012-06-07 12:56FootkerchiefSummaryLong Patrol Negative Thoughts seem to escalate, even with long break. => "Long patrol duty" thoughts accumulate from all squad orders, including training
2012-06-07 18:09QuietustNote Added: 0022897
2012-06-07 18:10QuietustNote Edited: 0022897bug_revision_view_page.php?bugnote_id=0022897#r8532
2012-06-24 11:09BreokNote Added: 0023102
2012-09-10 19:23QuietustNote Added: 0023550
2012-09-12 13:59QuietustNote Edited: 0023550bug_revision_view_page.php?bugnote_id=0023550#r8799
2012-10-06 13:10CarchIssue Monitored: Carch
2012-10-06 13:10CarchIssue End Monitor: Carch
2012-10-07 01:03agNote Added: 0023640
2012-10-15 08:02oninoshikoNote Added: 0023661
2012-10-15 17:25oninoshikoIssue Monitored: oninoshiko
2012-10-15 18:24DwarfuNote Added: 0023662
2012-10-24 00:17StebIssue Monitored: Steb
2012-10-24 14:53QuietustNote Added: 0023678
2012-11-18 12:31arclanceIssue Monitored: arclance
2013-04-10 18:24HairyDudeIssue Monitored: HairyDude
2013-12-07 04:58ThundercraftIssue Monitored: Thundercraft
2014-01-15 12:27BenLubarIssue Monitored: BenLubar
2014-01-15 14:40Kirig Stonebeard IIIssue Monitored: Kirig Stonebeard II
2014-01-17 10:09Kirig StonebeardIssue Monitored: Kirig Stonebeard
2014-01-27 20:46FootkerchiefRelationship addedrelated to 0002896
2014-03-25 13:29DwarfuAssigned To => Dwarfu
2014-03-25 13:29DwarfuStatusnew => acknowledged
2014-07-23 11:18Toady OneStatusacknowledged => resolved
2014-07-23 11:18Toady OneFixed in Version => Next Version
2014-07-23 11:18Toady OneResolutionopen => fixed
2014-07-23 11:18Toady OneAssigned ToDwarfu => Toady One
2014-07-25 15:04HairyDudeIssue End Monitor: HairyDude
2015-06-02 04:37TelarinIssue End Monitor: Telarin
2016-03-08 02:38StebIssue End Monitor: Steb

Notes
(0012651)
Telarin   
2010-09-15 08:30   
(edited on: 2010-09-15 08:32)
I have 3 "reserve" squads. All are scheduled for one month of training and 11 months of no orders. The recruits in the squad all have the "enraged by long patrol duty" thought, even after 11 months off duty. Apparently the "long patrol duty" thought is only reset by actually making the squad inactive, which, unfortunately can't be scheduled.

Edit: Sorry, you seem to be correct, even setting them to inactive doesn't seem to de-escalate the severity of the "enraged by long patrol duty" though. As soon as set back to active, they return to exactly as upset about patrol duty as they were when you set them inactive.

(0013500)
troas   
2010-10-24 19:45   
(edited on: 2010-10-24 19:49)
This appears to still be happening in 31.16 I have three squads which are set to rotate 3 months on/1 month off, and are additionally set to require 8 dwarves out of 10 for on duty/training to allow some down time during their "on" season. Many dwarves show "enraged by long patrol duty".

This may be related to issue 0000916

(0013503)
Malibu Stacey   
2010-10-25 04:04   
I have dwarves who are both "enraged by long patrol duty" and "upset by being removed from active duty" (can't remember the exact text, at work right now) when I stand them down for a season.

Seems like a pretty huge bug as no matter what I try I can't get the majority of my military to be an happier than "Content" & they tend to stick around "Fine" which is too close to a tantrum spiral for my liking. Even feeding them some easy kills of captured goblin thieves who've been stripped of their equipment doesn't boost their happiness enough to get them above "Content". This includes dwarves who immigrated as "Peasants" with only Military skills whom I immediately conscripted to the militia. Surely professional soldiers should be happiest while soldiering?
(0013504)
Ogg the Blinky Sock   
2010-10-25 05:38   
Although there's probably a but at work (I've seen this too), dwarves will now no longer eat nor drink while actively patrolling. You need to set the 'minimum number' of dwarves in the give/edit order interface of the schedule so that it's a couple fewer than the number of dwarves actually in the squad. This will let them take time off to eat, drink, and sleep, which should reduce the complaints about patrolling almost entirely.
(0013506)
Quietust   
2010-10-25 06:08   
The bit about dwarves not eating/drinking while on duty is 0002486. As for dwarves getting unhappy about being relieved from duty, that always happens when a military dwarf reverts to being a Peasant, just as a civilian becoming a Recruit makes them complain about the draft.
(0014439)
Quietust   
2010-12-07 13:19   
(edited on: 2010-12-07 13:20)
For the record, this thought seems to stop happening once the dwarf reaches Elite skill in their weapon; however, due to 0001577, this tends not to last very long.

(0022055)
mikemayday   
2012-04-03 14:20   
This bug persists in 34.07.
I have my squad set to two months off - one month training
They are still all enraged about long patrol duty.

A small explanation regarding the OP: it doesn't matter if the squad has no orders because it's been switched to a different schedule (s->a->t) or just because their current schedule has no orders this month.
(0022532)
shinziril   
2012-05-15 12:08   
I can confirm this happening in recent versions as well. Having them on any schedule whatsoever (even "No orders x12") will cause them to become increasingly angry about long patrol duty, and the effect persists even if you remove them from the schedule and then return them. Issuing an order with the Squad menu also seems capable of triggering the long-patrol-duty thought.
(0022824)
Quietust   
2012-06-03 17:24   
(edited on: 2012-06-03 17:27)
I've located the code that generates "long patrol duty" thoughts, and the problem appears to be that all squad orders are considered to be "patrol duty", including Training - specifically, squad_order_trainst does not override the 'isPatrol' method (or whatever it's called), so it's defaulting to the method implementation in squad_orderst (which returns 'true').

(0022829)
kwieland   
2012-06-03 19:13   
That is awesome Q. Can we get a "Probable Quick Fix" tag, then, Foot? :)
(0022830)
Quietust   
2012-06-03 19:25   
(edited on: 2012-06-04 06:11)
Just for fun, here's a binary patch (untested) that should fix the problem in Win32 DF v0.34.10 SDL:

007E46EC : 00 1E 53 -> 90 BB 42

(0022891)
Quietust   
2012-06-07 06:18   
And for Win32 v0.34.11 SDL:

007E5CFC : B0 C0 42 -> 20 4F 7D
(0022895)
askot bokbondeler   
2012-06-07 12:31   
does that fix every order being considered patrol duty AND anger at long patrol duty not being reset after even a very long break?
(0022897)
Quietust   
2012-06-07 18:09   
(edited on: 2012-06-07 18:10)
Upon closer examination, I've found the other problem: the code that manages the patrol duty timer only gets called for military dwarves - if the dwarf is a civilian, nothing happens at all.

Effectively, the code appears to be as follows:

if (isMilitary(unit->profession)) {
    squad_orderst *order = unit->getSquadOrder();
    if (order && order->isPatrol()) {
        unit->patrol_cooldown--;
        unit->patrol_timer++;
        unit->addThought(LONG_PATROL_DUTY, etc.);
        ...
    } else {
        unit->patrol_timer--;
        unit->patrol_cooldown++;
    }
}

when it should read as follows:

bool onPatrol = false;
if (isMilitary(unit->profession)) {
    squad_orderst *order = unit->getSquadOrder();
    if (order && order->isPatrol()) onPatrol = true;
}
if (onPatrol) {
    unit->patrol_cooldown--;
    unit->patrol_timer++;
    unit->addThought(LONG_PATROL_DUTY, etc.);
    ...
} else {
    unit->patrol_timer--;
    unit->patrol_cooldown++;
}


The following (untested) binary patch should fix this part of the bug as well for Win32 v0.34.11 SDL:

067A7C9 : D9 -> 90

(0023102)
Breok   
2012-06-24 11:09   
I did test both binary patches for 0.34.11 SDL with OldGenesis03411 with a saved fortress where the bug brought me to the edge of a tantrum of doom. No new "depressed", "angered" and "enraged" about long patrol duty thoughts for simple training appeared on my military dwarfs.

Schedule was set to 2 and 3 minimum with 5-dwarf-squads on training all year.
Seems to work just fine.

Can't confirm if negative thoughts appear at all, tho. Didn't see any so far but will test it when the next siege or ambush hits my fortress.
(0023550)
Quietust   
2012-09-10 19:23   
(edited on: 2012-09-12 13:59)
This untested binary patch should solve both problems in v0.34.11 Linux:

Allow civilians to recover from long patrol duty:
0AEB592 : 0F 85 -> 90 E9
0AEBFA9 : 8D B4 26 00 00 00 00 -> 0F 84 6B 02 00 00 90

Allow soldiers to recover from long patrol duty while Training:
0D9E338 : C0 59 2D -> 20 37 CB

(0023640)
ag   
2012-10-07 01:03   
Just want to note that DFHack now has "tweak patrol-duty" that implements the part about making Train orders not count as patrol without manual binary patching.
(0023661)
oninoshiko   
2012-10-15 08:02   
I'm experiencing this on Mac, is there a patch for it on here? If not is there a way to get them to "cooldown"? It looks from this bug report that the answer is "no."

I'm kinda surprised this is list as a "minor" bug. Having a constantly angering military really makes the game almost unplayable beyond a certain point. If it weren't for my goblin cuisinarts (which admittedly, is an exploit of the pathing rules) I'd be having a lot more fun.
(0023662)
Dwarfu   
2012-10-15 18:24   
oninoshiko,

We do not use the Severity field at all, except for crashes, so it being listed as 'minor' is immaterial. This report will most likely be addressed during the next bug fixing period (after the next release).
(0023678)
Quietust   
2012-10-24 14:53   
oninoshiko: if you use the MacOS version of DFHack, you should be able to use the "tweak patrol-duty" fix to cover that half of the bug.

I generally don't write patches for the MacOS version because IDA 5.0 [freeware] is incapable of handling Mac binaries properly (IDA 6.x can, but the Demo version doesn't allow saving so it has to fully analyze the binary every time I load it), and I only write Linux patches when there's sufficient demand for it (because GCC goes overboard with certain types of optimization and makes it really difficult to actually locate the code I want to patch).