-
Pathfinding
Hi,
I have some knowledge of pathfinding - I sortof know about Dijistra's (is that his name?) method, as I just learnt this at school. It's quite easy.
However, I can't figure out how to implement it into a game... A friend of mine wrote me some VB pathfinding code for use in a turnbased game, which was based around the cost of moving to certain tiles in points, and the points the player had (the game was like XCom).
However, now all I need is a very simple pathfinder. It has to get from one point to another, and avoid obstacles. That's it. Simple. I have a map set up as an array (Map(20,20) as Integer) - a grass/passable tile has the value of 1, and a solid tile has a value of 2.
I tried to modify my friend's code, but it doesn't work... I just can't figure out how he wrote it, and when I simplified it, it screwed up.
Any help would be GREATLY appreciated. =) (especially if you can provide some source code!)
Thanks,
-Git
-
Git,
I'd be interested in anything you find and would like to help you solve this.
Soon, I'm going to begin working on a 'simple' routine that will work out the best method of getting from a specified co-ordinate on the map (for our turn based game 'Sentience'), to another. I'm probably going to be using A*
Someone on here wrote something really quite clever for me a while back that pretty much did just that and now it's stopped working for some reason. I can't fix it either, so I'm going to start from scratch. It'll be a learning experience I'm sure.
If you work it all out before I get round to it, then I might just become your bestest friend. ;)
-
Their's a pathfinding tutorial(including source) on:
http://www.redrival.com/voodoovb/pathfinding.html :cool:
-
Pathfinding
I'd be interested in this too.
I'm writing a small a-life program based on ants
and right now while they can find food within
thir sight radius, they tend to wander all over the place
before reaching it. while it works, i think a pathfinding type
of routine would probably work better (modified of course, since
there are no obstacles yet)
Anyway, Arbiter, Did you change VB versions since you
first started using that code? if you did, that might have caused it to mess up, Though i've had problems similar to that where a bit of code just suddenly stopped working right even though I hadn't messed with it. If you figure out why that happens, i'd love to know.
(kind of like how you can get an error the first few times you run a program and then not get one the third or fourth time and it works perfectly...)