-
Notifications
You must be signed in to change notification settings - Fork 739
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
Conversation
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.
This is to avoid unexpectedly high pain for small wounds or unexpectedly small pain for large wounds
Rather than guarantee
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).
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 |
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.
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Co-Authored-By: PabstMirror <[email protected]>
|
||
(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]; |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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).
In my opinion, blood should effect HR between 4 and 5 to make the ramp up more continuous |
@PabstMirror Yeah after seeing those graphs I've been thinking the same thing |
…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]>
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: