CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.09k stars 4.1k forks source link

Wound Design Document #64424

Open KorGgenT opened 1 year ago

KorGgenT commented 1 year ago

Wounds have been a feature the devs have been discussing for a while, and it's high time I lay out some low-level discussion on wounds. We've already talked about high-level topics and general ideas about wounds, but this issue is meant to be a discussion among people who will be using the json and architecting the code.

What is a wound?

Besides things like "name" and "description" that every other object has, wounds are an object that have a very specific purpose.

Where is a wound?

each limb has a list of wounds. simple as that.

How do you heal a wound?

A lot like rimworld, wounds will heal over time, and infection will increase over time. We need to discuss a couple of ways to implement some kind of UI on how to select wounds, and also some way to notate in the json what item can be used on what wound (like a splint on a broken bone, or hemostatic powder on a wound that is bleeding) Additionally, certain things like bandages can reduce the infection rate for the duration of the effect.

How do you apply a wound?

currently, there is a damage instance in the code. it contains the amount of damage, and the type of damage, mitigated by armor. What we need to discuss is how exactly we want to determine what damage deals what wound. Currently, I have an idea for some kind of table lookup, where the damage_instance determines which table to look at (by type) and then picks the wound (by damage, and by limb). Ideas on possible better implementations are welcome.

As you can see by this, there is quite a lot to this project, and there could be quite a bit delegated. I've more or less been talking about it on Discord but as my time has become rather limited in the recent past, i decided on a slightly more permanent form of organization.

kevingranade commented 1 year ago

So, turning a damage instance into a wound. There will probably be two different flavors of this over time, one based on damage type/damage amount and the other based on striking surface/ penetration depth.

The process I'd suggest is roughly the same though, we annotate wounds with damage types and ranges, e.g. "cut damage from 10-15" (and later something similar for striking surface and penetration depth), then filter available wounds based on the properties of the strike. If we end up with multiple wounds, we can randomly select one, possibly with some kind of manual or automatic weighting.

The damage type and intensity is the base criteria, but we can also have flags for critical hits or specialty attack types or something else.

Supporting this we could have some validation that checks that there are no gaps so that we don't accidentally create situations where certain damage numbers fail to cause wounds.

Venera3 commented 1 year ago

A thing I'd definitely include would be wound progression and a chance for existing wounds to get hit - one kick to your stomach probably won't do you in unless you're unlucky, but twelve would probably do the job.

fungamer2-2 commented 1 year ago

How will damage-over-time effects (such as the Poisoned effect) work with this system?

Wyghab commented 1 year ago

Should an already damaged limb be easier to wound? In the same vein as Vener3's comment, getting hit repeatedly in the same body part could make it more susceptible to wounds.

I-am-Erk commented 1 year ago

Posting my thoughts from our discord conversation here. This is not complete but I haven't had the time to finish it, and it should be somewhere public.

This is more or less how I see us converting damage into a wound. It's not the only way to do it as we found in discord and I suspect you won't want all of this.

Algorithm

  1. Resolve attack and damage as current, determining limb hit and damage remaining - sorted by type.
  2. Assign a "wound_object", which contains individual wounds for each damage type done, and an intensity for each.
  3. Each limb has a deep_threshold for each damage type. Check to see if the sum of all damage types exceeded the deep_threshold. On first pass, let this be 20 points of damage regardless of limb
  4. If deep_threshold is exceeded, create a list of possible deep injuries associated with the wounds in the wound_object by intensity. See below.

We will likely want to repeat 3 and 4 for organ_threshold later, but a first pass could possibly skip this step.

Wound object

A wound object stores multiple individual wounds, so that we know they're all in the same location. It sorts them by "surface" and "deep" layers. This allows us to hide deep wounds during first aid.

Wound objects are generated procedurally, but the individual wounds themselves should have a json object somewhere. so, if an attack does 10 cut, 5 bash, 3 pierce damage, we'd get a wound object looking like:

"wound_object": {
  "surface": [
    { "type": "slash", "intensity": 7 },
    { "type": "bruise", "intensity": 4 },
    { "type": "puncture", "intensity": 1 }
  ],
  "deep": "null"
}

The details of what a "slash" is are defined in another JSON object that explains what that wound is and how it varies by intensity. For example, a slash bleeds but adds relatively little pain; a bruise adds more pain but doesn't bleed as much.

This allows us to represent a complicated injury without creating a ton of content for complex individual wounds. We can make wound care and complications based on how many different wounds you have in the same injury.

