Back to Projects

PathfindingAI

C++20 · SDL2 · Algorithms · Behaviour Trees

Project Overview

PathfindingAI is an interactive pathfinding visualizer 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

  • Visualizer 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.

My Role

Solo developer. I was responsible for:

  • Implementing BFS, DFS, A*, and Jump Point Search
  • Building the grid, maze generator, and visualizer 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.