AS3: Pathfinder in big mazes
Wednesday, October 26th, 2005As I swear here is perfomance test results for pathfinding in bg mazes in AS2 and AS3
Results is not surprise
| ActionScript | ||
| Path length | AS2.0 | AS3.0 |
| ~ 20 units | 50 – 200 ms | 5 – 11 ms |
| ~ 60 units | 1400 – 1600 ms | 14-60 ms |
| ~ 100 units | 2000 – 2400 ms | 30 – 100 ms |
Here are examples:
- ActionScript 2.0 (from Andre Michelle)
- ActionScript 3.0 (port from example above)
Sources:
- ActionScript 2.0
- ActionScript 3.0
it’s 100 times faster, and when multiframing will be disabled, i think 100 units path finding will take 30 ms => just 100 time faster than AS2.0. The slowest part is just rendering!
.
I dont release source, beause it is not mine, but it was in some forum (do not know where), so I will ask Andre Michelle, if I can post them. So try to check it here for sources in few days.
Enjoy.






3 Trackbacks/Pingbacks
6 Comments
André Michelle
• Visit Site
October 26th, 2005
You are welcome. Share your code
Administrator
• Visit Site
October 26th, 2005
Thanks Andre, I will add both source codes today.
Dave
• Visit Site
September 20th, 2007
Is it me, or is there a lot of debug errors that pop up, and the code doesnt run.. for the Actionscript 3.0 source, the 2.0 source works fine.. but the 3.0 doesnt seem to work for me, is there anyone else having this problem? Thanks!
Administrator
• Visit Site
September 20th, 2007
Dave, it was done in Alpha version of Flex Builder 2, and it is not compatible with final version
so, that’s why errors are there. But I got fixed AS3.0 version, so I can share them
Roberto
• Visit Site
October 29th, 2007
I have made some minor change to your source, now it compile under flash cs3 (the fla only embed the ap01.png). Now you can create the map from a png file. black pixel will be notwalkable white pixel yes. If now you ckick on an area not reachable the program let you know. I hope you like my changes.
Do you think its possible to give node a weigth?
Roberto
• Visit Site
October 31st, 2007
new version avaible at same url of previous post, I keep working on it to let user decide a 4 direction or a 8 direction search, next I will try to use weighted node and a version that find more linear (even if longer) path. I think it will be better to avoid character to continuesly change direction while moving in a free area…
thank for you work I really appreciate it.
Live Preview
Leave a comment