Managing 300 Characters

The CMC is expensive. See this graph for proof.

I’m trying to be as lazy as possible while still having (at most) 300 characters running around at any given time for my zombie game. I’m also using object pooling and managing various component tick intervals using a distance LOD system.

I’ve already tried a different approach with a UFloatingPawnMovement component. I figured out gravity and got the zombie to walk around successfully using AIMoveTo. The problem is stepping up small ledges like curbs, and moving up/down slopes. The CMC handles all of this flawlessly, along with penetration correction and many other things that are battle tested that I’d love to keep. It seems like a waste to throw away years of Epic developers debugging the CMC.

There has to be some middle ground between the barebones floating movement component and the hefty character movement component.

There are a few things I could use some guidance on:

1.) is this even a good approach? Am I better off figuring out Mass and swapping for characters when a zombie is a certain distance from the player?

2.) Is there a marketplace asset that will take the load off my shoulders? I’ve looked but can’t find anything that seems right.

3.) Am I not even worried about the right thing? I know skeletal meshes take a significant chunk of the game thread. I could easily be reading this graph wrong and my problem is skeletal meshes. I unfortunately don’t have this trace anymore so I can’t dig into the graph (I’ve disassembled my code to attack this issue).

4.) Any additional optimization or general tips you have about managing hundreds of AI would be amazing! I pulled off 375 zombies for a game jam and got good frame rates on high end PCs, but now that I’m working on it for steam, my optimizations won’t cut it.

Hey there @pterafier1! Welcome back to the community! So you’ve got the right idea that MASS would be your best bet to utilize tons of zombies, but it will be a significant endeavor. I can offer resources on how to go about this, but you can start here:

However if you could instead get away with less “real” zombies, it might be possible to use Niagara to fake them and just make them “real” when closer but it may require neighbor grids there.

Tutorial that would work but for combat you may need neighbor grids:

Another Niagara based tutorial:

Disclaimer: One or more of these links are unaffiliated with Epic Games. Epic Games is not liable for anything that may occur outside of this Unreal Engine domain. Please exercise your best judgment when following links outside of the forums.

legendary reply, thanks! I’ll get to digging

Take note, the Niagara tricks are powerful but you will have to turn them into real actors at some point. This will take the edge off but if you still need 300 actual acting characters, then you will probably want MASS, though their logic can only be but so complex.