psychophoniac wrote:wow I'm impressed, i thought A* algorithms only work for 2D...
suggestions:
-since it is loading very long for generating the pathfinding data, why don't you store it to an file and load it on startup? the map doesn't change, so...
-it seems like longer ways are not working correctly, you might have an eye on that.
-maybe you can add an extend feature for an path (left mouse sets new, right adds an point to the existing one)
-those boxes are not shown, when not looking at the map, do you want this to be like this?
i've got a question too, what does the red and the blue color of the boxes mean?
stats on my pc (might help?):
i loaded (full map generation) about 2 minutes, and FPS were around 20 on winXP, AMD sempron 2800, nVidia Geforce 4MX 400, 512mb DDR400, normal collision demo is around 30 FPS.
Yep, A* is not just for 2D and not just for finding a path.
As for your suggestions :
-Loading and Saving in the file seems to be a good idea for the demo. In the code I don't think it's worth it, since I find myself to change the sectors/portals generation code pretty often. (This code is engine specific)
-The longer ways are the glitch I was talking about.
-Extended feature seems like a good idea, my only problem with it is that I don't want to complexify the demo code. There's a complete demo in GOOF, which is about 2 000 lines of code just to make it work the right way it should be used, with threading and dynamic recalculation. It was a demo which wasn't really friendly user, and I think not a lot of people really tried it.
-Well I've used the default way to create boxes in Irrlicht, I don't know if there's any other way.
Red is for sectors and blue for portals. My pathfinding is heavily based on
http://www.gamasutra.com/features/20020 ... th_pfv.htm
The performance are normal, the generation of the boxes are supposed to be an offline process and I've just used a list to store them, for simplicity. The drop in FPS is due to the number of boxes shown.
To improve the A*, check this page :
http://argorha.wiki.sourceforge.net/Pat ... ith+tought