View Issue Details

IDProjectCategoryView StatusLast Update
0003190Dwarf FortressDwarf Mode -- Militarypublic2015-06-02 04:37
ReporterNidor Assigned ToToady One  
PrioritylowSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version0.31.12 
Fixed in Version0.40.05 
Summary0003190: "Long patrol duty" thoughts accumulate from all squad orders, including training
DescriptionMilitary 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.
Steps To ReproduceActivate 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.
Additional InformationThey were not removed from military service, just set schedule from active to inactive via "s"quad "a" "t" schedule training/active > inactive
Tagsbinary patch

Relationships

related to 0001577 resolvedToady One High Master Hammerdwarf gets labeled as plain "Hammerdwarf" rather than "Hammerlord" when put back on duty 
related to 0000525 resolvedToady One Peasants in the military receive bad thoughts when going off duty. 
related to 0002896 new Military Dwarves have no friends! 

Activities

Telarin

2010-09-15 08:30

reporter   ~0012651

Last edited: 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.

troas

2010-10-24 19:45

reporter   ~0013500

Last edited: 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

Malibu Stacey

2010-10-25 04:04

reporter   ~0013503

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?

Ogg the Blinky Sock

2010-10-25 05:38

reporter   ~0013504

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.

Quietust

2010-10-25 06:08

reporter   ~0013506

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.

Quietust

2010-12-07 13:19

reporter   ~0014439

Last edited: 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.

mikemayday

2012-04-03 14:20

reporter   ~0022055

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.

shinziril

2012-05-15 12:08

reporter   ~0022532

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.

Quietust

2012-06-03 17:24

reporter   ~0022824

Last edited: 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').

kwieland

2012-06-03 19:13

reporter   ~0022829

That is awesome Q. Can we get a "Probable Quick Fix" tag, then, Foot? :)

Quietust

2012-06-03 19:25

reporter   ~0022830

Last edited: 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

Quietust

2012-06-07 06:18

reporter   ~0022891

And for Win32 v0.34.11 SDL:

007E5CFC : B0 C0 42 -> 20 4F 7D

askot bokbondeler

2012-06-07 12:31

reporter   ~0022895

does that fix every order being considered patrol duty AND anger at long patrol duty not being reset after even a very long break?

Quietust

2012-06-07 18:09

reporter   ~0022897

Last edited: 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

Breok

2012-06-24 11:09

reporter   ~0023102

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.

Quietust

2012-09-10 19:23

reporter   ~0023550

Last edited: 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

ag

2012-10-07 01:03

reporter   ~0023640

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.

oninoshiko

2012-10-15 08:02

reporter   ~0023661

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.

user11

2012-10-15 18:24

  ~0023662

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).

Quietust

2012-10-24 14:53

reporter   ~0023678

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).

Issue History

Date Modified Username Field Change
2010-09-09 17:24 Nidor New Issue
2010-09-15 08:30 Telarin Note Added: 0012651
2010-09-15 08:32 Telarin Note Edited: 0012651
2010-10-24 19:45 troas Note Added: 0013500
2010-10-24 19:49 troas Note Edited: 0013500
2010-10-25 04:04 Malibu Stacey Note Added: 0013503
2010-10-25 05:38 Ogg the Blinky Sock Note Added: 0013504
2010-10-25 06:08 Quietust Note Added: 0013506
2010-12-07 13:19 Quietust Note Added: 0014439
2010-12-07 13:20 Quietust Note Edited: 0014439
2010-12-07 19:39 user6 Relationship added related to 0001577
2010-12-07 19:39 user6 Relationship added related to 0000525
2012-04-03 14:20 mikemayday Note Added: 0022055
2012-05-15 12:08 shinziril Note Added: 0022532
2012-06-03 17:24 Quietust Note Added: 0022824
2012-06-03 17:25 Quietust Note Edited: 0022824
2012-06-03 17:27 Quietust Note Edited: 0022824
2012-06-03 19:13 kwieland Note Added: 0022829
2012-06-03 19:25 Quietust Note Added: 0022830
2012-06-03 20:57 Quietust Tag Attached: binary patch
2012-06-04 06:11 Quietust Note Edited: 0022830
2012-06-07 06:18 Quietust Note Added: 0022891
2012-06-07 12:31 askot bokbondeler Note Added: 0022895
2012-06-07 12:56 user6 Summary Long 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:09 Quietust Note Added: 0022897
2012-06-07 18:10 Quietust Note Edited: 0022897
2012-06-24 11:09 Breok Note Added: 0023102
2012-09-10 19:23 Quietust Note Added: 0023550
2012-09-12 13:59 Quietust Note Edited: 0023550
2012-10-07 01:03 ag Note Added: 0023640
2012-10-15 08:02 oninoshiko Note Added: 0023661
2012-10-15 18:24 user11 Note Added: 0023662
2012-10-24 14:53 Quietust Note Added: 0023678
2014-01-27 20:46 user6 Relationship added related to 0002896
2014-03-25 13:29 user11 Assigned To => user11
2014-03-25 13:29 user11 Status new => acknowledged
2014-07-23 11:18 Toady One Status acknowledged => resolved
2014-07-23 11:18 Toady One Fixed in Version => Next Version
2014-07-23 11:18 Toady One Resolution open => fixed
2014-07-23 11:18 Toady One Assigned To user11 => Toady One