Skip to content

Cleanup of Level 0 Particles#6808

Merged
BMagnu merged 44 commits into
scp-fs2open:masterfrom
BMagnu:level0_particle_cleanup
Jul 9, 2025
Merged

Cleanup of Level 0 Particles#6808
BMagnu merged 44 commits into
scp-fs2open:masterfrom
BMagnu:level0_particle_cleanup

Conversation

@BMagnu

@BMagnu BMagnu commented Jul 5, 2025

Copy link
Copy Markdown
Member

Followup to #6465.
Closes #3049, Fixes #2321.

TL;DR of the user-facing changes and improvements:

  • These pseudo-particles now accept proper -part.tbm tabled particles:
    • Pspews
    • The Asteroid impact effect
    • Beam Muzzle Particles
    • Shield Impact Explosions
    • Debris Flame Particles (were previously handled in the MVPS via script)
  • Particle Effect Enhancements:
    • Velocity inherit can be disabled if the effect has a parent it can be made local to
    • A constant local velocity offset can be tabled, similar to the position offset
    • The bitmap animation can be set to play in reverse
    • New modular curve input "Apparent Visual Size At Emitter"
    • Modular curve inputs Spawntime Left / Time Running now properly account for interpolation
  • Enhancements to particle volumes:
    • New volume types of ring/disk as well as point
    • New modular curve input "Fraction Particles Spawned" for particle volumes
    • Volumes can now be tabled to have offsets and be rotated towards a point in localspace. Both the offset and this point can be rotated around the fvec using modular curves.
  • Miscellaneous:
    • Weapon Muzzle Effects now properly play in multiplayer
    • Significant performance costs in creating randomranges were removed
    • createParticle has been outright removed from the testing library (in gr. it still works as intended)
    • the Weapon_expl.tbl, which was barely used at all (only for lods), is now outright removed, as the new particle system doesn't need explicit lods
    • Pspews are no longer limited to 4
    • Pspew velocity inherit now works properly for all types.

This adds the level 0 particle cleanup mentioned in the particle rework.
Notably, this means that all particles are now spawned exclusively from static particle effects. No bit of the code is still creating particles ad-hoc. This allows to reduce the amount of data stored in each particle by giving the particle access to the static effect data it was spawned from. Furthermore, this access allows for much more flexible particle behaviour, as outlined in the original PR.

@BMagnu BMagnu added enhancement A new feature or upgrade of an existing feature to add additional functionality. cleanup A modification or rewrite of code to make it more understandable or easier to maintain. fix A fix for bugs, not-a-bugs, and/or regressions. refactor A cleanup/restructure of a feature for speed, simplicity, and/or maintainability particles An item related to the particle system labels Jul 5, 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 look good and overall great to have this cleanup and new features fully implemented!

@BMagnu BMagnu merged commit 82dfdbc into scp-fs2open:master Jul 9, 2025
20 checks passed
wookieejedi added a commit to wookieejedi/fs2open.github.com that referenced this pull request Jul 28, 2025
scp-fs2open#6808 converted all Pspews to use the new particle effects, though that in turn lead to a fun little visual bug. Overall, particles on weapons will only be rendered if they are valid, and the is valid check included a `weapon_state == m_weaponstate` check (IE states had to match between what the weapon object held and what the particle held. When a weapon switches to homing that particle state was never updated, b/c before 6808 it never needed to be. This lead to the particle effects from pspews not rendering when a missile was in homing mode.

This PR fixes that issue by also updating the particle host status whenever the weapon state changes (uses the same logic as when the particle spawns the first time).

Tested and works as expected.
wookieejedi added a commit that referenced this pull request Jul 28, 2025
#6808 converted all Pspews to use the new particle effects, though that in turn lead to a fun little visual bug. Overall, particles on weapons will only be rendered if they are valid, and the is valid check included a `weapon_state == m_weaponstate` check (IE states had to match between what the weapon object held and what the particle held. When a weapon switches to homing that particle state was never updated, b/c before 6808 it never needed to be. This lead to the particle effects from pspews not rendering when a missile was in homing mode.

This PR fixes that issue by also updating the particle host status whenever the weapon state changes (uses the same logic as when the particle spawns the first time).

Tested and works as expected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup A modification or rewrite of code to make it more understandable or easier to maintain. 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. particles An item related to the particle system refactor A cleanup/restructure of a feature for speed, simplicity, and/or maintainability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Particle Effects FR: Merging muzzleflash system with particle/action system Pspew: +vel doesn't do anything with 'ring'- and 'plume'-type spews

2 participants