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

Frag - Spall simulation rewrite #10247

Merged
merged 378 commits into from
Sep 21, 2024
Merged

Conversation

lambdatiger
Copy link
Contributor

This PR is based on PR #10157 and requires it to be merged.

When merged this pull request will:

  • Leverages both projectile "HitPart" and "Penetrated" event handlers to avoid the changes in velocity, and therefore spall energy, being summed into the first "HitPart" event handler.
  • Switch spall production from individual projectile creation to submunition based creation.
  • Uses a method of approximating kinetic energy change based on velocity change and some rough coefficients to vary the amount of spall produced be different rounds.
    • Provides a coefficient in addon option to increase or decrease the amount of spall energy for any impact.
  • Considers material projectile impacts when producing spall.
    • Pre-caches material information for all BIS surface types, could be easily expanded to include all CDLC bisurfs.

Examples

20240823182414_1
40mm AP from a Badger IFV creating spalling within a room.
20240823181559_1
A 120mm HE round producing fragments (blue & green) outside a building, as well as spall (purple) within a room.

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}.

lambdatiger and others added 30 commits January 15, 2024 17:53
quick testing shows a whole 600ns increase in

Co-authored-by: johnb432 <[email protected]>
Co-authored-by: johnb432 <[email protected]>
Co-authored-by: johnb432 <[email protected]>
Co-authored-by: johnb432 <[email protected]>
@lambdatiger
Copy link
Contributor Author

Still working on the merge, will post when it's cleaned up

@lambdatiger
Copy link
Contributor Author

lambdatiger commented Sep 18, 2024

Currently causes a CTD by way of buffer overflow after CBA's preinit message. I can't seem to nail down why and it doesn't produce a mdmp so I can't pass it off.

Edit: Wasn't able to figure this out at the moment. If someone would confirm it happens on their side as well I'd appreciate it.

@lambdatiger
Copy link
Contributor Author

lambdatiger commented Sep 19, 2024

Waiting on fix for arma-rs

for "_i" from 2 to 21 do
{
_spallPosASL = _lastSpallPos vectorAdd _deltaStep;
if (!lineIntersects [_lastSpallPos, _spallPosASL]) exitWith {
Copy link
Contributor

Choose a reason for hiding this comment

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

if then {break} seems more readable to me but that's just personal preference.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I switched to this because it is slightly faster, but I definitely can change that if there was a readability issue for you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was it an issue for you reading it?

Copy link
Contributor

Choose a reason for hiding this comment

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

Just haven't been reading much SQF lately. It's fine.

Copy link
Contributor Author

@lambdatiger lambdatiger Sep 21, 2024

Choose a reason for hiding this comment

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

Oh, I could've made the change so a future person wouldn't struggle, but it's merged al;ready. I wasn't sure if that was an actual stumble or not.

Copy link
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.

Otherwise lgtm

addons/frag/functions/fnc_fired.sqf Show resolved Hide resolved
addons/frag/CfgAmmoSpall.hpp Outdated Show resolved Hide resolved
addons/frag/CfgAmmoSpall.hpp Outdated Show resolved Hide resolved
addons/frag/CfgAmmoSpall.hpp Outdated Show resolved Hide resolved
addons/frag/CfgAmmoSpall.hpp Outdated Show resolved Hide resolved
addons/frag/CfgAmmoSpall.hpp Outdated Show resolved Hide resolved
addons/frag/functions/fnc_doSpallPenetrate.sqf Outdated Show resolved Hide resolved
@LinkIsGrim LinkIsGrim merged commit c0b1a45 into acemod:master Sep 21, 2024
4 checks passed
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