Skip to content

fix(particlesys): Load particle system templates in headless mode without retail compatibility - #3055

Open
Okladnoj wants to merge 1 commit into
TheSuperHackers:mainfrom
Okladnoj:okji/fix/headless-particle-templates
Open

fix(particlesys): Load particle system templates in headless mode without retail compatibility#3055
Okladnoj wants to merge 1 commit into
TheSuperHackers:mainfrom
Okladnoj:okji/fix/headless-particle-templates

Conversation

@Okladnoj

@Okladnoj Okladnoj commented Aug 3, 2026

Copy link
Copy Markdown

With RETAIL_COMPATIBLE_CRC=0 the dummy manager overrides init and reset with no-ops, so particle
system templates never load. Game logic reads those pointers: SpectreGunshipUpdate.cpp:618 skips its
gattling targeting block when the template is null and leaves m_gattlingTargetPosition and
m_okToFireHowitzerCounter unchanged. A headless client then diverges in logic CRC from a regular one.

Now the templates load in both modes. The createParticleSystem override from #3006 is kept in both modes
as well, so particle systems still do not accumulate.

The base createParticleSystem is now unconditionally virtual. It was already virtual in retail builds,
so retail vtables and CRC are unchanged; without it the dummy override does not compile at
RETAIL_COMPATIBLE_CRC=0.

Todo:

  • Replicate to Generals — N/A, it's in Core
  • vc6 retail replay CI: 0 errors on 10 retail 1.04 replays
  • Cross-platform replay run macOS/Windows: all compared frames match

Comment thread Core/GameEngine/Include/GameClient/ParticleSys.h Outdated
Comment thread Core/GameEngine/Include/GameClient/ParticleSys.h Outdated
// which are unfortunately needed to preserve the correct logic crc.
#else
virtual void init() override {}
virtual void reset() override {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We did this intentionally. We do not want particles to be created, unless it compiles with retail compatible crc because of the particle logic coupling bugs.

We already fixed 3 other places where particles where coupled to logic.

You can find them by searching for // TheSuperHackers @fix The particle system is now decoupled from the logic crc

Please try to fix the particle logic coupling in SpectreGunshipUpdate instead of creating particle templates again.

@Okladnoj
Okladnoj force-pushed the okji/fix/headless-particle-templates branch from d656c3f to 23cbbf0 Compare August 5, 2026 00:53
@Okladnoj

Okladnoj commented Aug 5, 2026

Copy link
Copy Markdown
Author

@Caball009 Caball009 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The title and description are no longer up-to-date, and provide inadequate rationale for this change. It's not at all clear to me why this change would be needed.

With RETAIL_COMPATIBLE_CRC=0 the headless dummy particle manager does not
load particle system templates, so data->m_gattlingStrafeFXParticleSystem
is null. The gattling targeting block was gated on that pointer, so a
headless client skipped it and left m_gattlingTargetPosition and
m_okToFireHowitzerCounter unchanged, diverging in logic crc from a
graphical client; the howitzer GameLogicRandomValue calls then cascade the
desync further.

Run the targeting logic whenever the gattling is firing in the non-retail
branch, independent of the template, and keep the template check only on
the client-side particle creation. The original condition is preserved
under RETAIL_COMPATIBLE_CRC so retail stays byte-identical even if an INI
omits the particle template. Matches the pattern used in EMPUpdate,
SpecialAbilityUpdate and TransitionDamageFX.
@Okladnoj
Okladnoj force-pushed the okji/fix/headless-particle-templates branch from 23cbbf0 to 53458d0 Compare August 5, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants