Skip to content

Medical Damage - Add alternate armor penetration#9217

Merged
LinkIsGrim merged 85 commits intoacemod:masterfrom
LinkIsGrim:rework-armor-penetration
Jun 23, 2025
Merged

Medical Damage - Add alternate armor penetration#9217
LinkIsGrim merged 85 commits intoacemod:masterfrom
LinkIsGrim:rework-armor-penetration

Conversation

@LinkIsGrim
Copy link
Copy Markdown
Member

@LinkIsGrim LinkIsGrim commented Jun 14, 2023

When merged this pull request will:

  • Add alternate damage calculation that takes ammo's penetrative ability into account (aka "caliber"). Includes CBA setting to disable if players prefer previous balance or have custom ammo configs. The idea is that AP ammo should actually make a difference against armored infantry, rather than just cover and vehicles.
  • Pass ammo classname to wound handler data (validation for return data remains the same).

Requires #10573.

Armor is converted to RHAe ( pulled from \a3\Data_F\penetration\*.bisurf) based on its scaled value and ignored based on projectile's ability to penetrate material.

Balanced around ACE ammo values. We don't have to worry about 3rd party armor values because of #9216 and an armor soft-cap (at RHAe 110m) implemented in this PR. Overpenetration and angle of incidence are taken into account naturally by using impact damage to calculate impact speed, I actually trust the engine's handling of this more than whatever math we cook up.

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
Copy link
Copy Markdown
Member Author

I've realized a way to improve performance on this would be to move it to medical_damage instead, but I don't want to separate damage handling from engine (or add more things to the woundReceived event)

@LinkIsGrim
Copy link
Copy Markdown
Member Author

I'm happy with this for now. Ready for review.

@LinkIsGrim LinkIsGrim added the kind/feature Release Notes: **ADDED:** label Jun 19, 2023
@LinkIsGrim LinkIsGrim changed the title Medical Engine - Add alternate armor penetration WIP - Medical Engine - Add alternate armor penetration Jun 22, 2023
@LinkIsGrim
Copy link
Copy Markdown
Member Author

It's already a problem without this PR. NIArms ammo goes hard on hit but low on caliber for example. This at least finally sets a hard line in the sand for what works and what doesn't, IMO.

But thinking of fixing it:

  • I don't like the idea of having more compats we have to manually patch for. Dynamic projectile replacement to use ACE ammo based on some lookup would be great but performance-intensive.
  • This could be moved to a separate addon (medical_armorpen) with its own sub-compats for altering ammo stats (through hard patches). Hard-edits would disallow disabling this without removing the addon though.
  • Hard patches could target magazines and change their ammo instead, but again it's compat work. Probably the most compatible option going for that though.
  • Base penetration/damage on some other property, preferably from ballistics as that's mostly accurate across all mods, but I'm not a material expert either and there's some things you just can't derive from just ammunition weight, shape, and size.

@johnb432
Copy link
Copy Markdown
Contributor

It's already a problem without this PR. NIArms ammo goes hard on hit but low on caliber for example. This at least finally sets a hard line in the sand for what works and what doesn't, IMO.

I was just comparing the behaviour of when the setting is off vs. on. I use Sum of trauma as the fatal damage source, which makes it, with alternate armor pen off, take more or less the same amount of hits to kill an enemy with the same caliber. From a balancing point of view that's neat, mod provenance doesn't matter; however, from a realism point of view it sucks, as AP or any enhanced ammo like EPR doesn't make a difference.

Turning alternate armor pen on makes EPR and AP shine, although the amount depends on from which mod the ammo is from - is what I originally meant to say.

I don't like the idea of having more compats we have to manually patch for.

If we add patches, then it would have to be compats via ammo. Mod makers don't always use inheritance to the full extent when it comes to magazines, i.e. readding the ammo attribute every time. If we edit the ammo class itself, it's far less to deal with imo.
But as you said. this isn't ideal either, as disabling it means needing to remove the PBO(s). I'm also not a fan of doing things at runtime - need to think about this more.

@DJ-Reticuli

This comment was marked as off-topic.

@LinkIsGrim
Copy link
Copy Markdown
Member Author

LinkIsGrim commented Jun 18, 2025

Using round names for effect in damage calculations

No.

For the rest of the stuff if you can make it work consistently then open a PR.

@LinkIsGrim
Copy link
Copy Markdown
Member Author

If we add patches, then it would have to be compats via ammo. Mod makers don't always use inheritance to the full extent when it comes to magazines, i.e. readding the ammo attribute every time. If we edit the ammo class itself, it's far less to deal with imo.
But as you said. this isn't ideal either, as disabling it means needing to remove the PBO(s). I'm also not a fan of doing things at runtime - need to think about this more.

Worst case we make compats under the mods requiring ace_medical to be loaded and thus they'll be disabled alongside medical.

PabstMirror and others added 2 commits June 23, 2025 09:29
Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>
@DJ-Reticuli

This comment was marked as spam.

@LinkIsGrim LinkIsGrim merged commit f82c589 into acemod:master Jun 23, 2025
3 checks passed
@LinkIsGrim LinkIsGrim deleted the rework-armor-penetration branch June 23, 2025 21:04
@LinkIsGrim LinkIsGrim added this to the 3.20.0 milestone Jun 23, 2025
@LinkIsGrim LinkIsGrim added the kind/setting Release Notes: **SETTINGS:** label Jun 23, 2025
@Zantza
Copy link
Copy Markdown

Zantza commented Jun 27, 2025

