Poor performance on mobile devices

arenoo

Member
Hey everyone, Is there a way to make the bots more optimized? I am using deathmatch ai kit default tree in an almost blank scene with 8 bots and the phone gets thermally throttled down (iphone 8). I am even willing to sacrifice some of behavior quality over performance. Is there something like a "Mobile Version" boolean that I can toggle or maybe some easy hacks that I can apply? Btw I know that I can lower the behavior designer tick rate, but that is my last option. The profiler shows that more than half of cpu resources are used by FixedUpdate.ScriptRunBehhaviorFixedUpdate

I added 30 bots to see clearly what is happening. Profiler screenshots from below are captured from iphone 8 with 30 bots (about 5 fps).
1691421151308.png1691421319080.png
 
Last edited:
Let's pretend the onImpact issue is gone, now even when the bots are not shooting the frame times are still extremely high, I profiled some more and found out that the main problem is in AnimatorMonitor.UpdateAnimatorParameters() function. It is extremely heavy to execute. Is there a way to optimize it even with some compromises?
 
Are you sure UpdateAnimatorParameters is causing a problem? All it does is set some parameter values. There is nothing there that would take any considerable amount of time. If it is UpdateAnimatorParameters, what does the hierarchy look like?
 
Top