HaywireInteractive / OnAllFronts-Public

UE5 MilSim FPS / RTS Game (formerly ProjectM)
MIT License
127 stars 24 forks source link

Fix effects not spawning in most cases with large number of soldiers in combat #856

Closed Leroy231 closed 6 months ago

Leroy231 commented 8 months ago

This is referring to particle/sound effects such as weapon muzzle flash and projectile impact particle effects. Right now these rely on Mass Replication of entities which is not a good approach for something which happens so often. Instead we should use unreliable Mass RPCs. See WIP: https://github.com/HaywireInteractive/OnAllFronts/commit/8bcc2accc01877858fa90b94980eab425a063b0c.

- [ ] Finish out the WIP commit above - [ ] Make it so when a projectile impacts the environment rather than destroying the projectile and spawning a bullet hole entity, just make the projectile entity stop at the impact point and change its visualization into a bullet hole at that point. Make sure to handle tank projectiles correctly with this approach (where there is no bullet hole). This will allow us to make projectile impact effects use Mass RPCs as well since the projectile entity is what we can associate the effect to and we can be guaranteed it'll exist on clients so the RPC will get replicated. - [ ] Based on above, also change UMassProjectileRemoverProcessor to only run on server and standalone and update the comment in constructor.

After discussion with Leroy we decided to go with 3rd approach from linked doc in order to save up on bandwidth: https://docs.google.com/document/d/1q0IT4msiH8uEohw54xbo9wQKs5UCmzOB8ShxATm-GRg/edit