Skip to content

fix(spectregunship): Decouple particle system in SpectreGunshipUpdate::update from logic crc - #3055

Merged
xezon merged 2 commits into
TheSuperHackers:mainfrom
Okladnoj:okji/fix/headless-particle-templates
Aug 5, 2026
Merged

fix(spectregunship): Decouple particle system in SpectreGunshipUpdate::update from logic crc#3055
xezon merged 2 commits into
TheSuperHackers:mainfrom
Okladnoj:okji/fix/headless-particle-templates

Conversation

@Okladnoj

@Okladnoj Okladnoj commented Aug 3, 2026

Copy link
Copy Markdown

When the game logic was decoupled from the particle systems, SpectreGunshipUpdate was left coupled.

The gattling targeting logic only ran when the particle template was present. In headless mode (RETAIL_COMPATIBLE_CRC=0) the templates are not loaded, so the pointer is null and the block was skipped → the logic CRC of a headless client diverges from a graphical one.

Decoupled following the same pattern as the neighboring fixes (marker // TheSuperHackers @fix The particle system is now decoupled from the logic crc):

Retail is preserved under #if RETAIL_COMPATIBLE_CRC. Verified with a full deterministic replay (headless macOS ↔ Windows).

Comment thread Core/GameEngine/Include/GameClient/ParticleSys.h Outdated
Comment thread Core/GameEngine/Include/GameClient/ParticleSys.h Outdated
Comment thread Core/GameEngine/Include/GameClient/ParticleSys.h
@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.

@Okladnoj
Okladnoj force-pushed the okji/fix/headless-particle-templates branch from 23cbbf0 to 53458d0 Compare August 5, 2026 10:21
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 53458d0 to d9eaaeb Compare August 5, 2026 10:53
@Okladnoj Okladnoj changed the title fix(particlesys): Load particle system templates in headless mode without retail compatibility fix(spectregunship): Decouple gattling targeting logic from particle crc Aug 5, 2026
@Okladnoj

Okladnoj commented Aug 5, 2026

Copy link
Copy Markdown
Author

@xezon @githubawn
Fixed fix and discription

@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 current description and change make a lot more sense to me. I checked with RETAIL_COMPATIBLE_CRC disabled and there's indeed a mismatch issue here for headless mode.

I have added two suggested changes that'll provide a cleaner overall change.

PS: The game uses "gattling" all over the place, but the actual spelling is "gatling".

@Caball009
Caball009 dismissed their stale review August 5, 2026 14:07

Changes since review.

@Caball009

Copy link
Copy Markdown

I wonder if there are more cases like this that we overlooked. The retail compatible changes were checked pretty thoroughly with a lot replays, but that's less easy to do for non-retail.

@Caball009 Caball009 added Minor Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour Fix Is fixing something, but is not user facing NoRetail This fix or change is not applicable with Retail game compatibility ThisProject The issue was introduced by this project, or this task is specific to this project labels Aug 5, 2026
Apply review suggestions: move the tmp declaration into the retail branch,
restore the original shroud check, and pass the template directly to
createParticleSystem, which already null-checks it. Behavior is unchanged.

@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.

Looks good to me; good find.

The PR title might need a slight tweak (e.g. "gattling" is spelled incorrectly), but I'll leave that to xezon.

@Okladnoj Okladnoj changed the title fix(spectregunship): Decouple gattling targeting logic from particle crc fix(spectregunship): Decouple gatling targeting logic from particle crc Aug 5, 2026
@Okladnoj Okladnoj changed the title fix(spectregunship): Decouple gatling targeting logic from particle crc fix(spectregunship): Decouple Gatling targeting logic from particle crc Aug 5, 2026
@Okladnoj

Okladnoj commented Aug 5, 2026

Copy link
Copy Markdown
Author

"gattling"

fixed to Gatling, like wiki

@xezon xezon removed the ThisProject The issue was introduced by this project, or this task is specific to this project label Aug 5, 2026
@xezon xezon changed the title fix(spectregunship): Decouple Gatling targeting logic from particle crc fix(spectregunship): Decouple particle system in SpectreGunshipUpdate::update from logic crc Aug 5, 2026
@xezon
xezon merged commit 50f27e0 into TheSuperHackers:main Aug 5, 2026
11 checks passed
@Caball009

Copy link
Copy Markdown

Not that it really matters, but why did you remove the ThisProject tag?

@bobtista

bobtista commented Aug 5, 2026

Copy link
Copy Markdown

I wonder if there are more cases like this that we overlooked. The retail compatible changes were checked pretty thoroughly with a lot replays, but that's less easy to do for non-retail.

I checked the other obvious GameLogic particle-template guards. One additional mismatch case remains in FlightDeckBehavior.cpp: the particle-template condition at line 1287 also gates the m_catapultSystemFrame[i] = FOREVER state write at line 1290, and that frame value is serialized at line 1702. A client missing the particle template therefore keeps different game state.
The candidates in StealthDetectorUpdate.cpp:312 and the WaveGuideUpdate particle sites appear clean—the guards only control effect creation there.

TLDR FlightDeckBehavior could be a small followup

@Caball009

Caball009 commented Aug 5, 2026

Copy link
Copy Markdown

TLDR FlightDeckBehavior could be a small followup

FlightDeckBehavior::m_catapultSystemFrame is part of the xfer logic not crc. It's not an issue unless you're looking to create bit identical non-retail save games with and without headless mode or something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Fix Is fixing something, but is not user facing Minor Severity: Minor < Major < Critical < Blocker NoRetail This fix or change is not applicable with Retail game compatibility ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants