How many ai actors can be in one scene?

Hello there, I have always been interested in trying a total war style game. It has intrigued me, any idea how many separate ai units the unreal engine can handle without melting your computer?
Any ideas how to increase the number or what would need to be implemented for let’s say 5000-10000 units?

Hey Scottc,

I think it completely depends how advanced your AI is, games like total war use a system where they split their AI’s in 2.
A commander AI and a Follower. The commander does all the ‘thinking’, pathfinding, … and the follower AI will just mindlessly follow the commanders decisions, this way for a big group of AI’s it is still quite light for the computer to calculate.

In my tests I can have around 150-200 active advanced AI’s running around in the level with some performance loss. Anything higher I see the FPS drop a lot.
If you want to create something like 5000-10000 AI’s you might need to dig in the c++ code because UE4 is not optimized for this amount of AI’s.

I would recommend you to read this if you are interesed in creating your own AI :slight_smile:

Hope this helps,

Thanks, I have basic AI set up I used in an old zombie project but it required each ai to “think” for themselves… so “hearing and seeing” etc. It is very interesting what you describe how total war does it. So if I had x3 groups fo 50 AI. 1 in each group would act as the commander to tell the rest of the group what to do?
I’ll have a read of that article but could be something I look into

Also, I have been having a think how this would be implemented. Would it literally be, if I had two separate AI actors with separate blackboards etc. One the “commander” the other “follower”.

A simple example… The user right clicks on the screen, the “commander” Ai responds and updates move to points, which are sent over to the follower Ai and they move.
Although, this is a simple example, is this basically what you mean? the “Commander” Ai basically issues the orders that the user wants the ai to do

exactly the commander will make all the decisions and the follower will just do what he tells them to do. You can also let the commander be dynamically chosen based on how close he is to the objective.

I would recommend not to use behavior tree’s for the followers because there might be some annoying lag on it, and most of the time they need to respond immediately to the commanders command ^^

Good luck with your project! :slight_smile:

I am hoping to use some type of logic similar to this except without using a behavior tree because for starters the “move to” doesnt work in multiplayer. I am just hoping to get around 500 AI’s on a level for the players to fight and train on depending on their level. It would help if each small group of AI"s had this commander. Would simply duplicating the AI_BP, setting the duplicate as a child, and just pointing the child to the parent’s logic work? I’d probably need to see an example.