A* algo

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
anandh
Posts: 61
Joined: Thu Sep 14, 2006 12:40 pm
Contact:

A* algo

Post by anandh »

I hv started a simple game using irrlicht.
I hv planed to integrate A* algo for my AI.
Iam in searching for tutorial for A*,I got a lot.
Iam going to use this for shortest path in 2d array.
Did any one have idea please help me
regards
anandh
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

ou could have a look at my simple steering demo with waypoints:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=14183
it uses A* for the path finding !!!

But it's not really good documented, so if you have questions, ask me (eMail, please) !!! :wink:
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
funcdoobiest
Posts: 48
Joined: Thu Jun 15, 2006 6:35 pm

Post by funcdoobiest »

yeah the A* is tried and tested and if you have a small/simple game then I would say go for it.

The Ai Game Programming Wisdom books and the Game Programming Gems books are really useful resources.

"The basics of A* for path planning." in Game Programming Gems (2000) - basically the article that taught me A*

"Basic A* pathfinding made simple." in AI Game Programming Wisdom. (2002)

There are also loads more articles that go further into pathfinding in both series.

If you are going to end up with a lot of AI agents doing a lot of pathfinding though, the more you may want want to look into optimisations (not computing the whole path in one go for example) and alternatives (such as precomputed paths stored in lookup tables or using lines of sight to see if you can avoid running an A* seacrh in the first place.) because A* can become a CPU hog.

I am not trying to put you off or make it sound daunting just considerations for the future, for now I would say go for it, you will probably realsie when/if you need more than the basic A*!!
TheGameMaker
Posts: 275
Joined: Fri May 12, 2006 6:37 pm
Location: Germany

Post by TheGameMaker »

if found a very well working lookup table solution.
You first calculat the shortest Path between all Points(can be done at loading time, or at Level creation time) and save it into an two dimensional array.
the for finding the path you just iterate through it. Looking for every node if the dist from the startpoint+dist to target=dist from startpoint to targetpoint. If yes its a node on the Path!
Post Reply