Skip to content

Medical Engine - Remove ACE_HDBracket hitpoint#9732

Merged
LinkIsGrim merged 21 commits intomasterfrom
medical-noHDbracket
Jun 11, 2024
Merged

Medical Engine - Remove ACE_HDBracket hitpoint#9732
LinkIsGrim merged 21 commits intomasterfrom
medical-noHDbracket

Conversation

@LinkIsGrim
Copy link
Copy Markdown
Member

@LinkIsGrim LinkIsGrim commented Jan 14, 2024

When merged this pull request will:

  • Arma 2.16 adds "context" param to HD which lets us know if we're at the last iteration of the event: https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage
  • Some stuff had to be moved around in the function but it'll work the same.
  • While this means that medical will still work even with broken inheritance now, arm/leg hitpoints could still be missing due to the same issue. I've added a check for presence of those hitpoints, but it's slower than just checking HDBracket by about 25% (0.05ms for 1k iterations vs. 0.04ms). This is only relevant at unit init, and time is saved during damage events (which is where performance suffers most) by reducing a hitpoint.

I'm looking into whether it's possible to simplify more of the function via other events or the directHit param.

IMPORTANT

  • If the contribution affects the documentation, please include your changes in this pull request so the documentation will appear on the website.
  • Development Guidelines are read, understood and applied.
  • Title of this PR uses our standard template Component - Add|Fix|Improve|Change|Make|Remove {changes}.

@LinkIsGrim LinkIsGrim added the target/next-arma Requires something in arma dev branch label Jan 14, 2024
@LinkIsGrim LinkIsGrim marked this pull request as draft January 14, 2024 16:50
@veteran29 veteran29 added the kind/enhancement Release Notes: **IMPROVED:** label Jan 14, 2024
Comment thread addons/medical_engine/XEH_postInit.sqf
Comment thread addons/medical_engine/functions/fnc_handleDamage.sqf Outdated
Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>
@PabstMirror PabstMirror changed the title Medical Engine - Remove ACE_HDBracket hitpoint Medical Engine - Remove ACE_HDBracket hitpoint [2.16] Jan 16, 2024
@johnb432 johnb432 added the 2.16 label Feb 3, 2024
@johnb432
Copy link
Copy Markdown
Contributor

johnb432 commented Feb 8, 2024

Looks like this has been pushed to 2.18
https://community.bistudio.com/wiki?title=Arma_3:_Event_Handlers#HandleDamage

@johnb432 johnb432 added 2.18 and removed 2.16 labels Feb 10, 2024
@johnb432 johnb432 changed the title Medical Engine - Remove ACE_HDBracket hitpoint [2.16] Medical Engine - Remove ACE_HDBracket hitpoint [2.18] Feb 10, 2024
@LinkIsGrim
Copy link
Copy Markdown
Member Author

Check if this made it into 2.16 or not. SPOTREP says it did.

@LinkIsGrim LinkIsGrim removed target/next-arma Requires something in arma dev branch 2.18 labels Mar 26, 2024
@LinkIsGrim
Copy link
Copy Markdown
Member Author

Made it into 2.16. Just need to fix merge conflicts

@LinkIsGrim LinkIsGrim marked this pull request as ready for review March 26, 2024 14:15
@LinkIsGrim LinkIsGrim requested a review from veteran29 March 26, 2024 14:15
Comment thread addons/medical_engine/XEH_preInit.sqf Outdated
Comment thread addons/medical_engine/XEH_postInit.sqf Outdated
Comment thread addons/medical_engine/script_component.hpp Outdated
Comment thread addons/medical_engine/functions/fnc_handleDamage.sqf Outdated
@johnb432
Copy link
Copy Markdown
Contributor

I was not expecting this at all and thought we had more time for 2.16.

@LinkIsGrim
Copy link
Copy Markdown
Member Author

Eh, it'll work.

@LinkIsGrim LinkIsGrim added this to the 3.17.1 milestone Mar 26, 2024
@jonpas
Copy link
Copy Markdown
Member

jonpas commented Mar 28, 2024

Don't we need to include this in 3.17.0 for 2.16 compatibility?

@LinkIsGrim
Copy link
Copy Markdown
Member Author

Nothing breaks AFAIK

Comment thread addons/medical_engine/functions/fnc_handleDamage.sqf Outdated
@johnb432
Copy link
Copy Markdown
Contributor

johnb432 commented Apr 1, 2024

Doesn't seem like anything breaks, at least for "normal" damage (being shot, being driven over and falling). I didn't test very much, I feel more in depth testing could be better done by an RC.

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
@LinkIsGrim LinkIsGrim dismissed veteran29’s stale review April 4, 2024 11:08

Stale, handled

@LinkIsGrim LinkIsGrim modified the milestones: 3.17.1, 3.18.0 Apr 7, 2024
@johnb432 johnb432 self-requested a review May 26, 2024 08:36
Copy link
Copy Markdown
Contributor

@johnb432 johnb432 left a comment

Choose a reason for hiding this comment

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

Tested being shot, falling, being driven over, crashing and drowning - all work as expected.

Comment thread addons/medical_engine/XEH_postInit.sqf Outdated
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
@johnb432 johnb432 self-requested a review June 3, 2024 09:07
Copy link
Copy Markdown
Contributor

@johnb432 johnb432 left a comment

Choose a reason for hiding this comment

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

LGTM, testing suggests this is fine.

@Mike-MF
Copy link
Copy Markdown
Member

Mike-MF commented Jun 7, 2024

I played around with this for about an hour or so, tried a bunch of things to cause different types of injury, no obvious issues or errors.

Only change this PR needs to address now is this:

[false] call compile preprocessFileLineNumbers QPATHTOF(dev\test_hitpointConfigs.sqf);

Comment thread addons/medical/dev/test_hitpointConfigs.sqf Outdated
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
@LinkIsGrim
Copy link
Copy Markdown
Member Author

Green button go brrt (flood my inbox if something breaks)

@LinkIsGrim LinkIsGrim merged commit a85074a into master Jun 11, 2024
@LinkIsGrim LinkIsGrim deleted the medical-noHDbracket branch June 11, 2024 14:11
blake8090 pushed a commit to blake8090/ACE3 that referenced this pull request Aug 18, 2024
* Medical Engine - Remove ACE_HDBracket hitpoint

* skip context 4

* move checks to vars

* skip uav/logic entities

* add check for arm/leg hitpoints

* Update addons/medical_engine/functions/fnc_handleDamage.sqf

Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>

* don't skip context 2

* clearer custom hitpoint array name

* reenable compile cache

* remove debug mode

* lazy eval

* whitespace

* update comment

* Update fnc_handleDamage.sqf header

* Update addons/medical_engine/functions/fnc_handleDamage.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* Update addons/medical_engine/XEH_postInit.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

* update hitpoint test

* missing "

* Update addons/medical/dev/test_hitpointConfigs.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

---------

Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
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.

6 participants