Infection should still be handled as a part of the whole wound container.

There may not be any value to separating "deep" and "shallow" so explictily. In my head this is because deep wounds may be hidden. A better way to do that might be to specifically identify special wounds as being "hidden" and requiring diagnosis to show up. That is not something for a first pass.

Assigning deep wounds

This should be done by table, hooray!

Here is a sample list of deep wounds for the arm. This is suuuuper rough. I really am not sure exactly the best way to implement this though I have a good idea how the algorithm should work, so I'm not sure if JSON is the best way to demonstrate what I am thinking:

"deep_wounds_list": [
  { "name": "fracture", "effect": "effect_arm_fracture", "damage_required": { "blunt": 10 }, "intensity": [ 1, 2 ] },
  { "name": "open_fracture", "effect": [ "effect_arm_fracture", "effect_open_fracture" ], "damage_required": { "blunt": 10" } },
  { "name": "nerve_cut", "effect": "effect_arm_nerve", "damage_required": { "cut": 10 } }
]

I'm not sure if the effect framework is the right one to store extra information in the wound or if you have another idea there, I just picked one of the existing tools we have. Something else is fine as long as we have a way to assign additional penalties and problems and have them ramp up depending on how bad it is.

Personally I would like to split "deep" and "organ" wounds out but we don't necessarily have to, instead we can just have organ wounds require more damage before you can get them.

KorGgenT commented 1 year ago

so i've had another idea instead of adding another object that is essentially a wrapper for a list of wounds - assigning location "values." we've talked about this vaguely in the past about where you would hit a bodypart, but essentially a "location" would be a start value and an end value, and if the hit value is between those two values, it hits that wound. this would simply be a way to interact with just the whole list of wounds attached to the limbs, and just organize them in such a way as to make this possible. that being said, i think i'm going to walk back the "wound object" stuff i did end up doing, because once i started writing it, i came to this idea and realized the other way of doing it didn't really make that much sense.

KorGgenT commented 1 year ago

So. we need to talk about wound treatment - and i'm not talking about an in-depth new system, i'm talking about a system that allows us to treat it similarly to how it was before wounds upheaved everything. That being said, and with scope firmly in mind, this is how wounds currently work on my branch (i haven't made a pr yet, but the branch is here https://github.com/KorGgenT/Cataclysm-DDA/tree/wounds ) for those who have a bit of coding knowledge.

A wound_type is the object that is read from json. it has the following members that you can assign in json: name, description - should be self-evident size - this is related to the wound treatment stuff. a wound occupies virtual "space," at a "location" and a size. so, a wound of size 5 and at location 20, would overlap with another wound at size 0 and location 25. This essentially makes it so we can have compounding wounds. The current state of "location" is that it is randomly generated upon creating the wound. pain - how much pain the wound causes. more or less static, though we can discuss how this pain can be mitigated. i am well aware that the human body is able to start igonring a certain amount of pain after a certain amount of time but that should be a later project. sunder - this is "negative armor" if you try to add a wound that'll overlap with another wound that has sunder, it'll be upgraded. min/max damage - this is how we determine the particular wound upon taking a hit. combined with sunder. damage_type - same as above, restricts the wound to a specific damage type limbs - same as above, restricts the wound to specific body parts. bleed - the amount of bleeding this wound produces per second (untreated) heal_time - the amount of time it takes to heal this heals_into - when this wound heals, it turns into another wound. or not. infects_into - same as above, but the result of an infection

a "wound" is the name of the object that has a wound_type. it contains any of the mutable data. age - how old the wound is location - a number from 0-100 as a representation of where the wound is. intensity_multiplier - this is how we're going to scale wounds without making a wound for every point of damage. it's generally a scale between x1-x2 from the minimum damage to the maximum damage. i plan on making it so if you take more damage than wounds exist, the intensity multiplier will go above 2 when it's above the max damage. infection - this is basically the same thing as rimworld. it's a number from 0 - 1 that is a representation of the % it is to fully infected. it also affects healing rate of the wound. contamination - this is a multiplier on infection rate. i plan on making contamination a part of attacks that are "dirty." i'm not quite sure how to utilize it yet, but it will probably have something to do with monster attacks somehow.

how does the player apply wound care? how does wound care "know" what wounds it can apply to? what kind of ui will it be (ui isn't my forte so not too complex the first time around) are there parts of the wounds themselves i have blatantly missed for a first pass?

Shiubiha commented 1 year ago

=========================================

for bleeding wounds treatment:

=========================================

for burning wounds:

=========================================

for bashing wounds:

Shiubiha commented 1 year ago

few more suggestion in general:

other healing factors:

contamination:

infections:

Shiubiha commented 1 year ago

.

KorGgenT commented 1 year ago

image it obviously needs some info, but i think this is a good starting point!

Shiubiha i haven't made it all the way through your comments yet because of how busy i am this week but it's good stuff and i'm definitely going to use some of it.

keampe commented 1 year ago

Is it possible to add a "Treatment" column that shows what the current level of treatment the wound has? So if a wound has been cleaned and disinfected, but the bandages haven't been changed today we can see that at a glance on this UI?

A dirty bandage flag of some kind may be idea as well. Filthy means something specific in CDDA so some other flag might be needed here. This could also be used to create dirty clothes over time - requiring washing or causing rashes but that's another PR.

Shiubiha commented 1 year ago

the problem with flags is that they make something either 0 or 1, IMO the bandage should have an absorption rate based on bandage humidity ( humid bandages less effective, bandages in rain, recently made bandages, recently swimming survivor ), and external-bleeding volume ( we could have a multiplier for how much of the bleeding is leaking out, internal vs external bleeding ), as well as having some options for bandage sizes ( encourages player preparation, am I gonna need lots of small bandages? or should I take a few big bandages? ), and making a flag will also prevent bandages absorbing contaminants as well

how does the game currently calculates such stuff ? is everything calculated once per turn ? does the game have a scheduler for some calculations happening, if so, is it possible to re-schedule or break-schedule or call the scheduled calculation earlier?

DeciusBrutus commented 1 year ago

If the intention is to replace hit points with wounds, like DF, there will also have to be different severity of wounds based on what is now HP total, or else the things which currently make HP greater won’t increase the amount of damage a limb can take.

If the intention is to use wounds to reduce limb HP, the way Rimworld does, then the severity of a wound should also scale with limb HP, to avoid having a superficial scratch destroying the weakest limb, while the strongest will be able to withstand multiple of the maximum wound while still retaining HP.

In either case, “pain” as a general negative effect on the brain isn’t reasonably modeled as the sum of the pain levels of individual wounds. Something like “maximum pain of any wound, plus a small fraction of all other wounds” for the passive pain caused by all wounds would make more sense. Using a wounded limb might also cause additional pain, but that should be deferred until there’s a way to avoid using a limb (wielding with specific hands, one-handed crafting, limping and hand-crawling as movement options).

Electrical burns, fire burns, and chemical burns are all subtly different; electrical burns are more of a deep tissue, while fire and chemical burns start out superficial and only affect deeper tissue after prolonged/repeated instances of damage. Washing off an electrical zap will do nothing compared to just stopping further zaps, but washing off a steam or chemical burn immediately will reduce the damage lower than just stepping out of the steam or not getting more caustic chemical on you. Electrified slashing or piercing weapons might also cauterize their wounds and have less bleeding than their piercing or slashing elements would suggest.

On the subject of bleeding, please recognize that absorbent menstrual products don’t do anything to mitigate blood loss, they just absorb the blood and keep it from making a mess. Bandages and other coagulating methods form a barrier that keeps the blood in the circulatory system, while adsorption products just soak up as much as possible and keep blood in themselves and off of clothing and the ground.

“Infection” could be one thing, but building a system that allows for different types of infections and spread seems worthwhile; a wound could have staph and/or tetanus, and localized necrosis should be different from a systemic blood infection. Scifi or magic diseases like fungal infection as bloodborn or neurological or merely “systemic” infections could generalize lots of things to the immune system, which could itself be modeled as having a single axis of strength which is depleted by and opposes each infection.

keampe commented 1 year ago

Something to consider - as someone who has been seriously injured - is that pain isn't constant, it has spikes mostly related to moving a certain way or bumping the injury but sometimes for no reason. This could be tied to exertion level, for ex.

As to infection: pretty much every wound that breaks the skin has some level of infection and all injuries have some level of inflammation. However, we have an immune system. the infection currently in CDDA is a very bad one like septic shock or something and is not really appropriate to most injuries. There's a benefit to having at least differing severity of infections, most of which will go away given time. The survivor may not know that and it would be a good idea to take antibiotics as a prophylactic.

Just some thoughts.

I-am-Erk commented 1 year ago

So, wound treatment as a general entity can get extremely complex as we go along. At some point I want to see people debriding tissue from a deep wound with a burn component... But that is not for now.

What I think you need to consider in the short term, when you design how treatments apply to wounds, is that some treatments become part of the wound package so that things may happen to them. Your bandages may become soaked with blood, or stuck to the wound, or filthy with infection or from zombie puke. We don't need to track that now but we should store the "bandaged" concept in such a way that we can do something with it later.

In general we currently model three main categories of wound care:

I think hemostasis is presently fairly well modelled but I don't know how it's done or if the current models can be transferred to the old one. I do think that we will probably need to incorporate an element of wound size to the bandage used, so for example an adhesive bandage has a small max size after which you just can't use it.

We currently don't model wound protection all that much and I don't know if you want to get into it either, but one cool thing is that with how you're doing size and location you can now better model your bandages getting damaged in an attack. I've got thoughts there but I have to save this and try to return

Venera3 commented 1 year ago

The main point where our hemostasis simulation (and it is the best of all mentioned) falls down is bandages/pressure wizarding away the bleeding, never to return.

Contamination leading to infection would let us differentiate pre-Cataclysm actually sterile / freshly sterilized materials from makeshift stuff better. The contamination level could be set per-monster attack to cut down on the bite special casing.

For cleaning/bandaging I'd probably go with a few levels as activities either from the medical or the % menu, the Consume popup would probably not cut it - something like "first aid / clean and bandage / full service" as levels, runnable per-wound or for all your eligable wounds. Full service would ideally include suturing/splinting, proficiencies permitting, and the exact treatment options (and potentially effects) could probably live in the wound itself, e.g.

{ method: bandaging, time_mul: 1.5, bleed_mod: [ 0.9, 0.0 ]}, 
{ method : cleaning, cont_mod: [ 0.7, 0.0], time_mul: 2.0},
{ method: suturing, progress: [ 5, -20 ], bleed_mod: [ 1.1, 0.0 ]}

translating to "This wound can be bandaged 1,5 times slower than the base bandaging time, leading to a bleed intensity reduction between 10-100% depending on your success roll, cleaned 2 times slower for a 30-100% contamination reduction or sutured (once) to increase wound progression and bleeding for a botched treatment or reduce both on success." First aid would amount to hastily slapping a bandage on it (we can probably abstract away fixation needs, for now), cleaning would make secondary complications less likely and passively increase healing rate if contamination has a negative effect on that, while suturing would be the Actual Treatment if you can do it (or get an NPC to do it for you competently, down the line).

kevingranade commented 1 year ago

Backing up a bit to how wounds are supposed to work in the final version my concept for this is tied into stamina and dodge and blocking and armor.

The idea is that when you're fresh and ready to fight that typical enemies aren't going to have an easy time hurting you significantly. They're just going to be landing glancing blows that will sometimes cause minor wounds like bruises or scratches or abrasions, but then as you get tired and as those wounds accumulate or in some cases compound such as by a bruise landing on top of another bruise and causing a more severe bruise or an open contusion, those same attacks are landing more squarely and causing more severe hits that start more significantly impairing your fighting ability. This eventually leads to a wound spiral where if you don't get out of combat even basic enemies are going to be able to take you down.

Another example of your condition deteriorating is if you take a hit to an existing minor wound such as a bruise, you might get an acute pain penalty that costs you some move points for the turn. Yes this could lead to a stun lock and that's intended.

As for recovery, my idea is that wounds need to be treated to reduce their impact , maybe to nothing in some cases, but then treated wounds are essentially new weak points that reduce the threshold for taking further wounds. For example you get a stab wound, you clean it, stitch it, cover it with a bandage, but now if that gets hit by even a minor attack it's at risk of popping stitches and reverting to an open wound. Severe wounds can be mitigated by treatment but will still inflict penalties and in some cases may be vulnerable to reverting to untreated based on ordinary activity such as running or even walking. At the extreme, there is a point where you need bed rest to recover enough to do even ordinary activities.

The failure condition is bleeding or suffocation from being piled on in the short term or potentially being unable to protect yourself from special attacks such as bites which can cause infections down the road.

I really like the idea of pain being a thing that is triggered by different actions instead of a constant thing, at least narratively, but we need to be careful to communicate what the impact of that is, like walking is impaired by x, running is impaired by y, melee attacks are impaired by z. It gets even more complicated when you get into different penalties, like move point penalties vs success chance penalties. It's also not great if it's too unpredictable, i.e. move point penalties for the same action varying by large amounts each turn.

Some technical details: I like the simple number line per limb concept, I don't see any meaningful reason to try and make it a 2D location. Wound size would be based on irl representative values, and the number line for a limb would be scaled to the surface area of that limb, but in thinking we can map wounds to locations with a normal curve instead of linear because there will be a pretty strong tendency for attacks to hit the same spots. Then we can tune how likely overlapping hits are by varying the parameters of that normal curve. When wounds do overlap, what is our strategy for merging them? A simple option is to just take the min and max values for both wounds and the wound steadily grows. A more complex option would create 2 or 3 adjacent wounds on each overlap, each of which could have varying properties. The latter would tend to complicate wound treatment since now you need to try and consider treating these adjacent wounds together to avoid hundreds of individual wound entries.

On Mon, Apr 17, 2023, 12:47 AM Venera3 @.***> wrote:

The main point where our hemostasis simulation (and it is the best of all mentioned) falls down is bandages/pressure wizarding away the bleeding, never to return.

  • Both bandages and hemostatic powder should mitigate blood loss as long as they are applied, but on repeat damage the wound should start from the same intensity of bleed.
  • Tourniquets should apply a hard cap to bleeding on the limb in question, but don't change the wounds - in fact, they should also pause the heal timer on all of them. They are a stopgap solution to keep you alive until you get definite care.
  • Hand pressure should be the equivalent of bandages for the duration and could leave a manually compressed lingering bandage-like effect that similarly gets removed by repeat damage exposing the bleed

Contamination leading to infection would let us differentiate pre-Cataclysm actually sterile / freshly sterilized materials from makeshift stuff better. The contamination level could be set per-monster attack to cut down on the bite special casing.

For cleaning/bandaging I'd probably go with a few levels as activities either from the medical or the % menu, the Consume popup would probably not cut it - something like "first aid / clean and bandage / full service" as levels, runnable per-wound or for all your eligable wounds. Full service would ideally include suturing/splinting, proficiencies permitting, and the exact treatment options (and potentially effects) could probably live in the wound itself, e.g.

{ method: bandaging, time_mul: 1.5, bleed_mod: [ 0.9, 0.0 ]}, { method : cleaning, cont_mod: [ 0.7, 0.0], time_mul: 2.0}, { method: suturing, progress: [ 5, -20 ], bleed_mod: [ 1.1, 0.0 ]}

translating to "This wound can be bandaged 1,5 times slower than the base bandaging time, leading to a bleed intensity reduction between 10-100% depending on your success roll, cleaned 2 times slower for a 30-100% contamination reduction or sutured (once) to increase wound progression and bleeding for a botched treatment or reduce both on success." First aid would amount to hastily slapping a bandage on it (we can probably abstract away fixation needs, for now), cleaning would make secondary complications less likely and passively increase healing rate if contamination has a negative effect on that, while suturing would be the Actual Treatment if you can do it (or get an NPC to do it for you competently, down the line).

— Reply to this email directly, view it on GitHub https://github.com/CleverRaven/Cataclysm-DDA/issues/64424#issuecomment-1510864028, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGSA5G3ZQQBOR5P5CXJQMLXBTYSZANCNFSM6AAAAAAWBVE6JM . You are receiving this because you commented.Message ID: @.***>

DeciusBrutus commented 1 year ago

The idea is that when you're fresh and ready to fight that typical enemies aren't going to have an easy time hurting you significantly. They're just going to be landing glancing blows that will sometimes cause minor wounds like bruises or scratches or abrasions, but then as you get tired and as those wounds accumulate or in some cases compound such as by a bruise landing on top of another bruise and causing a more severe bruise or an open contusion, those same attacks are landing more squarely and causing more severe hits that start more significantly impairing your fighting ability. This eventually leads to a wound spiral where if you don't get out of combat even basic enemies are going to be able to take you down.

Implementing that in a consistent manner is also going to require that enemies' combat prowess, including their ability to resist further damage, degrade with injuries to them. If the same injury system is implemented to enemies, it brings up questions about enemies with physiology remarkably different from human baseline. It might be reasonable to consider robotic frames like bones, and wires like nerves, and hydraulic lines like major blood vessels; but blobs don't have anatomy that would be affected similarly, and building bodies for all of the eldritch horrors and portal creatures is a nontrivial required element of using a robust wound system for enemies in general. In addition, an overhaul of the weakpoint system is necessary to implement equivalent handling of injuries to monsters and humans.

One likely complication that I see is that a good injury system will over-emphasize tactics of delivering bleeding wounds and then retreating to let the bleeding weaken or finish off the enemy. I think that outcome is not undesirable, since it would not work against enemies with physiology that doesn't suffer from blood loss and would encourage weapons that inflict non-superficial bleeding, disrupting the meta of the fastest knives being dominant.

On the subject of debridement and other forms of wound cleaning, I think that is a great place to bring the tool quality system into play; needlenose pliers and cotton patches with soap could have 'wound cleaning 1', tweezers or a water flosser with clean water 2, and up to a proper medical toolkit having a wound cleaning of 5. A steel needle and thread might have suturing of 1, cyanoacetate glue a suturing of 3, and a suture kit a suturing of 5, with intermediate values used for approximations or better or worse makeshift tools.

Making things sterile isn't some difficult industrial process; a pressure cooker can destroy bacteria, viral protein coatings, fungal spores, and even prions in 20 minutes at pressure. Some inorganic chemical contaminants might survive the process, but those largely won't be present in linens getting cut up into bandages. Merely boiling or bleaching typical linens will make them sterile enough, although they might not stay that way after being stuffed in a pocket and submerged in the sewer.

As for modelling reopening a wound, I think that having a 'bleeding' and a 'clotted' state, where pressure and tourniquets reduce 'bleeding' while applied, but bandages and styptics increase 'clotted' over time, and the blood loss per tick is based on bleeding-clotted. Various things could reduce 'clotted' directly, like aspirin in the system, high exertion, or further damage to the area.

And from a narrative enabling aspect, I think it's important to ask if we want to prevent the kind of story that has a finale that is a staple of action movies, where Ahnold gets shot in the shoulder and punched around a bit before using an environmental advantage to perform a reversal, deliver a one-liner, and then get medical attention.. If wounds reduce immediate capacity too much, then there isn't room for a comeback, and if there is too little there isn't much point. Things like adrenaline effects mitigating the effects of pain for only several minutes seem ideal for letting injured characters finish one fight at slightly reduced capacity but not keep fighting forever.

kevingranade commented 1 year ago

Enemies don't need wounds because they aren't doing the things that wounds enable.

Monsters are a dime a dozen and nobody is treating their wounds, they don't survive long enough for any of this to matter.

Monster types especially can stick with a very stripped down system that tracks total damage taken plus perhaps some cumulative penalties inflicted by certain attacks.

On Mon, Apr 17, 2023, 5:39 PM DeciusBrutus @.***> wrote:

The idea is that when you're fresh and ready to fight that typical enemies aren't going to have an easy time hurting you significantly. They're just going to be landing glancing blows that will sometimes cause minor wounds like bruises or scratches or abrasions, but then as you get tired and as those wounds accumulate or in some cases compound such as by a bruise landing on top of another bruise and causing a more severe bruise or an open contusion, those same attacks are landing more squarely and causing more severe hits that start more significantly impairing your fighting ability. This eventually leads to a wound spiral where if you don't get out of combat even basic enemies are going to be able to take you down.

Implementing that in a consistent manner is also going to require that enemies' combat prowess, including their ability to resist further damage, degrade with injuries to them. If the same injury system is implemented to enemies, it brings up questions about enemies with physiology remarkably different from human baseline. It might be reasonable to consider robotic frames like bones, and wires like nerves, and hydraulic lines like major blood vessels; but blobs don't have anatomy that would be affected similarly, and building bodies for all of the eldritch horrors and portal creatures is a nontrivial required element of using a robust wound system for enemies in general. In addition, an overhaul of the weakpoint system is necessary to implement equivalent handling of injuries to monsters and humans.

One likely complication that I see is that a good injury system will over-emphasize tactics of delivering bleeding wounds and then retreating to let the bleeding weaken or finish off the enemy. I think that outcome is not undesirable, since it would not work against enemies with physiology that doesn't suffer from blood loss and would encourage weapons that inflict non-superficial bleeding, disrupting the meta of the fastest knives being dominant.

On the subject of debridement and other forms of wound cleaning, I think that is a great place to bring the tool quality system into play; needlenose pliers and cotton patches with soap could have 'wound cleaning 1', tweezers or a water flosser with clean water 2, and up to a proper medical toolkit having a wound cleaning of 5. A steel needle and thread might have suturing of 1, cyanoacetate glue a suturing of 3, and a suture kit a suturing of 5, with intermediate values used for approximations or better or worse makeshift tools.

Making things sterile isn't some difficult industrial process; a pressure cooker can destroy bacteria, viral protein coatings, fungal spores, and even prions in 20 minutes at pressure. Some inorganic chemical contaminants might survive the process, but those largely won't be present in linens getting cut up into bandages. Merely boiling or bleaching typical linens will make them sterile enough, although they might not stay that way after being stuffed in a pocket and submerged in the sewer.

As for modelling reopening a wound, I think that having a 'bleeding' and a 'clotted' state, where pressure and tourniquets reduce 'bleeding' while applied, but bandages and styptics increase 'clotted' over time, and the blood loss per tick is based on bleeding-clotted. Various things could reduce 'clotted' directly, like aspirin in the system, high exertion, or further damage to the area.

And from a narrative enabling aspect, I think it's important to ask if we want to prevent the kind of story that has a finale that is a staple of action movies, where Ahnold gets shot in the shoulder and punched around a bit before using an environmental advantage to perform a reversal, deliver a one-liner, and then get medical attention. https://www.youtube.com/watch?v=aEBEm4-AMBo. If wounds reduce immediate capacity too much, then there isn't room for a comeback, and if there is too little there isn't much point. Things like adrenaline effects mitigating the effects of pain for only several minutes seem ideal for letting injured characters finish one fight at slightly reduced capacity but not keep fighting forever.

— Reply to this email directly, view it on GitHub https://github.com/CleverRaven/Cataclysm-DDA/issues/64424#issuecomment-1512279980, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGSA5CW4LHYCD4JM3HGKFDXBXPDBANCNFSM6AAAAAAWBVE6JM . You are receiving this because you commented.Message ID: @.***>

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not bump or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

MNG-cataclysm commented 10 months ago

I'm planning on adding the loss of limbs to the game at some point. KorGgenT referred me here to discuss more about this, so I have a plan laid out on how limb loss in combat would work, so far this is it:

When in combat, damage (calculated after armor negations) that equals or exceeds 20% of the limbs maximum HP has a chance of cutting or tearing it off. Using an EOC condition to check this, that attack then has a base 5% chance to shear off the limb. If it does, apply the proper effects/mutations/etc. to the character and give severe bleeding to the part that limb was attached to (hand -> arm, arm -> torso, so on.). Attacks that do enough damage to reach a higher percent threshold then have a greater chance to remove the limb, I’d say in increments of 2% for every additional 10% of the limbs HP, topping out at a 100% chance to shear off the limb when the damage is 1.5 times that of the limb’s maximum HP. This would avoid the previously “game-y” system of a flat 5% when the limb reaches 0 HP and would better reflect what kevingranade said on it in #69035; in-combat amputation not being the result of damage acclimation, but a critical strike. This also keeps zombies from poking the limb off for a single point of damage.

How's this sound?

I-am-Erk commented 10 months ago

I think that is a decent start, though I don't think eoc is the best language for it. Damage type should influence chance of removal though. That way when we add armour changing damage type it will also be able to naturally affect sever chance. Bludgeon damage should be more likely to break or mangle the limb. It takes truly massive bludgeon damage to remove it entirely. Piercing as well. Bullet less so but still a lot. Mostly it's only slashing damage that should be cutting limbs off at any reasonable frequency.

20% of limb hp is far too low though. A limb is huge. It is very hard to sever it in a single blow. It should be something like 50% of maximum limb hp in a single strike before there's even a noticeable chance of chopping it off, and even then we're talking like 1% chance. Significant chances should begin at a single hit that does 100% of limb max hp

MNG-cataclysm commented 10 months ago

Is there any sort of enemy in the game that can do enough damage to break a limb in a single strike?

MNG-cataclysm commented 10 months ago

Besides that, couldn't multiple consecutive hits to the area possibly speed up the process of chopping it off, especially with very sharp weaponry? What if we used an effect for such things, increasing in intensity as the limb gets hit? Or, is this too much like the previous system where consecutive damage would add up?

I-am-Erk commented 10 months ago

At some point using the wound system described here we'd be able to make partial amputations increase the chance of a full amputation, but the first pass should be the very basic stuff; we assume the strike does not hit in the same place as previous strikes until we have the ability to track that. On the first pass also, limb removal is essentially just a new way to describe player/npc death.

It doesn't really matter if there are any enemies in the game that can chop your arm off in a single strike, that's not how we balance the game. If it becomes a concern for testing you could always add some kind of late-game blade monster.

Brambor commented 10 months ago

What about death (severed limb) by thousand cuts? If you cut enemy five times with an axe, chopping a limb off sounds plausible, like chopping down a tree.

I like the limb accumulating damage even when at 0 HP then for each cutting attack the chance of chopping off increases based on the negative HP (-70 represents arm barely hanging together, even punching the bone would break it).

In new (wounds) system, don't stop accumulating dmg if at threshold. And on every cut attack, after applying wound, if sum of all cut wounds is greater then limb HP, then roll a dice if it gets chopped off. The more wounds the higher the chance.

Or add the probability (P1) from existing damage to P2 of newly received damage. Then weak attacks have chance of chopping off only on damaged limbs. Strong attacks have a low chance on healthy limbs but much higher chance on damaged limbs. Still, only cutting attacks can chop off limbs.

I-am-Erk commented 10 months ago

The wound system allows for one wound to be on top of another like I said in my previous comment. However, what you're describing is sort of a useless thing to model... if the enemy is able to hack repeatedly at your limb until it comes off, you're already dead.

DeciusBrutus commented 10 months ago

I’m really confused at how anyone could think that a strike count amputate an arm without doing enough damage to render it unusable.

Either by hitting a joint and cutting through connective tissue, or cutting through the bone in addition to other connective tissue. Or when considering non-bony appendages, cutting through all of the nerves and blood vessels and connective tissue.

Brambor commented 10 months ago

@DeciusBrutus The arm would be unusable. But then, if your unusable broken arm gets abused more, you would lose it too. So you will not be able to just put splint on it and let it heal. And once it's gone it cannot prevent any blows from hitting the torso. If your arm is a big hanging shield.

Or some more minor but long lasting scars would be nice. Just as in aformentioned RimWorld.

I am also thinking about octopus mutation (I don't think that's a thing yet), where cutting a tentacle off wouldn't be so hard for the attacker and it wouldn't be so terrible to lose one arm for the octopus. They could regrow too, like starfish.

Or lizard mutation that detaches part of their body when it's grabbed for an advantage in fight. Or as a distraction when escaping as real lizards do.

And some monsters could have a shell or exoskeleton you would need to bash to break before you could cut underlying tissue. Breakable living shell-like armour. Telepatic antenas etc. But monsters are not considered for a wound system as far as I understand. I didn't read it carefully though.

keampe commented 10 months ago

Multiple wounds to the same limb beyond crippling it, if it doesn't just kill the person, would much more likely mangle the limb such that it's permanently disabled or, more likely, have to be amputated to avoid gangrene. This is amputation by a surgeon (ideally) done as part of treatment, not combat. It is highly, highly unlikely for someone to be hit in exactly the same spot over and over each blow whittling the arm away. You're hitting the limb in different locations as a rule.

Edit: And as it has been stated, the person is more likely to die from it.

Spicyshadow commented 10 months ago

After reading the discussion on the wound systeem I´m surprised that hygiene and cleanliness never came up. I´m not just talking about your characters washing every few days to keep general grime and dirt off of them although that should have an direct if minor impact on rate of wound contamination and an indirectly impact by boosting health (healing rate) and immunity.

Your character is going to be very filthy very often. Many activities such as butchering, hacking/pulping corpses and dissecting are going to have your character covered in blood, gore, etc. Your character is probably also going to be plastered in body fluids if they hack their way though dozens of enemies or get covered in bile by a boomer. This level of filthy would very quick contaminate any wound with very infectious material. Cleaning the zombie guts off of yourself and your clothing should be pretty high on the piority list if you don´t want your cleaned and bandaged wounds to get infected.

KorGgenT commented 10 months ago

i'd appreciate we keep on the topic of wounds in this design document. that (hygiene) is a very long and well-tread topic that i do not want to bog down this issue with.

zachary-kaelan commented 1 month ago

opens path to finally do drugs the right way, a drug is just an invisible wound (0 depth, 0 area, 0 intensity, 0/low infection chance) with a contaminant that enters the bloodstream, so a heroin shot is a contaminant that enters bloodstream virtually in an instant, alcohol is a contaminant that enters bloodstream slowly, etc... drugs can be non-pure too, with unknown mixed drugs (other contaminants), varied rates of purity, random dirty, etc

What you're describing is vitamins. I was actually already in the process of adding a vitamin for eye contamination to model conjunctivitis from extended smoke exposure, and of adding a filth vitamin accumulated from eating tainted materials and wearing filthy clothing.

I propose two new features, as infrastructure for wounds and their effects:

On overlapping wounds: