Hi guys, quick question. In order to save development time, I’d like to know whether I should work with the NavMesh or invest in something like A* Pathfinding. Which one would you recommend for an RTS with a very large map (not infinite, but still split into chucks and dynamically loaded)? Also, the terrain is procedurally generated.
I don’t have a lot of experience with Unity’s navmesh system, but I have been using Astar pathfinding in my own project for the past year or so and this is my experience with it:
My project uses some very large terrains, usually around 30x30 kilometers. I have been able to use Astar pretty much out of the box to make the navmesh for these scenes with a couple caveats:
- You need Astar Pathfinding Pro version to use the recast graph
- I had to bake the whole terrain into one navmesh. I tried for a very long time and was unsuccessful at stitching together multiple smaller graphs. For a scene of my size, the graph ended up being several gigabytes.
- My scene is static therefore I didn’t have to worry about baking the graph at runtime
- My graph had to be fairly imprecise in order to accomplish the bake
- My terrain is not streamed.
I do know that it is possible to do procedurally generated / streamed worlds with Astar, and this involves creating a very large graph that covers the whole theoretical area of the terrain, then asynchronously telling specific tiles in the graph to bake as the terrain is streamed in. I do not, however, know how well this works or what the limitations of it are. I do have to say that I doubt that Unity’s system accomplishes this any better though. Astar is also open-source, so if you need to mess with source code to get it to work then you can. Either way I expect you will run into some hurdles.
Unfortunately I don’t really know the “right” way to tackle a problem like this within Unity