A* Pathfinding Project

RVOSimulation terrible performance on Recast graph


I have problem with terrible performance on RVOSimulation. It consumes 10 times more ms than rest of my game together. What am I doing wrong?
Deep profile (I don’t know why but when I enable deep profile when RVOSim is on scene I’ve got 0.5 FPS):
I’m using basic settings for RVOSimulation and RVOController combined with Recast graph and RichAI. I have 3 agents using RVO on scene.



Which version are you using? In an earlier version there was an issue with how .net handled locking that could cause this.


I’m using version 4.2.8


Ok. Are you sing the RVONavmesh component?


No I’m not using RVONavmesh. I have Seeker, RichAI and RVOController on my agent, one instance of RVOSimulation on separate gameobject.


That’s odd. It really shouldn’t be that slow if you only have 3 agents.
Can you try to disable threading on the RVOSimulator and then profile it again (and post the results here)?


With “worker threads” set to none RVOSimulation takes 0.01ms and works perfectly lol. Thanks a lot!

If it helps, I’m using Unity 2017.4.30f1 and .NET 2.0 (company requires it for this project).


Okay. So it seems locking might be the problem still.
May I ask what platform you are using and what player settings you are using (e.g. scripting backend etc.)?


I’ve just edited my previous post, didn’t see your replay.
I’m using Unity 2017.4.30f1 and .NET 2.0 (company requires it for this project).


It turns out when I add more units RVOSim gets pretty heavy - for 10 units trying to reach same destination it’s 4-5ms. Is there possibility to fix threading on Unity 2017 .NET 2.0?

I’ve tried to set it to threading once more - when I set any of automatic the overhead does not go crazy and id gives noticable boost (especially on Automatic High Load, I don’t really know what “High Load” in this case means, but lets say its ok for now). For standard profiler it goes down from 4ms to 1.3ms on 10 units, but on Timeline profiler I can’t find it on any other core. Is there special profiler for profiling A* or it should be visible in standard one?


I don’t think the RVO threads show up in the unity profiler. Or if it does it is at least not one of Unity’s job threads. This is more clear in the current beta which uses the unity job system.


Ok, thanks. For now performance is good enaugh, I was just curious.