Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / How to Apply the A* Pathfinding Algorithm

Author
Message
tmd13
15
Years of Service
User Offline
Joined: 16th Sep 2009
Location:
Posted: 18th Nov 2009 22:28
I understand the concept of this algorithm but how can I apply it to a 3D environment.

I already have created my environment I just need to know how to implement it on it.



Thanks in advance
prasoc
16
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 18th Nov 2009 22:33
For my A*, I use Sparky's collision to have a makeshift "grid" pattern on the level. Think of the level as a 2d plain and follow a tutorial on how to get it in 2d which it isn't to hard to use the y-axis (really it should be the Z, but o well) for going up hills, etc.


Your signature has been erased by a mod
tmd13
15
Years of Service
User Offline
Joined: 16th Sep 2009
Location:
Posted: 18th Nov 2009 22:42
What is Sparky's collision and Where can I get it or buy it????
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 19th Nov 2009 21:35
Sparky's is a library of collision detection functions:

http://forum.thegamecreators.com/?m=forum_view&t=74762&b=5

Have a look also at this nice 3D pathfinding algorythm by luke810 (same topic in two threads):

http://forum.thegamecreators.com/?m=forum_view&t=157808&b=22

http://forum.thegamecreators.com/?m=forum_view&t=159743&b=8
tmd13
15
Years of Service
User Offline
Joined: 16th Sep 2009
Location:
Posted: 24th Nov 2009 03:26
I cannot find a manual that explain everything on how to apply the algorithm and how to create the square grid and locate the nodes. All those details on how to do it.

If somebody can help me please I will really appreciate it.


Thanks in advance
luke810
18
Years of Service
User Offline
Joined: 4th Sep 2006
Location: United States
Posted: 24th Nov 2009 05:38
Just Create an array grid[x][z], where z and z are the grid coordinates. Then each node is true if its walkable, and false otherwise. Using this as a reference, you have neighbor nodes
( x+-1, z+-1 ) that can easily be accessed given known coordinates.

The site I learned the algorithm from was here:

http://www.policyalmanac.org/games/aStarTutorial.htm

The algorithm itself is laid out on the site as follows:



( It's towards the end of the page )

If you're still having trouble trying to implement it there are several DBPro versions of A* algorithms that you should be able to glean some information from.

tmd13
15
Years of Service
User Offline
Joined: 16th Sep 2009
Location:
Posted: 25th Nov 2009 00:27
I read that info a couple of days ago I mean the one in the link you showed me but the example they have is not there anymore (broken link)

So I am kind of confuse with this.

If someone can give me a detail example it would be amazing.


Thanks in advance
luke810
18
Years of Service
User Offline
Joined: 4th Sep 2006
Location: United States
Posted: 25th Nov 2009 01:59
http://www.policyalmanac.org/games/AStar.zip

This is an example in c++, and it's right on the page I linked too...

Login to post a reply

Server time is: 2024-11-24 17:22:48
Your offset time is: 2024-11-24 17:22:48