Skip to content
Fast 2D pathfinding algorithm based on Points and Neighbours
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
City Pathfinding
City Pathfinding.sln


Fast 2D pathfinding algorithm based on Points and Neighbours.


Example program require MonoGame, but the algorithm(in folder CPF) is writting in pure C#. This scripts can work on others game engine, such as Unity.


  1. Add .cs files from CPF folder to your project.
  2. Instantiate Map
Map map = new Map();
  1. Add points and neighbour relations
map.AddPoint(x,y); //Create Point called "P_x_y"

map.AddNeighbour(name1, name2); //Create neighbour relation between name1 and name2 point
//Find script can only move from point to his neighbour
  1. Find path
map.Find(startPoint, endPoint); //Return List<string> contains list of path points


functions throw an exception when point hasn't joined to rest of the map

You can’t perform that action at this time.