Graph Search to Navigation
Breadth-first search to Dijkstra and A*, then the nav meshes and funnels games walk on.
Algorithms & Data Structures · Game Development
- 1
Graph Traversal: BFS & DFSin progress
Algorithms · Graphs · ~20 minVisit every reachable node once with one loop and a frontier. Take from the front and it ripples out in layers; take from the back, marking nodes as they come off, and it plunges down a branch.
- 2
Shortest Paths: Dijkstrain progress
Algorithms · Graphs · ~25 minSettle the nearest node, relax its edges, repeat. A heap keeps the nearest at hand, a stale entry is skipped, and every settled distance is final because no edge is negative. BFS, ordered by distance.
- 3
A* Searchin progress
Algorithms · Graphs · ~25 minDijkstra with a compass: rank the open set by the cost so far plus an estimate of the cost to go. An estimate that never overstates keeps the path optimal in fewer expansions; overstate it, it errs.
- 4
Navigation Meshesin progress
Games · Navigation · ~25 minCut the floor into cells, block the ones a wall touches, merge the rest into convex rectangles, and join neighbours with portals: the graph of rooms and doors a game agent plans its route over.
- 5
Pathfinding on a Nav Meshin progress
Games · Navigation · ~25 minA* where the nodes are rooms and the edges are doors: cost a room by the walk to the door it was entered through, estimate the rest as a straight line, and get back a corridor, not yet a path.
- 6
The Funnel Algorithmin progress
Games · Navigation · ~25 minPull a string tight through the corridor's doors: a funnel narrows to each door's ends, leaves a corner where it would cross itself, and yields the shortest path in the corridor, radius included.
- laterFlow Fields