fix(particlesys): Decouple creation of particle systems from game logic#1
Conversation
|
FWIW, I'm not sure if it's desirable, but you could use DetailsWithout retail compatibility |
| if(sys) // todo: add || TheParticleSystemManager->isDummy() | ||
| { | ||
| Coord3D offs = { 0,0,0 }; | ||
| target->getGeometryInfo().makeGameLogicRandomOffsetWithinFootprint(offs); |
There was a problem hiding this comment.
Or just unroll the relevant calls to GameLogicRandomValue here?
| // TheSuperHackers @fix stephanmeesters 18/05/2026 Fix issue where the creation of a certain particle system | ||
| // would influence game logic CRC due to the incorrect usage of game logic RNG. This code block is required to | ||
| // forward the game logic RNG and keep things consistent. | ||
| if(tmp) // todo: add || TheParticleSystemManager->isDummy() |
There was a problem hiding this comment.
I dont think || TheParticleSystemManager->isDummy() would be correct. It would mean a null template would pass. I suspect this means we need to preserve templates in the dummy manager, at least for RETAIL_COMPATIBLE_CRC.
There was a problem hiding this comment.
|| TheParticleSystemManager->isDummy() here assumes that the template exists in the original data (which for the three cases in this PR it does), which isn't great to assume that I suppose, it does pass the replay test.
| * The position is local to to the object */ | ||
| //------------------------------------------------------------------------------------------------- | ||
| static Coord3D getLocalEffectPos( const FXLocInfo *locInfo, Drawable *draw ) | ||
| static Coord3D getLocalEffectPos( const FXLocInfo *locInfo, Drawable *draw, Bool useGameLogicRandom = TRUE) |
There was a problem hiding this comment.
Can we do this more elegantly? I do not have better idea but it is a bit sad to have this as argument.
| } | ||
|
|
||
| //============================================================================= | ||
| void GeometryInfo::makeGameClientRandomOffsetOnPerimeter(Coord3D& pt) const |
There was a problem hiding this comment.
You can avoid making a duplicate function by passing a function pointer for GameClientRandomValueReal or GameLogicRandomValueReal. Same for the other function.
bugfix: Restore retail compatibility after retail behavior flags change TheSuperHackers/GeneralsGameCode#2727
and
fix(particlesys): Add or simplify null-checks to createParticleSystem calls TheSuperHackers/GeneralsGameCode#2724
Based on branch by Caball.
Tested that it passes the gold replay while using
ParticleSystemManagerDummywhich sets all particle templates to null.The logic was written to also keep behavior the same in the case that a particle system does not exist because of a data change like in mods. Added to this should be
TheParticleSystemManager->isDummy(), which is not available yet, this can be added in TheSuperHackers#2709.