Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [Advanced Technical Question] - Rate of air loss  (Read 1380 times)

FantasticDorf

  • Bay Watcher
    • View Profile
[Advanced Technical Question] - Rate of air loss
« on: July 05, 2017, 08:16:37 am »

Whether Toady or anybody else would like to wade in, it'd be welcome but does anybody know how effectively measure the rate in which a creature loses air or point towards a way to determine a co-efficient or ratio to how fast a creature would recover a state of breathlessness or strangulation.

A. The creatures size, a large creature requiring more oxygen to fully recover (?) there's a relevant parallel on body size attached as to how it responds to webs & poisons, as they become less effective the larger the target is.

B. Whether the creature is aquatic, requiring water levels (another variable) and how that might modify the rate in which they recover air loss, if they are very far into the state of air drowning, how would applying water or multiple layers of water be able to save them if it has any effect at all.

C. The state of the body, via affect of ailments & damage, such as piercing a lung or being injected with a poison that causes breathlessness.

Taking into account that fortress mode runs at a much faster state than adventure mode, meaning long states of unconciousness or drowning are more like coma's or extended suffering. Toady themselves said as much that they increased the rate in which air loss occurs as a fix for strangulation bugs.
Logged

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: [Advanced Technical Question] - Rate of air loss
« Reply #1 on: July 05, 2017, 10:34:21 am »

I don't know the answer (and maybe only Toady does), but there are some ways you could experiment to find out.  If you install DFHack you can play around with a script or the Lua console to suffocate things and watch the counters to see what happens.  If you need some help doing that, you can ask in the DFHack thread.

I'd offer some quick examples of using the console, but it's been a few years so I don't remember exactly how it works anymore.  The short version is that you'd want to select a creature, then use the Lua console to set the right flags or counters of the currently selected unit so that it starts to suffocate.

A quick check at the unit structure for DFHack here shows that there are at least two counters related to this: winded and suffocation.  You probably only care about the suffocation counter.  Since DF may clear any suffocating flags if the creature isn't actually wounded, I'd probably start by setting that counter to various values and watch as it decrements per frame to see if it decrements faster or slower for differently sized creatures.  You could also see if you need higher values to suffocate larger things, since it implies that setting that value high enough would cause something to suffocate on the next frame.
Logged
Through pain, I find wisdom.

PatrikLundell

  • Bay Watcher
    • View Profile
Re: [Advanced Technical Question] - Rate of air loss
« Reply #2 on: July 05, 2017, 11:08:33 am »

I would probably play with actually drowning the creatures by using the "liquids" script.
Suffocation due to alcohol poisoning kills through lung damage which I think is caused by vomit blocking the airways.
Logged

FantasticDorf

  • Bay Watcher
    • View Profile
Re: [Advanced Technical Question] - Rate of air loss
« Reply #3 on: July 05, 2017, 01:26:59 pm »

I've used DFhack before, and ill look into it using the point of reference you've supplied. Thanks

Well ill look into whether forcing a 'compute_health' on a fish being trasferred into a aquarium will have any meaningful effect (because it "should" update its health status as well as trying to drown people in arena mode. If by entering a building its stopping them from updating their health (which it shouldn't) then i guess i can write that off and try air drowning and pitting them back into water to see how fast they recover.

As for larger creatures i guess its calculated drowning and measuring the recovery.
__________________________________

Patricklundell is there a script that yet exists that forces a unit to compulsively vomit on demand? That could help you. Or to simply code in a syndrome that forces them to, and apply it via DFhack (a quick search on the modding forums says vomit syndromes exist but said command does not)
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: [Advanced Technical Question] - Rate of air loss
« Reply #4 on: July 05, 2017, 02:54:16 pm »

I think you misunderstood my comment, as it was intended as a reference for you - I've solved my alcohol poisoning problems by firing all tavern keepers and tavern performers...
Logged

FantasticDorf

  • Bay Watcher
    • View Profile
Re: [Advanced Technical Question] - Rate of air loss
« Reply #5 on: July 05, 2017, 03:04:57 pm »

I think you misunderstood my comment, as it was intended as a reference for you - I've solved my alcohol poisoning problems by firing all tavern keepers and tavern performers...

I've solved my own by unsetting the meeting area beneath them and don't linger about there all the while. The tavern, keepers & performers all continue to work there. They usually move on to look at statue gardens or pray.



Beside the point i was just pointing out how induced vomiting is a good way to see how suffocation affects people internally.
« Last Edit: July 05, 2017, 03:10:47 pm by FantasticDorf »
Logged

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: [Advanced Technical Question] - Rate of air loss
« Reply #6 on: July 05, 2017, 07:47:33 pm »

Iirc dwarf survival time is dependent on toughness or endurance and ranges between 350 and 1300 steps. Let me find the post...Found it.  I've done an experiment on this, I think it shows endurance as the best stat for drowning.
« Last Edit: July 05, 2017, 07:50:05 pm by Fleeting Frames »
Logged