wouldn't for the maze case it even go faster if you'd do a reverse search too? from the red dot to the green, and then make the 2 endings (current paths) find each other, should be another 40 % off :) in effort
When you draw that maze at the end, why does it continue pathfinding going left from the first big wall? Shouldn't it only expand out when it finds an obstacle, and not if its found a suitable path to follow?
Or is it that I just have the benefit of seeing the maze's layout, and it's checking other possibilities when hitting a dead end?
@pVVENx the way A* pathfinding works is that it keeps spreading from the start point in all possible directions. The black line is just showing the route it thinks is the "best" at that moment in time (notice how in the large maze it can't seem to make up its mind). A* works so well for mazes because a maze provides "pipes" for the algorithm to work through, as opposed to an open map, in which case it acts more like spilling water on the floor.
VV more specifically A* calculates the distance a square is from the start vs how far away it is from the finish. so as it searches toward the finish square, the squares to the left of the start also get searched because although they are farther away from the finish, they are also closer to the start. This ensures that the solution it finds is the shortest possible.
Hey Keebus, is there any chance you can re-upload the source somewhere? I'm really interested in taking a peek, since I have no idea how A* (and pygame, for that matter) works - I'm wondering if I can spot the similarities to dijkstra =]
you should deprioritize seaches that stray away from the target point. 0:51 A more efficient algorithm would not fill the entire left side of the screen.
question, i like your video i was wondering if u can help me with a question i came up with an idea lets say there are two pc's ,in pc 1 there are three box's that are out putting letter from a-z box=f box=r box=w the next set of boxs box=h box=l box=x box 2 a-z box-3 a-z is it possible to see what pc 1 is out puting then take that info and manually in put it into pc 2 then could pc 2 know where pc 1 is going and what pc 1s next out put would be before it comes out
Your source code is no longer available from the pygame website. Also, the heuristics to guess which would be the next best node to search could use some work. In the second example it's searching open nodes (green ones) which are far away instead of those which are close to the goal. You seem to sort the open nodes (green squares) based on their distance from the beginning rather than their distance from the ending goal?
Great video, 5 star. I want the source code, so please fix the link.
Downloaded the source but only see the panels and the background is completely black!?!? Everything is installed correctly because other python games that require pygame work perfectly
I realise that A* itself is very easy to implement (and nice and quick to run if you don't animate the process), but I'm most impressed by the GUI elements. What library did you use for that part?
Very impressive
Beriaal 3 days ago
Better than minecraft pathfinding
CorneliusPappenheime 2 weeks ago
Nice done :)
stonetwig 1 month ago
Comment removed
MegaMinecraftBros 8 months ago
This is very interesting - I'm going to poke around the code and see what I can learn.
Lytyr 8 months ago
The download link is broken on pygame.org. Could you please repost an updated link? I'm planning to use A* for my senior project :D
ZyphyrOfTheWinds 9 months ago
wouldn't for the maze case it even go faster if you'd do a reverse search too? from the red dot to the green, and then make the 2 endings (current paths) find each other, should be another 40 % off :) in effort
HierisBestand 9 months ago
epic :D
HierisBestand 9 months ago
you have broken links in that page
kenorb2 9 months ago
Very interesting! Recently I was thinking about to learn Python - the programming with the snake ;-))
SOPM2007 10 months ago
Oops, I meant the maze in the middle of the video, around 0:40
pVVENx 11 months ago
When you draw that maze at the end, why does it continue pathfinding going left from the first big wall? Shouldn't it only expand out when it finds an obstacle, and not if its found a suitable path to follow?
Or is it that I just have the benefit of seeing the maze's layout, and it's checking other possibilities when hitting a dead end?
pVVENx 11 months ago
@pVVENx the way A* pathfinding works is that it keeps spreading from the start point in all possible directions. The black line is just showing the route it thinks is the "best" at that moment in time (notice how in the large maze it can't seem to make up its mind). A* works so well for mazes because a maze provides "pipes" for the algorithm to work through, as opposed to an open map, in which case it acts more like spilling water on the floor.
wickeand000 9 months ago
VV more specifically A* calculates the distance a square is from the start vs how far away it is from the finish. so as it searches toward the finish square, the squares to the left of the start also get searched because although they are farther away from the finish, they are also closer to the start. This ensures that the solution it finds is the shortest possible.
wickeand000 9 months ago
freakin cool :D
Stauricus 1 year ago
i think the gui slows it down too much. make a much simpler one and you might gain a lot in speed
timonix2 1 year ago
@timonix2 speed is intended to be this slow for algorithm showing purposes.
Keebus87 1 year ago 26
@Keebus87 i guessed, it just seemed so slow and I just chose to blame it on the gui as it has a tendency to be inefficient.
timonix2 1 year ago
Hey Keebus, is there any chance you can re-upload the source somewhere? I'm really interested in taking a peek, since I have no idea how A* (and pygame, for that matter) works - I'm wondering if I can spot the similarities to dijkstra =]
Cheers,
a00021 1 year ago
nice man !!!! will you please tell me wat kind of software is this ? you have develoed it or what ? coding much be a hillarios one !
parthakakoti 1 year ago
@parthakakoti Yes I developed it some time ago using Python/Pygame and my own library for GUI.
Keebus87 1 year ago 2
you should deprioritize seaches that stray away from the target point. 0:51 A more efficient algorithm would not fill the entire left side of the screen.
WhiteDragon103 1 year ago
is it a DFS algorothm?
micfoley8 1 year ago
@micfoley8 A* is an elaborated Dikjstra's Algorithm which is an elaborated BFS algorithm. So, no it isn't.
etskh 1 year ago
says the code is broken bro...
dragonmekill 1 year ago
This has been flagged as spam show
manattan342 1 year ago
Your source code is no longer available from the pygame website. Also, the heuristics to guess which would be the next best node to search could use some work. In the second example it's searching open nodes (green ones) which are far away instead of those which are close to the goal. You seem to sort the open nodes (green squares) based on their distance from the beginning rather than their distance from the ending goal?
Great video, 5 star. I want the source code, so please fix the link.
Buttons840 1 year ago
Not really optimized on the simple problems but the maze was nice :)
SpecklePattern 1 year ago
it works so slow, or you just make it for show?
Neomex000 2 years ago
i think pygame makes it slow
thrasas 2 years ago
wow this is epic, i can't imagine how advanced this is o.o
zamliman 2 years ago 12
not really advanced, just a bitch to program
QuaziGNRLNose 2 years ago
@QuaziGNRLNose it's not really a bitch to program either if you know what you're doing ..
spiricn 1 year ago 5
@zamliman special for you : become lvl 80 is much harder.
bedmanz 5 months ago
Downloaded the source but only see the panels and the background is completely black!?!? Everything is installed correctly because other python games that require pygame work perfectly
AlbertoEAF 2 years ago
Nice work on the GUI!
I realise that A* itself is very easy to implement (and nice and quick to run if you don't animate the process), but I'm most impressed by the GUI elements. What library did you use for that part?
superscatboy 2 years ago 2
AWESOME!!
Can you reupload the source-code somewhere else or send it in a message to my youtube's account?
The site is down! :(
AlbertoEAF 2 years ago
Very Very nice keep on work!
RussianDesert 3 years ago
nice job. ive been trying to get A* working in a game im writing in Obj-C. nice video.
rainydays925 3 years ago
Read video infos to know where to find the source code.
Keebus87 3 years ago
please give some infos.. great job!
blytqb 3 years ago
very great, first time to see such great GUI a* algorithm.
faraday428 3 years ago 2
i dont get it...
jamboylew 3 years ago
holy shit. how long did it take you to code this? and more importantly is the source online somehwere?
fyamnky 3 years ago
Very nice!
McBainMwa 3 years ago 2