TheSuperHackers / GeneralsGamePatch

Community Patch to fix and improve original Generals Zero Hour 1.04
Other
58 stars 19 forks source link

Buildings' particle effects and their performance cost #2426

Open Float1ngFree opened 3 months ago

Float1ngFree commented 3 months ago

While testing https://github.com/TheSuperHackers/GeneralsGamePatch/issues/2425 and looking for bad/lingering particle effects I've noticed that some of the effects on buildings are off, especially for different ConditionState models.

This is similar to https://github.com/TheSuperHackers/GeneralsGamePatch/pull/1366, https://github.com/TheSuperHackers/GeneralsGamePatch/pull/1387, https://github.com/TheSuperHackers/GeneralsGamePatch/pull/1371, https://github.com/TheSuperHackers/GeneralsGamePatch/pull/1379, https://github.com/TheSuperHackers/GeneralsGamePatch/pull/1369 where listed ParticleSysBone were missing. Obviously there are a lot more structures with these bugs.

Black Market (without Fortified upgrade):

market not fortified

The normal, undamaged structure (ConditionState = NONE) lists just one ParticleSysBone = Smoke01 SmolderingSmoke and it is properly attached on right side of the model in all states. It remains properly attached in other states. But other listed effects in other states are piled up in the middle, while minor, not listed effects are added by the system.

https://github.com/TheSuperHackers/GeneralsGamePatch/assets/17320562/b151aaa8-2526-43d2-ac8f-22811f04a503

The fortified one seems ok:

fortified market

Therefore, it got me questioning the whole idea of these effects other than the NONE state from performance standpoint. Are they really needed when DAMAGED and REALLYDAMAGED states are adding effects by default?

For instance, I don't agree with https://github.com/TheSuperHackers/GeneralsGamePatch/pull/1396 (adding effects) or https://github.com/TheSuperHackers/GeneralsGamePatch/pull/1371 (fixing bones) as these are adding more long-going effects/particleSystems and the game is obviously struggling with particle pool exhaustion.

Surely, at least all fractions/generals buildings should be checked and corrected.

But IMO we should rather try to reduce the number of particleSystems overall. Leave ones in normal state and leave only the damage effects that are default with DAMAGED, REALLYDAMAGED and RUBBLE states. Maybe even get rid of some particleSystems for some buildings.

I do appreciate that they make buildings look alive, but how many does the game need and at what cost? Do they need to be in all condition states?

xezon commented 3 months ago

commy2 announced a long time ago making a pass over all of these in #1397.

There're many issues with GLA building particle effects, especially in damaged states and when switching to Fortified Structures. I was going to look into them after the Chinese are finished. Sadly, it seems there is still loads left for China, so it will take a while until I get to these.

1371 looks good to me. It fixed bone names, and deleted some superfluous effects. So it is still a net gain over the original.

1396 if we find this to be a practical problem, then we can revert it. We are saving and optimizing particles in other places so overall we expect net performance gain in patch.

Float1ngFree commented 2 months ago

I went through all faction buildings in my project and I'd say that the situation is not as bad as it seemed. You've got rid of basically half of them here with previous PRs, there are some GLA & China that need fixing, but that mostly relates to DAMAGED and REALLYDAMAGED states.

So regarding buildings - this could be not as serious as it seems. I will turn my attention towards units though as in every game there 's a lot more of units than buildings and they are to change states/effects more often.