Would it be possible to add a setting that acts as a multiplier to the round's penetration capability? To me it would seem by far the simplest way to eliminate discrepancies between how different mods configure their ammo. Or if people just don't want armor to be as impactful.

@LinkIsGrim
Copy link
Copy Markdown
Member Author

@Zantza sure, just add a new setting to initSettings and a coefficient to the penFactor

@olimolly
Copy link
Copy Markdown
Contributor

If I remember correctly, there was a slider to adjust the armor penetration in the Medical settings before the last update,
There is now only the checkbox ace_medical_alternateArmorPenetration ?

@olimolly
Copy link
Copy Markdown
Contributor

image

@olimolly
Copy link
Copy Markdown
Contributor

First of all, thank you very much for your efforts in improving the Ace medical system. However, I have noticed some inconsistencies in the latest update. (and sorry third but last post after more investigations).

The first issue is that the default settings are configured to prevent damage to limbs, which seems unusual.
Once activated, the threshold of 5.0 seems much too high as it does not inflict any damage. This is less obvious this time.
Next, I can't see any difference between JHP and FMJ ammunition, despite this being the whole point of the feature.
Finally, it seems that vanilla ammunition overrides all settings.

Besides, the RHS ammunition is causing deadly bruising, but not bleeding? I assume it's a bug, given that there is blood on the ground.

I ran the following linked tests with JHP and FMJ bullets from RHS (visible in the top right corner of the HUD), but could not notice any differences. Also it seems the vanilla handgun is not affected by the update/settings.

The feature is seeding a lot of misunderstanding among the community. Some damage were already controversial before the update and this one is giving more confusion about settings and the damage system.

I think everyone would appreciate if you could clarify some settings or rerun more tests.
Thank you in advance <3

https://www.youtube.com/watch?v=utSGyUVhAEM&feature=youtu.be

@johnb432
Copy link
Copy Markdown
Contributor

johnb432 commented Aug 16, 2025

The first issue is that the default settings are configured to prevent damage to limbs, which seems unusual.

No it doesn't. As you show yourself in your video, the vanilla P99 still damages limbs.

Once activated, the threshold of 5.0 seems much too high as it does not inflict any damage. This is less obvious this time.

What threshold are you talking about? What do you mean by 'this time'- context?

Next, I can't see any difference between JHP and FMJ ammunition, despite this being the whole point of the feature.

If you read the PR's description, this is in fact not the whole point of the feature. I'll quote directly:

The idea is that AP ammo should actually make a difference against armored infantry, rather than just cover and vehicles.

You have tested none of these in your video. Test any AP vs non AP ammo on armor: e.g. base game tracer vs ACE AP, or even RHS M855 vs RHS M855A1 and you'll notice a difference in how many shots it will take to knock a person unconscious (and you'll likely see a difference in wounds created).

Finally, it seems that vanilla ammunition overrides all settings.

What settings are you referring to - context?


I ran the following linked tests with JHP and FMJ bullets from RHS (visible in the top right corner of the HUD), but could not notice any differences. Also it seems the vanilla handgun is not affected by the update/settings.

ACE balances for the base game. RHS balances things much differently than the base game and we don't take that into account. Hence why you are seeing weird things like:

Besides, the RHS ammunition is causing deadly bruising, but not bleeding? I assume it's a bug, given that there is blood on the ground.

Why haven't we balanced RHS damage? It's simple: we haven't found a good approach for a solution yet.

@olimolly
Copy link
Copy Markdown
Contributor

olimolly commented Aug 16, 2025

Thanks a lot for direct answers !
I thought FMJ were AP but indeed not, I misunderstood that and the feature then, my bad. I'll then do more tests with your informations.

However, I genuinely still don't get everything yet. If the feature aims to change AP amo effect, should not we feel only changes for armored soldier ? Or is it like a needed global rewrite with side effects to be able to include this feature ?

No it doesn't. As you show yourself in your video, the vanilla P99 still damages limbs.

I just don't get why limbs are damaged when the option in set to never have damage on limbs.
With the information I have, it just makes me think vanilla is overriding the option since it's having different effect with the g17.

Once activated, the threshold of 5.0 seems much too high as it does not inflict any damage. This is less obvious this time.
What threshold are you talking about? What do you mean by 'this time'- context?

The limbs damaged threshold is set too high by default to use the RHS G17 for example.
It's obviously not the reference for mod testing but then, all mods amo and weapons needs re-test and patch ? It's like there is hidden armor in these pants as it shows only bruises damages. It's just confusing even if it has effect on killing the ai.

ACE balances for the base game. RHS balances things much differently than the base game and we don't take that into account. Hence why you are seeing weird things like:

Fair, so same problem as the question above.

Again, i just want to understand and help by giving feedback.

@johnb432
Copy link
Copy Markdown
Contributor

johnb432 commented Sep 2, 2025

I just don't get why limbs are damaged when the option in set to never have damage on limbs.

I suggest reading the tooltip of the setting, because that's not at all what that setting does. Feel free to ask on discord if you don't understand something, because it's off topic for this thread.

However, I genuinely still don't get everything yet. If the feature aims to change AP amo effect, should not we feel only changes for armored soldier ? Or is it like a needed global rewrite with side effects to be able to include this feature ?

It affects all armor, including armor that is in uniforms (which is more than you'd expect). I will try to take a look at what I can do to improve it.

@olimolly

This comment was marked as off-topic.

@olimolly

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Release Notes: **ADDED:** kind/setting Release Notes: **SETTINGS:**

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants