Skip to content

Frag - Spall simulation rewrite#10247

Merged
LinkIsGrim merged 378 commits intoacemod:masterfrom
lambdatiger:spall-rework-v2
Sep 21, 2024
Merged

Frag - Spall simulation rewrite#10247
LinkIsGrim merged 378 commits intoacemod:masterfrom
lambdatiger:spall-rework-v2

Conversation

@lambdatiger
Copy link
Copy Markdown
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
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
quick testing shows a whole 600ns increase in

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

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
@lambdatiger
Copy link
Copy Markdown
Contributor Author

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

@lambdatiger
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

lambdatiger commented Sep 19, 2024

Waiting on fix for arma-rs

Comment thread addons/frag/XEH_preInit.sqf Outdated
Comment thread addons/frag/functions/fnc_doSpallHitPart.sqf Outdated
Comment thread addons/frag/functions/fnc_doSpallHitPart.sqf
Comment thread addons/frag/functions/fnc_doSpallHitPart.sqf Outdated
for "_i" from 2 to 21 do
{
_spallPosASL = _lastSpallPos vectorAdd _deltaStep;
if (!lineIntersects [_lastSpallPos, _spallPosASL]) exitWith {
Copy link
Copy Markdown
Member

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

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

Otherwise lgtm

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