Skip to content

Unify Particle Attachment#6571

Merged
BMagnu merged 8 commits into
scp-fs2open:masterfrom
BMagnu:particle_attachment
Feb 3, 2025
Merged

Unify Particle Attachment#6571
BMagnu merged 8 commits into
scp-fs2open:masterfrom
BMagnu:particle_attachment

Conversation

@BMagnu

@BMagnu BMagnu commented Feb 2, 2025

Copy link
Copy Markdown
Member

A followup to #6465.
Note: This is not a behavioural change wrt. to 24.2, but it is a small change to current nightly. As such, it'd be great to include it in 25.0 as to avoid needing a flag to guard the behaviour change.

The main change, apart from a few tiny bugfixes, is that this PR will properly "parent" particle sources to things.
For example, impact spew and other similar particles were just anchored in space, rather than at the ship that was spewing. This has multiple detrimental effects:

  1. Modular curves don't have access to the ship data
  2. If your particle source has a lifetime > 0, your particles are in the wrong place as the emitting ship will have moved (this also applies to rotating submodels, which'll now be accounted for when a spawner is attached to one)
  3. You cannot parent the particle to the ship itself (glowing hull blobs as currently used in the MVPS for impact flashes of beams for example would greatly benefit from this).

Additionally, some particle sources that could not be parented (for example because the parent is dying) are being supplied the radius of the ship manually to allow access from modular curves.

Furthermore, modular curves are now supplied "trigger radius" and "trigger velocity".
This means, for example on weapon impact, a modder has access to both the velocity and radius of the particle host (the ship being hit), and the velocity and radius of the triggering object (in this case, the weapons radius and velocity) in modular curves.

@BMagnu BMagnu added enhancement A new feature or upgrade of an existing feature to add additional functionality. fix A fix for bugs, not-a-bugs, and/or regressions. labels Feb 2, 2025
@BMagnu BMagnu added this to the Release 25.0 milestone Feb 2, 2025

@wookieejedi wookieejedi left a comment

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.

Tests with new and existing features all work as expected. Also, highly useful features that further enhance the options for particle creation.

@Goober5000 Goober5000 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One comment...

Comment thread code/ship/ship.cpp
@BMagnu BMagnu merged commit 23dc22e into scp-fs2open:master Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement A new feature or upgrade of an existing feature to add additional functionality. fix A fix for bugs, not-a-bugs, and/or regressions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants