Forum

> > CS2D > Scripts > A* Path finding algorithm
Forums overviewCS2D overview Scripts overviewLog in to reply

English A* Path finding algorithm

7 replies
To the start Previous 1 Next To the start

old A* Path finding algorithm

Infinite Rain
Reviewer Off Offline

Quote
Hello people.
I always wanted to create the function that finds the shortest path from one point to another. After a while I've learned that CS2D uses A* path finding algorithm. I tried to search in Google about that, but unfortunately I wasn't able to understand a thing about it. Then I tried to take a closer look at Starkkz' path finding function, but still.

I would be thankful to you guys, if you'll be able to explain me how exactly this algorithm working.

old Re: A* Path finding algorithm

Starkkz
Moderator Off Offline

Quote
I can't exactly remember on what page did I get the information to make it, but you have to search a tutorial very well explained with source code.

I used different part of different tutorials
http://wiki.gamegardens.com/Path_Finding_Tutorial
http://www.policyalmanac.org/games/aStarTutorial.htm
http://en.wikipedia.org/wiki/A*_search_algorithm

Edit: In the tutorial there is explained that you must search the lowest F value, I didn't use this because I couldn't get the path and the script crashed my game so I used the lowest H value. The path that the script will find is not going to be very short but it's stable.
edited 1×, last 31.01.13 10:30:36 pm

old Re: A* Path finding algorithm

Infinite Rain
Reviewer Off Offline

Quote
Article about A* has written
The sample package contains two versions: one in C++ and one in Blitz Basic.

Blitz Basic! Fuck yeah! Thank you Starkkz! I will take closer look at this one. (Wikipedia is using a lot of hard words D:)

old Re: A* Path finding algorithm

DannyDeth
User Off Offline

Quote
If you go past the first few paragraphs on the Wikipedia page, there is a psuedo-code. As you can see, it's quite simple. Converting it to whatever language you'll be programming shouldn't be too hard.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview