Jump to content

Pathfinding routine

Recommended Posts

I needed a path finding routine for my little Rebelstar game project. I thought I could simply use pathfinding code already written in pascal for the job. This turned out to be more difficult that expected. Hassles with multidimensional dynamic arrays, binary heaps and other oddities that I could easily get working. I finally managed a simple routine working. I don't know who to credit for the original source code as there was no name provided.


The code is provided as is. I do not think that it is very quick. There is no cost for different terrain or diagonals implemented. However, that should not be too hard to add. Also there is no fancy interface to draw walls etc it is just bare bones.


I looked at some of the javascript libraries and they are pretty cool, so if some one wants a challenge. It would be awesome to have a routine that is fed a two dimensional array with rules for walls and costs and a path is returned :)


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...