a concrete problem with my pathfinder, this time: - Printable Version +- Qbasicnews.com (http://qbasicnews.com/newforum) +-- Forum: QBasic (http://qbasicnews.com/newforum/forum-4.html) +--- Forum: QB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-11.html) +--- Thread: a concrete problem with my pathfinder, this time: (/thread-337.html) |
a concrete problem with my pathfinder, this time: - Agamemnus - 03-04-2003 I figured out how to do it, theoretically. 1) First, I get the island borders. 2) Then, I get unique landmasses within the first island border level. 3) Then, I run an algorithm to figure out which landmass is connected to which. 4) Then, I run an algorithm that calculates the paths and distance between adjacent landmasses from each landmass by using even smaller landmasses (circle patches) within the landmass. And I also need to do (3) on this as well. 5) Then I make a search tree for the larger landmasses and find the path from the unit to the target landmass. 6) Then I do the same thing as (4), except I calculate the path from the border of the landmass to the unit or the target. 7) Then I combine those 3 paths to get the big path. (edit: 1, 2, and 3 done; on to 4) This is the only workable approach I know, plus there is the added advantage that I can reuse the paths gained in steps 2-6 every time I make a new path!! Thus the path calculation is fast for 10, 100, or 1000 units! :bounce: http://www.geocities.com/pisforpi/weird3.gif What do you people think? :| |