Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Medical - Fix severity of wound bleeding and adjust cardiac output calculations #7010

Merged
merged 8 commits into from
Jun 10, 2019

Conversation

kymckay
Copy link
Member

@kymckay kymckay commented May 20, 2019

My attempt at fixing the bleeding in current medical rewrite. If we go this route it will deprecate #6941. My researching steps before implementing these changes can be found on #6906.

I'm simplifying the nastiness calculations so that the wound config specifies the worst wound and we scale it between 25% to 100% based on the wound damage and number of wounds received. Worth noting that the damage value is larger when limbs are damaged, so I'm scaling wounds to those half as much.

Similarly I've updated the wound configs to more reasonable maximum bleeding values based on the fact that they're percentages of cardiac output being bled.

In my testing, these values tend to give a bleeding of roughly 0.075 for a typical single gunshot wound which translates to approximately 5 minutes before entering cardiac arrest.

Unrelated to this PR, something I noticed during testing:

  • If you shoot a unit in the face with a tank, it actually produces a nicer wound than a gunshot. I think this is due to the way we're processing incoming damage not recognising the severity of tank shells.

I'm simplifying the nastiness calculations so that the wound config
specifies the worst wound and we scale it between 25% to 100% based
on the wound damage and number of wounds recieved.

Similarly I've updated the wound configs to more reasonable maximum
bleeding values based on the fact that they're percentages of cardiac
output being bled.
@kymckay kymckay added kind/enhancement Release Notes: **IMPROVED:** area/focus-feature labels May 20, 2019
@kymckay kymckay added this to the Medical Rewrite milestone May 20, 2019
kymckay added 5 commits May 20, 2019 21:14
This is to avoid unexpectedly high pain for small wounds or unexpectedly
small pain for large wounds
This handles torso wounds better as they're typically around 0.3-0.6 for
6.5mm shots which makes them roughly medium sized.
Previously the calculation didn't make sense as it wasn't outputting
a value in l/s. This method of calculation makes more logical sense and
provides a point of reference for what the bleeding values actually
represent (percentage of the blood being pumped that is lost - which now
has an actual volumetric value).
@kymckay
Copy link
Member Author

kymckay commented May 31, 2019

After some internal discussion about the cardiac output calculation, I've implemented a new calculation based on just looking at the units of the quantities and the definition of cardiac output.

I've used an assumption that reduced blood volume results in less blood entering the heart with each beat (or stroke) and an approximate relation via linearConversion. Perhaps we'd want to make the relation nonlinear.

Pretty sure someone accidnentally got these conditions the wrong way
around. This way blood pressure will first drop and then heart rate will
later go up to compensate.
@kymckay
Copy link
Member Author

kymckay commented Jun 9, 2019

I decided to leave the ventricle volume the same and test this out with the change to heart rate skyrocketing (because it's much more significant). Very happy with the results here, if anything blood loss might even be a little on the slow side now (we could tone down the blood volume scaling in cardiac output a bit if we want to change that).


private _bleeding = _injuryBleedingRate * _bleedingModifier;
// More wounds means more likely to get nasty wound
private _countModifier = 1 + random(_i - 1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand this line, if I test multi hit wound like
[cursorTarget, 0.4, "body", "shell", player] call ace_medical_fnc_addDamageToUnit
I get

test: _i=1, _countModifier=1 z\ace\addons\medical_damage\functions\fnc_woundsHandlerSQF.sqf:102
test: _i=2, _countModifier=1.44389 z\ace\addons\medical_damage\functions\fnc_woundsHandlerSQF.sqf:102
test: _i=3, _countModifier=1.91001 z\ace\addons\medical_damage\functions\fnc_woundsHandlerSQF.sqf:102
test: _i=4, _countModifier=3.46463 z\ace\addons\medical_damage\functions\fnc_woundsHandlerSQF.sqf:102
test: _i=5, _countModifier=2.4834 z\ace\addons\medical_damage\functions\fnc_woundsHandlerSQF.sqf:102

if we create 5 random wounds, why do the later ones bleed more?

Copy link
Member Author

@kymckay kymckay Jun 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's basically just making it so that if you receive multiple wounds all at once, subsequent wounds have a higher chance of being worse.

Edit: Could easily take this out if we don't want that behaviour. Although this would result in damage that gives multiple wounds all being the exact same wound.

@PabstMirror
Copy link
Contributor

master
master

pr
pr

Co-Authored-By: PabstMirror <[email protected]>
@PabstMirror PabstMirror changed the title Fix severity of wound bleeding Medical - Fix severity of wound bleeding and adjust cardiac output calculations Jun 10, 2019

(0 max _cardiacOutput)
// Blood volume ratio dictates how much is entering the ventricle (this is an approximation)
private _entering = linearConversion [0.5, 1, _bloodVolumeRatio, 0, 1, true];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm worried this will block CO and bleeding when blood gets too low (e.g. CPR)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I set the conversion based on the bleedout condition at 50% volume so it should never become 0 currently. We will presumably need to change it when dealing with the vitals loop during cardiac arrest stuff (if we remove that death condition).

@PabstMirror
Copy link
Contributor

In my opinion, blood should effect HR between 4 and 5 to make the ramp up more continuous
Merging for now, as these are things we can tweak later

@kymckay
Copy link
Member Author

kymckay commented Jun 10, 2019

@PabstMirror Yeah after seeing those graphs I've been thinking the same thing

BaerMitUmlaut pushed a commit that referenced this pull request Aug 5, 2019
…lculations (#7010)

* Fix severity of wound bleeding

I'm simplifying the nastiness calculations so that the wound config
specifies the worst wound and we scale it between 25% to 100% based
on the wound damage and number of wounds recieved.

Similarly I've updated the wound configs to more reasonable maximum
bleeding values based on the fact that they're percentages of cardiac
output being bled.

* Limit variance of pain modifier

This is to avoid unexpectedly high pain for small wounds or unexpectedly
small pain for large wounds

* Make more wounds increase chance for nastiness

Rather than guarantee

* Adjust worst damage scaling

This handles torso wounds better as they're typically around 0.3-0.6 for
6.5mm shots which makes them roughly medium sized.

* Fix cardiac output calculation

Previously the calculation didn't make sense as it wasn't outputting
a value in l/s. This method of calculation makes more logical sense and
provides a point of reference for what the bleeding values actually
represent (percentage of the blood being pumped that is lost - which now
has an actual volumetric value).

* Fix blood pressure after change to cardiac output

* Fix heartrate skyrocketing between 5l and 4l blood

Pretty sure someone accidnentally got these conditions the wrong way
around. This way blood pressure will first drop and then heart rate will
later go up to compensate.

* Fix comment typo

Co-Authored-By: PabstMirror <[email protected]>
@PabstMirror PabstMirror modified the milestones: Medical Rewrite, 3.13.0, 3.13.0-temp2 Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/focus-feature kind/enhancement Release Notes: **IMPROVED:**
Projects
Development

Successfully merging this pull request may close these issues.

2 participants