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 - Disable blood spurts for fire, burn and drown damage types #9001

Merged
merged 4 commits into from
Aug 25, 2022

Conversation

veteran29
Copy link
Member

When merged this pull request will:

  • title
  • Added noBlood config param to the damageTypes configs in ACE_Medical_Injuries
  • Docs

Gotta go fast.

```sqf
// Execution Time: 0.0018 ms  |  Cycles: 10000/10000  |  Total Time: 18 ms
getNumber (configFile >> "ACE_Medical_Injuries" >> "damageTypes" >> "burn" >> "noBlood");
```

```sqf
// Execution Time: 0.0008 ms  |  Cycles: 10000/10000  |  Total Time: 8 ms
ace_medical_blood_noBloodDamageTypes getOrDefault ["burn", false];
```
@veteran29 veteran29 added the kind/enhancement Release Notes: **IMPROVED:** label Aug 15, 2022
@veteran29 veteran29 added this to the 3.15.1 milestone Aug 15, 2022
@veteran29
Copy link
Member Author

FIY @pterolatypus

@pterolatypus
Copy link
Contributor

pterolatypus commented Aug 15, 2022

ideally I would like to see this be based on wound type rather than damage type, but that would require a bit of restructuring
as it is, it looks fine. I'd be interested to know if there is actually any benefit to caching the config at prestart rather than just reading it fresh at preinit.

```sqf
// Execution Time: 0.0006 ms  |  Cycles: 10000/10000  |  Total Time: 6 ms
"burn" in ace_medical_blood_noBloodDamageTypes;
```
@veteran29
Copy link
Member Author

I'd be interested to know if there is actually any benefit to caching the config at prestart rather than just reading it fresh at preinit.

// Execution Time: 0.0015 ms  |  Cycles: 10000/10000  |  Total Time: 15 ms
(call (uiNamespace getVariable "ace_medical_blood_noBloodDamageTypes"))
// Execution Time: 0.0234 ms  |  Cycles: 10000/10000  |  Total Time: 234 ms
"getNumber (_x >> 'noBlood') == 1" configClasses (configFile >> "ACE_Medical_Injuries" >> "damageTypes") apply {[configName _x, nil]}

Is it worth it? Not sure but it's how we've been doing it in other components so doing it like this for consistency. Also, the more damage types the slower the config crawl so not doing that on every mission load is in theory beneficial if there's a lot of custom damage types (unlikely).

@pterolatypus
Copy link
Contributor

fair enough, that's more than I was expecting

Copy link
Member

@mharis001 mharis001 left a comment

Choose a reason for hiding this comment

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

Code LGTM.

@PabstMirror PabstMirror merged commit ecb7721 into master Aug 25, 2022
@PabstMirror PabstMirror deleted the medical-noBlood branch August 25, 2022 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants