Navigation Graph Utility

This was a navigation graph that I made for use in games where the enemies would need to be doing pathfinding. The nav graph itself uses a simple flood fill algorithm, and the searching uses A* with an absolute distance heuristic.

I used this in multiple games that I was a part of during my college career. In game, the navigation graph is calculated once during initialization of the level, then entities can pick a point to search to. Neither the destination nor the start point need to be directly on the path, when the search function is called it will find the closest point to the start/end location.

In the pictures, the black lines represent the edges of the graph. Some of them may be hard to see, that’s simply because of terrain height changes that block them out (I promise it’s actually there :) ). The green sphere represents the start point, the blue spheres represent the path, and the red sphere represent the destination. The UI for it uses GUI text because at the time I made this, I did not know one could make custom inspectors in Unity.

The following show a few screenshots of the utility in Unity as well as a screenshot from one of the games I used it in, a tank/maze game.

Leave a Reply

Your email address will not be published. Required fields are marked *