Request for simple, fast A* code!

Blitz3D Forums/Blitz3D Programming/Request for simple, fast A* code!

chwaga(Posted 2008) [#1]
I'm beat, and I'm lazy. I've spent far too long trying to code A*, and I've simply failed, not on the A* part, just coding it, I understand the theory and heuristics, but the code keeps bugging me into depression. I'm making a request like this, except for blitz3d, and I'm sure others could benefit from it. I need something simple and straight to the point, and I see no reason why it shouldn't be able to be used like:

CreateGrid(width, height)
path = FindPath(startx, starty, desinationx, destinationy, diagonal=true)


this way, "path" is a string consisting of numbers in a row, each number resembling a direction to go (1 - up, 2 - down, 3 - left, 4 - right, 5 - diagnal right up, etc.). Something this simple should be able to be used both in 2d and 3d, and be able to be used for pretty much any 2D grid pathfinding issue a blitzer is facing. I found something like this, except it was WAY too slow. Any contributions are greatly appreciated by myself and other lazy bump-on-a-log's like me.

:D


Naughty Alien(Posted 2008) [#2]
let me clear up air...you want 2D pathfinding system in Blitz3D?


chwaga(Posted 2008) [#3]
2d translates to 3D with no sweat, so yes.
(to quote someone else, "at the end of the day, tanks don't fly")


Gillissie(Posted 2008) [#4]
I have a set of functions in my game that I'd have to clean up a bit to be generically used. However instead of returning a string of directions, a list of objects is created. Then you just do a For...Each loop to go through them all. Sorry I can't simply provide the code right now.


John Blackledge(Posted 2008) [#5]
Todd, do you mean your GG-Curves code? I still have it in its original form if it's needed.