PathFinding system with test environment

I know there are some implementations of AStar pathfinders etc. here but most of them did not seem to be meant to be extended or to implement a real system for different pathfinding algorithms. So I started creating a system and wrote a little test app to draw mazes and let them be solved by different algorithms.



Its basically the standard interface system where you have your world shells or whatever implement a PathNode interface so they can give back their neighbours, cost to given neighbours and estimated distance to the goal. Only here the PathFinders implement an Interface as well, so you can implement own versions.







This version includes the beginnings of an attempt to create a multithreaded AStar path finder, but I had to find out that the astar implementation is not really suited for multithreading… Anyway its a nice system to try out different pathfinding algorithms.

IF you want to browse the code, go to http://svn.bitwaves.de/browser/

Using svn, you can download and compile/run the application like this:

svn co --username guest --password guest http://svn.bitwaves.de/svn/opensource/pathfinding pathfinding
cd pathfinding
ant javadoc
ant jar
ant run


Using these commands you create the javadoc in the dist/doc/ folder as well, to have some more info about the implementation.
To use it in your own application use it like this:

PathNode start=myEntity.getCurrentNode();
PathNode goal=myEntity.getTargetNode();
PathFinder finder=new AStar();
List<PathNode> path=finder.findPath(start, goal);


If someone feels like advancing the system or implement a new PathFinder with the system, I can give you SVN access if you PM me.

If you need more info on how to use this PathFinder or on the subject in general, feel free to ask :)
1 Like

Where should i start looking when I need a graph component like this here? I need a graph structure together with path finding etc in a game. should i integrate something external like http://jgrapht.org/ ? It looks like there is no path component included in JME?

Technically, you don’t really need a “graph” to make A star… you just need a adjacency function.

edit: corrected “traverser function” to “adjacency function” since it’s what I really meant.

I cannot checkout the code with the provided command… =(

kwando@alice:~$ svn co --username guest --password guest http://svn.bitwaves.de/svn/opensource/pathfinding
svn: E175002: Unable to connect to a repository at URL 'http://svn.bitwaves.de/svn/opensource/pathfinding'
svn: E175002: The OPTIONS request returned invalid XML in the response: XML parse error at line 1: Extra content at the end of the document
 (http://svn.bitwaves.de/svn/opensource/pathfinding)
@kwando said: I cannot checkout the code with the provided command.. =(

kwando@alice:~$ svn co --username guest --password guest http://svn.bitwaves.de/svn/opensource/pathfinding svn: E175002: Unable to connect to a repository at URL 'http://svn.bitwaves.de/svn/opensource/pathfinding' svn: E175002: The OPTIONS request returned invalid XML in the response: XML parse error at line 1: Extra content at the end of the document (http://svn.bitwaves.de/svn/opensource/pathfinding)

Note: this thread is like 4 years old. Perhaps the code isn’t there anymore.

@pspeed, ah that explains a few things =)