Skip to main content
Email Password   helpLost your password?

Introduction

Path Finder Library is a .NET library that currently contains one type called SimplePathFinder. SimplePathFinder is a very simple and basic implementation of the A* path finding algorithm. It is extremely easy to use and integrate in your applications. It works very well and I hope you enjoy using it.

How do I use it?

Its simple, first you must build it since I have not uploaded any binaries. It will compile into a .dll file. You must add a reference to this .dll in your project. Then add this using statement.
using HenizeSoftware.PathFinding;
Then you must create an instance of the SimplePathFinder type.
SimplePathFinder pf = new SimplePathFinder(20, 20, new Coordinate(0, 0),
                                           new Coordinate(19, 19), null);
In the first two parameters you must specify the width and height of the map you are creating. In the third and fourth parameters you must specify the position of the start node and the end node. The last parameter is optional, you can specify an array of coordinates that will be unwalkable (ie walls ...). You can give it null or an empty Coordinate array if you do not wish to create any unwalkable nodes at this time. To get the path from the start node to the end node just use the Path property, it will return a Coordinate array giving you the path. You may get or set the position of the start node and end node at any time using StartNodePosition and EndNodePosition properties. You may also add or remove unwalkable nodes using the indexer of the SimplePathFinder type.
pf[10, 10] = true; //makes node 10, 10 unwalkable

Simple Demo

using System;
using HenizeSoftware.PathFinding;

namespace SimpleDemo
{
  class Program
  {
    static void Main()
    {
      SimplePathFinder pf = new SimplePathFinder(20, 20, new Coordinate(0, 0),
                                                 new Coordinate(19, 19), null);

      pf[0, 1] = true;
      pf[1, 1] = true;
      pf[2, 1] = true;

      foreach (Coordinate c in pf.Path)
      {
        Console.WriteLine(c.ToString());
      }
    }
  }
}

Conclusions

I will continue to work on this library by adding new types and improving the existing SimplePathFinder type. I would like any comments you have about this software. I would like ANY feedback you may have. UPDATE: I now have a nice GUI demo for you to play with! Make sure to compile the .DLL file and add a reference to the .dll in the Demo source. Enjoy!
You must Sign In to use this message board.
 
 
Per page   
 FirstPrevNext
GeneralVery Nice Pin
Swader
23:54 26 Nov '07  
GeneralSUPERB! Pin
Roger Williams
8:36 26 Jun '07  
Generalgood article Pin
Arak_usa
3:16 12 Jun '07  
GeneralGud Dude Pin
azam's
18:46 25 Feb '07  
GeneralRe: Gud Dude Pin
Captain See Sharp
19:57 25 Feb '07  
Jokeerror message Pin
aussie1
9:38 25 Feb '07  
GeneralRe: error message Pin
Captain See Sharp
9:50 25 Feb '07  
GeneralNice work Pin
Boniolopez
1:31 5 Jan '07  
GeneralRe: Nice work Pin
Captain See Sharp
9:29 5 Jan '07  
GeneralRe: Nice work Pin
A Nash
4:03 3 Feb '07  
GeneralDetails of A* Implementation Pin
Chris S Kaiser
9:31 4 Jan '07  
GeneralRe: Details of A* Implementation Pin
Captain See Sharp
9:48 4 Jan '07  
GeneralRe: Details of A* Implementation Pin
Chris S Kaiser
9:50 4 Jan '07  
GeneralRe: Details of A* Implementation Pin
Captain See Sharp
9:57 4 Jan '07  
GeneralPossible bug? Pin
John Zammit
6:12 4 Jan '07  
GeneralRe: Possible bug? Pin
Captain See Sharp
9:45 4 Jan '07  
GeneralRe: Possible bug? Pin
John Zammit
0:40 5 Jan '07  
GeneralRe: Possible bug? Pin
Captain See Sharp
9:36 5 Jan '07  
GeneralArticle Name Pin
metweek
4:48 3 Jan '07  
GeneralRe: Article Name Pin
Colin Angus Mackay
6:33 4 Jan '07  
GeneralRe: Article Name Pin
metweek
9:35 4 Jan '07  
Generalgood article Pin
margiex
16:39 26 Dec '06  
GeneralRe: good article Pin
Captain See Sharp
17:04 26 Dec '06  


Last Updated 26 Dec 2006 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2009