Pathfinding Help

BlitzMax Forums/BlitzMax Programming/Pathfinding Help

FBEpyon(Posted 2015) [#1]
Hello,

Can someone please run this code, and help me figure out where my pathfinding is broken please??



*Updated Code a bit, NOW IT WORKS!!!*

Thanks,


zoqfotpik(Posted 2015) [#2]
Read my code archive entry on Dijkstra map pathfinding. You may find it somewhat easier to conceptualize.


Matty(Posted 2015) [#3]
Yep dijkstra pathfinding is easy to implement. ... I second that idea.


FBEpyon(Posted 2015) [#4]
Yeah I looked at the Dijkstra and its good, but I'm working on my Dwarf mining game, and notices performance issues with it. I came up with my own path finding that seems to work for the most part, but then things start to get stuck with they are directly to the left of the target or top of the target.

I will look at the Dijkstra again because it doesn't seem to require as much.

Thanks,

FBEpyon


Pineapple(Posted 2015) [#5]
For the love of god, don't use Djikstra's if a heuristic is available. Try checking this out: http://www.policyalmanac.org/games/aStarTutorial.htm


Henri(Posted 2015) [#6]
Hi,

there is also Astar demo in blitmax / samples folder.

-Henri


FBEpyon(Posted 2015) [#7]
@Pineapple@ Thanks for the information I will go over it a bit more.. :P I have most of what I need in the above code, but I'm not sure were the path is getting messed up at.. :(

**UPDATED** THIS IS FULLY WORKING NOW!!

Thanks for all the help!!


zoqfotpik(Posted 2015) [#8]
Pineapple you can precache Dijkstra maps :) Don't discount them if you don't know what they are, they're different from the Dijkstra algorithm.

They also allow INCREDIBLY simple AI that can look extremely lifelike. Really if you use the maps it's closer to potential fields than it is to A* or the Dijkstra algorithm.