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
A* algo
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) !!!
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) !!!
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
-
- Posts: 48
- Joined: Thu Jun 15, 2006 6:35 pm
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*!!
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*!!
-
- Posts: 275
- Joined: Fri May 12, 2006 6:37 pm
- Location: Germany
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!
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!