First A* Implimentation
I've been wanting to try to write an implementation of A* for a while, and I finally bit the bullet and wrote one today. It turned out pretty good I think. Maybe it's not the most optimized it could be, but it works pretty well. Currently, with the size maps shown in the screen shot, it usually takes less than 20ms to find a path or a little over 60ms if it cannot find any valid paths. That should work out well enough -- especially since the algorithm will only be run when the player clicks on where he wants the mutants to go.(log in to comment)
Comments
Whats horrible is trying to write an a* program that is able to path-find around a maze in a bitmap image
This will be used with a tilemap world. Yeah, doing a per-pixel A* path finding on a bitmap would be a little slow, I suppose.
ArmchairArmada on 2011/09/15 06:38:
Noticed a few cases where it doesn't find the shortest path, but instead one that's a little bit longer. I think I know why it's doing that, but I'm not sure how much I'm going to worry about it. I don't think it would adversely effect gameplay too much.