Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Astar Bug..

Credits go to Edgar Reynaldo for helping out!
This thread is locked; no one can reply to it. rss feed Print
Astar Bug..
Ariesnl
Member #2,902
November 2002
avatar

Hey everyone,

I thought I finally managed to implement astar..
I first tried it with a simple map consisting of vectors of vectors, containing tiles
now for performance I switched to vectors containing pointers to objects..
But now my algorithm seems to make a lot of mistakes..

and I have no idea why... :-/

Anyone want to help ?

Perhaps one day we will find that the human factor is more complicated than space and time (Jean luc Picard)
Current project: [Star Trek Project ] Join if you want ;-)

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Ariesnl
Member #2,902
November 2002
avatar

the red squares are not passable
the black squares are passable
the green dots( now white circles) are the path from 2,2 to 50,50

I think I found the bug, for some reason x and y are reversed..

try it .. now with n you can get a new random path ( all starting from 2,2)

thx for looking at it ;-)

if you have any suggestions for improvement, please do so

Perhaps one day we will find that the human factor is more complicated than space and time (Jean luc Picard)
Current project: [Star Trek Project ] Join if you want ;-)

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Go to: