Is A* Awesome?
Yes.
For anyone not having a clue what A* is, here’s the short version. A* is a way to determine a path out of a network of interconnected nodes. In particular, it’s quite adept at doing so in a network of nodes where not all nodes are linked together (such as a grid of A B C D, where A and B are linked, A and C are linked, A and D are linked, and C and D are linked – the only way to get to B is through A).
Think I’m going to do some testing sooner or later with the possibility of re-implementing fuel usage in the space simulation (I had it disabled because of a lack of patfhinding ability). It USED to be that if Alstair and Conmir were 10,000 units apart, you’d still fly it because there wasn’t fuel to worry about. What I WANTED is that the ships would stop at Beta or any other stations along the way to refuel if they couldn’t make the jump in one shot.
The really -ugly- part is I’m NOT sure A* will work with the Trade Lane idea I wanted to borrow from Microsoft’s third person space game Freelancer – part of A* utilizes the remaining straight-line distance to the end planet, which is offset by Trade Lanes (fuel is usually used at a constant rate for each unit of distance, but in a Trade Lane that amount is decreased DRAMATICALLY). Gunna need to test to see if A* can still find either the absolute best path, or at least get one that is -close-.
One minor piece of good news is I can still do that with the existing simulation code I have, although it still needs a rewrite for stuff like Cargo and whatnot (which I did a horrible get-it-done job of the first time). I can at least get waypointing up so it’s not possible to go from Altair to Conmir in a light craft without stopping, cause the fuel tank just isn’t big enough.
