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.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
City Pathfinding
packages/Newtonsoft.Json.9.0.1
City Pathfinding.sln
README.md

README.md

City-Pathfinding

Fast 2D pathfinding algorithm based on Points and Neighbours.

Compiling

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.

Using

  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

Error

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

You can’t perform that action at this time.