We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexDiscussionExhibition › Fast AStar
Page Index Toggle Pages: 1
Fast AStar (Read 586 times)
Fast AStar
Mar 15th, 2008, 3:49pm
 
I've had to revisit this algorithm at work recently in AS2. Which means that I needed to make it as fast as possible. I came up with a nice few tricks to do so as well.

I was so chuffed with myself that I decided to port it to Processing and share it along with how I made the speed boosts.

http://www.robotacid.com/PBeta/fast_astar/index.html

If you can think of any way to make it even faster, I'd love to hear your thoughts. My overhead is at a premium on this project.
Re: Fast AStar
Reply #1 - Mar 16th, 2008, 11:57am
 
You're right, that is fast!

I have to confess that I don't understand the code completely, but from what I can gather, its a really cheap (computationally, that is) way of doing it. How hard do you think it'd be to expand it to work in all directions, either 360 degrees, or even full 3D?
Re: Fast AStar
Reply #2 - Mar 16th, 2008, 1:43pm
 
Back in the day I started with my own write up of the algorithm, and then TomC came up with one:

http://www.tom-carden.co.uk/p5/a_star_web/applet/index.html

Tom's version was technically more acurrate than mine so I adopted it and then decided to pull out everything that was slowing it down like Java Collections and the endless array sorting and searching. Limiting the search steps is also very important - for bot AI, you don't necessarily need to find the finish node.

So basically - for 3D, we go back to Tom's model of an ArrayList in each Node. Then you'll be constructing a series of waypoints in your map. Bots get the scent, then work through the waypoints to the target.
Page Index Toggle Pages: 1