Behavior Design with Thousands of Agents

pegasusejder

New member
I'm making a strategy game and there are thousands of soldiers in the game, I will make these soldiers fight each other. Is there a way to optimize this, currently the agents only have formation behavior and they only create formation when the game starts. I get ~20 fps with 2500 agent. How can I optimize this?
 
2500 is a lot - for that your best bet is to wait for the DOTS version of Behavior Designer where 2500 will be no issue. With the current version you'll need to do some culling and optimization so not all of the trees run all of the time. For example, does an agent's tree really need to run if it is outside of the field of view? What if it's extremely tiny on the screen? Your best bet is to switch to a simpler system when the detail doesn't matter as much.
 
2500 is a lot - for that your best bet is to wait for the DOTS version of Behavior Designer where 2500 will be no issue. With the current version you'll need to do some culling and optimization so not all of the trees run all of the time. For example, does an agent's tree really need to run if it is outside of the field of view? What if it's extremely tiny on the screen? Your best bet is to switch to a simpler system when the detail doesn't matter as much.
I'll probably try to optimize it as much as possible by turning off the off-screen trees, as you said. So, do we have the opportunity to change the running frequency for OnUpdate?

For example, if it works every frame, change it to a frequency of every 3 frames.
 
Back
Top