Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: [title edited] semi-solution for starving/dehydrated prisoners and patients  (Read 17482 times)

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile

So hopefully this isn't completely and utterly wrong. I'm a lua noob and also spoiled on compiler errors.

feeding-timers.lua
Code: [Select]
<snip>

Watching with great interest - I'll probably update the starter pack as soon as there's a (known to be) working automatic fix.
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

Fen

  • Bay Watcher
  • Secretly A Kobold Werebull
    • View Profile

excellent, with this many dwarves' lives may be saved, and many prisoners may be saved... for later, that is.
Logged
This space for rent

Larix

  • Bay Watcher
    • View Profile

I must admit i'm still more interested in working out what exactly the bug is here - and why it reliably kills babies and prisoners while hospital patients are reliably provided for, although the description sounded like they were handled by the same (apparently not working) code.

So while checking the bug tracker list, i ran over this one, which jogged my memory:

http://www.bay12games.com/dwarves/mantisbt/view.php?id=2448

I had recently (again) seen this in action:
dwarfs will give food or water to a fellow dwarf if this dwarf is already in the "complained of hunger/thirst" area - which also seems to be the condition for the first (and only) food and drink provided for babies and prisoners.

But
if a dwarf who's just a little bit hungry or thirsty goes to sleep (because they can't reach the food/water source or because they just decided to take a nap first), there'll be a "give food/water" job generated for them almost instantly.

This suggests to me that the combination of "unconscious" status with _any_ amount of hunger/thirst directly spawns a care job, without consulting the bugged timeout. It'd definitely explain the reliable and prompt care for patients, who in my experience never get to "complained" status, let alone starvation/dehydration in 34.11 - dwarfs in "Rest" status are constantly unconscious. Obviously, this hypothesis would need some dangerous testing to check - you'd have to try and e.g. knock out hungry/thirsty prisoners via cave-in and see if that forces care jobs (going to "Rest" itself was enough to save a starving baby/child, the question is whether sleep and other non-hospitalising unconsciousness works).
Logged

k9wazere

  • Bay Watcher
    • View Profile

Hospital patients are reliably cared for? I had a couple die of thirst in my last fort, and I'm sure I've seen plenty in previous forts!

I had just assumed that they were too injured to drink...
Logged

Larix

  • Bay Watcher
    • View Profile

Hospital patients must be given food and water by others (with the "give food/water" labours). This can mess up if you have no or only an unreliable water source or if everyone's busy with other work. If you have a healthy 10% idlers at all times and enough food and water, and if the patients are actually "resting" (there's another bug where injured dwarfs can get stuck in a non-resting state), starvation and dehydration shouldn't happen. I haven't had a patient die from neglect yet - lack of water might have killed one or two, but that was due to lack of a water source, giving reams of "cancels give water" cancellations (i.e. no bugging out after one job aborted, they kept trying over and over).

O.k., my findings -
imprisoned dwarfs will be given food and water once (both, and reliably), but not a second time. That was already known. These gifts of food and water don't wait for deep hunger or thirst, they seem to trigger pretty much the moment the blue or brown arrow appears. I don't think it triggers that early for unchained dwarfs, or random feeding/watering of fortress-dwellers would be much more prevalent.

Dwarfs who are chained aboveground seem to be very opposed to the idea of sleeping. I had five dwarfs chained outside, all became drowsy, none bothered to sleep; not even the one i built a bed underneath. A dwarf who was chained underground _did_ "sleep without a proper room", but she was chained in the middle of the booze pile anyway, so wasn't a "test subject".

The really weird thing which completely prevented this test from going anywhere:
chained dwarfs appear to be immune to cave-in dust.
I triggered six cave-ins near them, all the children and ex-inmates who were visiting were tossed around, stunned and rendered unconscious. The prisoners showed no effects, no cave-in related thoughts, nothing. They got "choked on dust underground" (??? underground???) thoughts, but were otherwise unaffected. Short of injuring them, which would be quite likely to kill or permanently cripple them, i see no way to turn prisoners unconscious on demand.

Prison assignments are very persistent: i deleted the captain of the guard  squad before demolishing the chains, then, after the ex-captain still went after the (dehydrated, currently drinking) justice candidate, i drafted her into an ad-hoc squad with an order to take station near the river and check if the water is still running. She picked up a waterskin and _again_ tried to catch the dehydrating craftsdwarf, station order be damned. Nixing _that_ squad, making an ad-hoc burrow and ordering all civilians inside finally got her off the prospective victim's neck - and reset all pending prison sentences to "no officer assigned".

In short, if you don't want people starving to death in your prisons, there are a few choices:
- do without the broken justice system
- set up prisons to have food and drink freely available without depending on care labours
- force care labours to re-generate via dfhack
- mod away hunger and thirst for dwarfs in general (rather extreme, you might want to revert it after saving your prisoner or baby).
« Last Edit: June 13, 2014, 02:36:29 am by Larix »
Logged

