HaywireInteractive / OnAllFronts-Public

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

Optimize/batch entity spawning #849

Open Leroy231 opened 9 months ago

Leroy231 commented 9 months ago

Spawning of lots of projectiles each tick is slow. Might be faster if we batch all spawning of projectiles in each tick, e.g. in FireProjectileTask add to a queue or array and then have some code that runs at end of tick that spawns them in single call to SpawnEntity for each EntityTemplateID. Maybe a subsystem that stores TMultiMap<TemplateID, Transform>. Make it generic so can be reused for entities other than projectiles.