Multithreaded Agent Pathfinding

Would be great to have multithreaded pathfinding out of the box or at least make it a bool checkbox.

I know it’s single threaded because of this thread: is navmesh pathing using all cores?

I
’m making an RTS game with thousands of agents running at the same time and the performance is not great. Specially when calculating the initial path. I could just calculate it over several frames but then that makes agents significantly less responsive and then the design of my game falls apart.

I’ve increased the NaMesh.pathfindingIterationsPerFrame to a high value which helps a bit but still leaves a lot to be desired. Specially considering that I know for a fact that a lot of performance is being left on the table.
And the argument “Well go use Entities for performance then” to me is nonsensical when as I said, the base engine is significantly improvable in aspects like this. And Entities would make the game development extremely challenging and most importantly, not fun (I speak with 1.5 years of experience working with Entities at my job).

(Note: I know the NavMeshQuery thing exists but it’s very complex, seems to be designed only for Entities, and it would require to make a whole navmesh system from scratch for some reason. And I don’t want to use an internets random guy implementation that is unofficial).

This could be a great new addition that would make me switch to Unity 6.

Thanks for reading!

1 Like

I agree it is so slow for RTS games and I am surprised this is not already being considered by Unity. We have been asking for this for years without any response

1 Like