A* 3D – No, really, it’s 3D

There seemed to be a little disappointment that my A* demo wasn’t actually searching in 3D. Maybe I should have called it A* visualized in 3D. At any rate I’ve revamped things and now have a demo that does search in 3D.

A* 3D

It wasn’t much of a stretch to get things working in the third dimension. The only thing I found particularly tricky was making sure that the path didn’t cut through a solid corner — move diagonally adjacent to a non-walkable node. Besides that everything was pretty straight forward. I also took the time to make sure the code was clean and at least somewhat documented. I haven’t bothered to try to do any optimization and I certainly haven’t put much time into splitting the functionality into proper objects. Nonetheless, here’s the source.

Note that you’ll need to add to your class path Away3D as well as Zeh Fernando’s Tweener w/ Bezier support which powers the animation in 3D.


18 Responses to “A* 3D – No, really, it’s 3D”
  1. Timb0b Says:

    Well, what the hell? This is amazing and certainly blows any criticism the previous version had :D It’s a great/easy block editor too, very well done.

    Thanks for that (and you even provide the source). Terrific.

  2. Paul Says:

    I owe you a thanks. I probably wouldn’t have bothered working on this if it wasn’t for your comment.

  3. Actionscript 3.0 A* path search algo in 3D with source « Cyberspace Nova Says:

    [...] Published July 4th, 2007 Actionscript 3.0 , Web developer , Flex , 3D , Flash Actionscript Architect released very nice implementation of A* path search algorithm for Actionscrip…. Example lets you create 3D maze and point to start and end node of path. Great work, as author [...]

  4. A* 3D - No, really, it’s 3D « Flash Enabled - Get Ready With Flash… Says:

    [...] here, to check his post and download [...]

  5. Laurent Says:

    Bravo! That’s amazing.
    That was already great yesterday by the way. We’re very demanding :)
    Thank you.

  6. [ draw.logic ] 3D Pathfinding in AS3 « Says:

    [...] in AS3 July 4th, 2007 — drawk The actionscript architect Paul Spitzer has posted two killer demos of pathfinding using A* in AS3/Flash 9 using the Away3D engine (derivative of Papervision3D that is taking off). These demos not only [...]

  7. reintroducing.com Blogging Receptacle » Blog Archive » A* Pathfinder In 3D Says:

    [...] ActionScript Architect came up with a pathfinding demo in 3D.  It’s pretty insane and it uses AS3.  You can grab the source and example files from the blog post. [...]

  8. Michael Battle - Work & Play » A* in 3D Flash - Flash and Actionscript Experiments! Says:

    [...] Link: A* in 3D Blog: ActionScript Architect [...]

  9. Metah Blog » Blog Archive » 3D Pathfinding in AS3 Says:

    [...] I’m looking forward to have some times to look at the source, btw I’m wondering if it is the shortest path taken or not? Also why doesn’t it follow exactly the cube structure, the path seems to take “air” sometimes. Anyway this is a great job. [...]

  10. Christian Pfeil » A*-Algorithmus Implementierung mit ActionScript und in 3-D » A*-Algorithmus Implementierung mit ActionScript und in 3-D Says:

    [...] actionscriptarchitect.com – A* 3D – No, really, it’s 3D/ [...]

  11. Mor Says:

    Isn’t A* supposed to find the shortest path? I made a test that got a 10 step path from your algorithm. The shortest would have been 8 steps… could this be a bug or did I miss something?

  12. Paul Says:

    I’ve noticed that it doesn’t always find the shortest path as well. Likely an oversight in the implementation.

  13. 3d A* Algorythmus exportiert Says:

    [...] Actionscriptarchitect.com findet man eine A* Wegfindungsroutine – leider in ActionScript – welche hervorragend umgesetzt wurde aber durchaus auch in JavaScript [...]

  14. ecitnet Says:

    very good 3d *A

  15. mike Says:

    this is great! it would be even cooler though if you could make a version where the ball can move along the ground and tops of the boxes, and can only go up a certain number of squares to get over boxes in its way.

  16. Paul Says:

    Yeah, definitely, with physics even. :)

  17. BGdesign Says:

    This is great very clean. Props very nice.

  18. poker game practice Says:

    its a very good 3d it doesnt always find the shortet path to move around.and it doesnt follw the cube structure too.

Leave a Comment