A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: A* pathfinding demo

  1. #1
    New Title:
    Join Date
    Jul 2002
    Posts
    87

    A* pathfinding demo

    Many months ago there was some discussion about A* and pathfinding. (Likely there have been discussions since, I haven't been keeping up with this forum.) I've made some minor updates to the A* movie, and put the fla file up for people to have a look at.

    You can find it here: http://www.antimodal.com/astar/

  2. #2
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    I found that A* is speed intencive for Flash games its just so slow sometimes. I know that you can adjust your A* heuristic to approximate more but its to slow. I know that A* is accurate, but its just my opinion.

  3. #3
    SaphuA mosterdfles_flash's Avatar
    Join Date
    Jan 2002
    Location
    Tha Couch
    Posts
    935

    :)

    That's realy nice!

    But very complicated :S... i dont get it
    'How Art Is The Visual While We’re Artificial…'

    Mail & MSN
    My Not Finisched Page!
    Nick: SaphuA

  4. #4
    Senior Member
    Join Date
    Apr 2001
    Posts
    175
    I think you're referring to a question I asked way back then. I did my school science project on comparing the algorithms available, and determined that at least for my application, Dijkstra's algorithm is the best. It's better for fiding the distance to every position within a given range, becuase you need 1 iteration per square anyway and it has the shortest iterations.

    I may put my own demo up tonight since the topic has come back, check back later if you want to see it.

  5. #5
    uhm
    Join Date
    Nov 2000
    Location
    Leeds(ish), UK
    Posts
    99
    i found this very interesting and useful

  6. #6
    SaphuA mosterdfles_flash's Avatar
    Join Date
    Jan 2002
    Location
    Tha Couch
    Posts
    935
    Originally posted by Flecko
    I think you're referring to a question I asked way back then. I did my school science project on comparing the algorithms available, and determined that at least for my application, Dijkstra's algorithm is the best. It's better for fiding the distance to every position within a given range, becuase you need 1 iteration per square anyway and it has the shortest iterations.

    I may put my own demo up tonight since the topic has come back, check back later if you want to see it.
    Like ta see it
    ________________________________________-



    I was was wondering, what does A* (astar) mean anyway???
    'How Art Is The Visual While We’re Artificial…'

    Mail & MSN
    My Not Finisched Page!
    Nick: SaphuA

  7. #7
    Senior Member
    Join Date
    Jun 2000
    Posts
    896
    That's pretty sweet!

    Here is my implimentation of A* as applied to an isometric world. This version of it supports multiple terrains.
    http://www.electrotank.com/lab/astar_iso.html

    The path that he'll walk is between where he is and the highlighted square. You can change the terrain or the object on any square.

    What's so cool about A*, in my opinion, is the multi-terrain stuff. The algorithm will actually search for paths around, say, a big pond. If the pond is too big then it will take you through it

    Great job on yours!

    ps. Hooligan: A* can be sped up. There is an array of 'open' tiles that are being searched. That array can get big. You can force it to never get above a certain size making the algorithm dramatically faster. But with speed you get less accurate results. You will find a path but it may not be the best.

  8. #8
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    jobemjobem:- Yeah i understand. Great demo. Gotta love the frog. It is a frog right

  9. #9

  10. #10
    Senior Member
    Join Date
    Apr 2001
    Posts
    175
    http://www.flecko.net/flash.php?file...512&height=512

    It runs three pathfinding algorithms in this order: Dijkstra's, BFS, and A*. It's displayed as a grid, where the lighter squares cost less. Each algorithm colors the squares it explores so you can see how it moves. (By the way, I should mention that this is not the traditional A*, but a modified version which sacrifices about 10% accuracy for some extra speed). The program should be self-explanatory, but if you can't figure out what the forms mean just hit the 16x16 button.

    This was my high school science project. The navy awarded me 50 bucks for it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center