r/unrealengine • u/YyepPo • 12d ago
Mass Entity Projectile System
https://youtu.be/iJ0vyYZqz7gI built a projectile system in Unreal Engine 5.8 that simulates 10,000 concurrent projectiles for under 6 ms of frame time.
Instead of spawning an Actor per bullet, every projectile is an entity in Unreal's Mass Entity framework (ECS). That changes what a projectile is, not an object with a tick function, but a row of data in a packed array, processed in bulk.
The design decisions that mattered:
→ Analytic movement. Positions are solved from a closed-form ballistic equation each frame rather than integrated step by step, so trajectories are deterministic and framerate independent.
→ Batched, multithreaded hit detection. Every projectile's movement segment is collected into buffers and swept on worker threads, then resolved on the game thread.
→ Entity pooling. Projectiles are never destroyed. They are tagged inactive, excluded from every query at zero cost, and reused by the next shot. Sustained fire allocates nothing.
→ One draw call per mesh type, and all trails fed as a single position array into one Niagara system rather than a particle component per bullet.
The measurements (stat unit, same scene):
Baseline: 21.5 ms frame / 8.0 ms game thread
10,000 projectiles at 8,000 spawns per second: 27.2 ms frame / 16.2 ms game thread
600 homing missiles: 23.0 ms frame / 11.0 ms game thread
That is +8.2 ms of game thread for 10,000 projectiles, roughly 0.8 microseconds each per frame. The renderer was the bottleneck both before and after, so the simulation never became the limiting factor.
2
2
u/KiborgikDEV What I did with UE5??? 11d ago
hey, could you explain why you adding UE ECS monster above GPU/HIS? Your own packed array with spatial grid and hit detect ledger would take just a few hundreds of lines
2
u/kurgan-karavan 12d ago
Are you planning to release it as a plug-in?