A Few Questions about A* Before I Purchase

Hi, I’m considering switching my game over from Unity’s built-in pathfinding to A*, and I just had a few questions:

  • My AI uses Unity’s Nav Mesh Agent (of course), and behavior has been built around this component. Is it possible to generate a navmesh with A* and use it with a Nav Mesh Agent, or will I have to redesign everything to use a different component?

  • The primary reason I want to switch to A* is to be able to calculate navmeshes at runtime. I understand that A* is able to RE-calculate navmeshes at runtime, but is it possible for it to create pathfinding data for a level that’s been entirely created at runtime?

  • My level’s currently use Unity’s Nav Mesh Obstacle component for moving objects such as doors. Will A* require me to switch them to a different component, or will I be able to use runtime mesh recalculations to do this job, with a minimum of having to go back and change objects in levels I’ve already made?

Thanks

Hi

  1. You will need to use a different component I am afraid. The NavMeshAgent is tied too much to the Unity pathfinding system.

  2. Yes, that is possible. See http://arongranberg.com/astar/docs/graph-updates.php
    Note that for recast graphs, it might take some time to generate the graph (the beta includes a few important optimizations for large worlds however).

  3. You have to switch to a different component. Assuming you are using recast graphs you should use the NavmeshCut component.

Ok, thanks very much :slight_smile: