Skip to content

A C++ & SFML project that visualizes how NPCs use Breadth-First Search to find the shortest path in a 2D grid. Great for learning pathfinding algorithms and game AI.

Notifications You must be signed in to change notification settings

Bishesh-Khanal/BFS_Simulator

Repository files navigation

BFS_DFS

This project is a visualization tool that demonstrates how Breadth-First Search (BFS) can be applied in 2D games for NPC pathfinding. Built with C++ and SFML, it simulates how a non-player character (NPC) navigates through a grid-based environment to reach a target point (usually the player).

Key Features:

  1. BFS Algorithm – step-by-step expansion of the search frontier to find the shortest path.
  2. Path Visualization – displays visited nodes, frontier expansion, and the final optimal path(since each action has uniform cost).
  3. Interactive Simulation – lets you observe how NPCs decide their movement toward a target in real time.
  4. Game AI Relevance – mimics the decision-making process used in actual 2D games for enemy or ally navigation.

This project is intended as both an educational tool for learning graph search algorithms and a foundation for implementing AI pathfinding in games.

About

A C++ & SFML project that visualizes how NPCs use Breadth-First Search to find the shortest path in a 2D grid. Great for learning pathfinding algorithms and game AI.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published