Back to Projects

PathfindingAI

C++20 · SDL2 · Algorithms · Behaviour Trees
PathfindingAI BFS visualiser expanding across a maze

Step-by-step BFS frontier expansion on a procedural maze.

Project Overview

PathfindingAI is an interactive pathfinding visualiser with autonomous agent simulation. Watch classic graph search algorithms expand across a maze in real time, or switch to AI Agents mode where behaviour-tree-driven entities pick random goals and navigate using the same pathfinders.

Built with SDL2 and Dear ImGui: dependencies are fetched automatically via CMake FetchContent, so no manual library setup is required.

Key Features

  • Visualiser mode: BFS, DFS, A*, and Jump Point Search with step-by-step frontier animation
  • Procedural mazes: recursive backtracker generation; draw and erase walls with the mouse
  • AI Agents mode: three agents wander a shared maze using behaviour trees
  • Live BT debug: ImGui panel shows node status (Success / Running / Failure)
  • Runtime algorithm swap: change pathfinder without restarting

Architecture

All pathfinders implement a common IPathfinder interface returning paths, explored cells, and timing data. The grid supports 8-connected neighbours. Agents use a selector-based behaviour tree (wait at goal → follow path → find new goal) with a blackboard pattern similar to game engines like Unreal.

Screenshots

A* pathfinding visualiser
A* search with heuristic-guided frontier expansion.
AI agents navigating with behaviour trees
Behaviour-tree agents picking goals and pathfinding in AI Agents mode.
PathfindingAI ImGui control panel
ImGui panel for algorithm selection and live behaviour-tree debug.

My Role

Solo developer. I was responsible for:

  • Implementing BFS, DFS, A*, and Jump Point Search
  • Building the grid, maze generator, and visualiser UI
  • Designing behaviour trees and autonomous agent logic
  • Integrating SDL2 rendering and Dear ImGui controls
  • Setting up CMake FetchContent for zero-install dependencies

Technologies Used

C++20 SDL2 Dear ImGui CMake Behaviour Trees A* / JPS

Repository

Synced from PathfindingAI: click folder names or ▶ arrows to expand. Use Expand all / Collapse all in the toolbar.