Poor performance with a dozen~ bots

devomage

Member
If my game has a "full match", it could have 39 players and up to 16 bots (4 per team). Last night I added the 16 bots (spawned and idle only) and it killed my frame rate. I don't even know where to start, but clearly it is UCC (animator?) related. With the exception of a few Debug.Log calls that could be removed; I don't really have anything that is a performance related red flag.

I would really like to extend the player count to 100, with a "last man standing" theme. This now doesn't look realistic. I could be quick to blame the demo animator - but, what if my final animator is similar?

Advice would be appreciated.
 

Attachments

  • Profiler_01.png
    Profiler_01.png
    313.6 KB · Views: 15
Yeah.. running this many animations is heavy. To start with instead of having always animate you could instead have the animator cull when the animator is not in view. For this to work correctly you'll want to disable root motion and also not rely on any animation events for when things fire.
 
I'm going to start dealing with this next. Could you elaborate a bit more on this? Consider my animation knowledge at barely above zero.

and also not rely on any animation events for when things fire

Do you deal with this in the PUN addon?
 
Do you deal with this in the PUN addon?
The PUN demo scene uses animation events since there are at most a max of 8 characters. Related to animation events you'll want to use a timer instead of the event within the Animation Event Trigger:

 
Top