Performance vs. Unity Built-in Navmesh for Large Number of Agents?

I’ve been looking into a pathfinding solution for an RTS game that I’m working on. Basically I just need my units to be able to navigate around obstacles, walk up ramps, climb small hills, etc… all while avoiding other moving agents. It looks like Unity’s built-in system and A* Pathfinding Project can both handle all of these things, but I’m curious as to how the performance of these pathfinding solutions compare to each other. In most sessions of our game, there probably won’t be more than 70 agents moving at once (and even that’s a stretch), but since we eventually want support for team games, we’d want to be able to support 200 or more agents moving around. I’ve scoured through the forums and the A* Pathfinding Site but haven’t been able to find any performance comparisons between the two solutions. Any info on this would be extremely helpful.

Hi

I don’t have any direct comparisons available unfortunately. It depends a lot on your game too.
For the exact same behavior, I would expect Unity’s solution to be a bit faster simply due to the fact that it is implemented in C++ instead of C#, and even though I try very hard to optimize my code, one can often do things a lot more efficiently with C++ due to its better compilers and lower level language. That said, this package does allow you to do things in ways that Unity’s system doesn’t allow. For example there is this optimization technique: https://arongranberg.com/astar/documentation/dev_4_1_8_94c97625/heuristicopt.html available in this package that works for static maps (or rarely changing ones at least) and can improve pathfinding throughput by 10x in many cases.

I have recently been working a bit on an RTS demo for the package. Here is a work in progress video of it https://www.youtube.com/watch?v=wBUdMXeeej0&feature=youtu.be. That demo has around 220 units. Admittedly that is straining the local avoidance system a bit (worst case for it performance wise is large groups of agents clumped together).

2 Likes

Hello ~ aron
I have now purchased A * Pathfinding Project Pro for RTS development.
However, the unit’s group movement is not working well.
You need some more detailed examples than the examples in the asset.
Can you share a demo project that you can refer to just like a project in a linked video?
Please ~

Hi

There is a beta version of that RTS package that you can download here: https://www.arongranberg.com/astar/download (click ‘Show Older Versions’ and download the ‘rts’ beta).

Thank you. Aaron ~
Test and ask if you have any questions.