ACE3 icon indicating copy to clipboard operation
ACE3 copied to clipboard

Frag - Rewrite (event handlers and dev functions)

Open lambdatiger opened this issue 6 months ago • 5 comments

This is a fork and revert of some of the features added in https://github.com/acemod/ACE3/pull/9728. Specifically, the spalling and fragmentation simulation are the same as the original with minor bug fixes, but the event handlers, dev functions, and some other parts of the framework are newer.

When merged, this pull request will:

  • Removes old system of tracking rounds by using a per frame event handler and implements BI projectile event handlers.
    • Removed spalling requiring multiple object "hitPart" event handlers to be added and removed.
  • Separates spall and frag config parameters into separate files.
  • More completely defines vanilla ammunition frag parameters.
  • Replaces debug functions that used per frame event handlers with those found in https://github.com/acemod/ACE3/pull/9728
    • Small changes to these from the other PR include the removal of reference to fragCount config variable.
  • Moves repeated config checks and common parameters to separate functions leveraging hashmaps.
  • Since blacklisting is local, we can remove the event handlers to avoid having to check projectile variables multiple times.
  • Cleaned some magic numbers out of both doSpall and frago functions.
  • Removed unused variables and lines of code with no effects in frago.
  • Minor changes from https://github.com/acemod/ACE3/pull/9728.
    • Implemented better method for getting list of targets in frago.
    • Checking to make sure fragments aren't targeted at playable logic in frago.
    • Minor calculation optimizations in frago and doSpall.
  • Fragments and spall now inherit shotParents parameters.
    • ~~If someone would like the first parameter (vehicle) of setShotParents/getShotParents to be preserved, let me know.~~ Dedmen does a good job describing the uses for the first parameter (owner, not vehicle) on the ACE discord here.
  • Updated documentation to properly note that config value ace_frag_enabled doesn't do anything.

As always, I appreciate feedback and criticism!

Todo

  • [x] MP testing - small scale (2x player + dedicated)
  • [x] Re-review when more awake

IMPORTANT

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

lambdatiger avatar Jul 30 '24 04:07 lambdatiger