Pathfinding & Game AI Playground

AB Pathfinding PlaygroundProject 01 · Search & game AI
Mode

Press Run to watch the search.

Fig. 1-A
–
–
–
–

How it works

Sheet 02 · Manual

01

Breadth-first search

Explores in rings: every cell one step away, then two, then three. A queue keeps the order. The first route to the goal has the fewest steps, but BFS counts mud as one step, so it walks straight through it.

02

Dijkstra's algorithm

Always expands the cheapest cell found so far, using a priority queue (a binary heap). It returns the lowest-cost path and goes around mud when that is cheaper. It searches evenly in every direction.

03

A* search

Dijkstra plus a sense of direction: cells are ranked by cost so far plus the Manhattan distance left. The estimate never overshoots, so the path is still the cheapest, but cells leading away from the goal are rarely touched. Tick Compare side by side to see it next to Dijkstra.

Chase mode. The chaser C runs A* to the target T and walks the path. Each time the target moves or a wall changes, it plans again; the dashed line is its current plan. Mud slows you both. Pick Flee AI to watch a target that runs on its own.

Maps. Maze builds a perfect maze with the recursive backtracker. Export saves the board as JSON and Import loads one back, so you can share a tricky map.