Melting Sky

  • Bay Watcher
    • View Profile

This DFHack lua script appears to "debug" a unit that needs feeding/watering. Appears to work on prisoners (chained OR caged), patients, and loose babies.

Code: [Select]
unit=dfhack.gui.getSelectedUnit()
if unit==nil then
print ("No unit under cursor!  Aborting!")
return
end

print(unit)
print(unit.counters2.thirst_timer)

for k,v in pairs(unit.status.misc_traits) do
print(k, v.id, v.value, df.misc_trait_type[v.id])
if v.id == 0 then v.value=0 end --GiveWater cooldown set to zero
if v.id == 1 then v.value=0 end --GiveFood cooldown set to zero
end


The game has cooldowns for how often a creature can be fed/watered, and sometimes these cooldowns get stuck or reset to a large number without the unit actually being fed/watered.

Nice work.  :D
Logged

GavJ

  • Bay Watcher
    • View Profile

My solution is not building jails at all. So far it has worked out quite well for me. Just sayin'
Logged
Cauliflower Labs – Geologically realistic world generator devblog

Dwarf fortress in 50 words: You start with seven alcoholic, manic-depressive dwarves. You build a fortress in the wilderness where EVERYTHING tries to kill you, including your own dwarves. Usually, your chief imports are immigrants, beer, and optimism. Your chief exports are misery, limestone violins, forest fires, elf tallow soap, and carved kitten bone.

Merendel

  • Bay Watcher
    • View Profile

My solution is not building jails at all. So far it has worked out quite well for me. Just sayin'

I agree, keep your dwarves happy and they wont tantrum and need jail for that. Then you just need to arrange unfortunate accidents for nobles that generate obnoxious mandates and your set. On the other hand I set up my jail chains between the food and drink stockpiles so they can get their own food if I do alow the justice system to run.
Logged

Duuvian

  • Bay Watcher
  • Internet ≠ Real Life
    • View Profile

To make a former member of the Fortress Guard stop punishing dwarves after being removed from the FG squad you can temporarily assign them to a burrow and then remove them shortly afterwards.
Logged
FINISHED original composition:
https://app.box.com/s/jq526ppvri67astrc23bwvgrkxaicedj

Sort of finished and awaiting remix due to loss of most recent song file before addition of drums:
https://www.box.com/s/s3oba05kh8mfi3sorjm0 <-zguit

GavJ

  • Bay Watcher
    • View Profile

My solution is not building jails at all. So far it has worked out quite well for me. Just sayin'

I agree, keep your dwarves happy and they wont tantrum and need jail for that. Then you just need to arrange unfortunate accidents for nobles that generate obnoxious mandates and your set. On the other hand I set up my jail chains between the food and drink stockpiles so they can get their own food if I do alow the justice system to run.

No, I mean even when they murder people, they don't really need to go to jail. As fas as I've seen, there aren't really any good or bad thoughts associated with it, other than in the nobles who had their mandates violated, and honestly I've never once in years of playing DF had a single noble tantrum because of that.
Logged
Cauliflower Labs – Geologically realistic world generator devblog

Dwarf fortress in 50 words: You start with seven alcoholic, manic-depressive dwarves. You build a fortress in the wilderness where EVERYTHING tries to kill you, including your own dwarves. Usually, your chief imports are immigrants, beer, and optimism. Your chief exports are misery, limestone violins, forest fires, elf tallow soap, and carved kitten bone.

Larix

  • Bay Watcher
    • View Profile

Yeah, not having a justice system in the first place is my usual approach. I just wondered if there was an alternative way of getting prisoners provided for in a pinch. But since they're so difficult (to impossible) to turn unconscious in a low-risk way, no data on the actual question (does unconsciousness force care labours?) was found.

Getting stuck in jail gives the "depressed about being confined" bad thought, which is fairly significant and probably self-refreshing/cumulative. This is sort of compensated by the very strong "happy to be free" once (whenever?) released, but the prisoner has to keep it together until then.

Which makes me less than convinced that a prison is a good thing during a tantrum spiral - it keeps the tantrummers confined, but punishes their happiness even more, which is likely to put them in even greater danger of tantrumming on or going insane. Temporarily locking them up in a room with nice furniture should be nearly as safe (if they don't demolish the doors out of rage) and should actually help their mood.

An exploity and fiddly way to improve miserable dwarfs' moods could of course be to imprison and almost immediately release them. The "happy to be free" thought should do wonders for their attitude, as long as you can successfully cancel the impending re-imprisonment by deleting the guard squad and burrowing ex-guards until they forget their assignments.
Logged
Pages: 1 [2]