Thanks so much for the kind words!
When I was working on Alden Ridge, I happened upon a website claiming that they had a far better pathfinding algorithm than A*. They said it was based on the idea of how water flows, and basically was doing the pathfinnding in reverse, which had many benefits. I had been knee-deep in A* and its many variants up until then, and while the claims of this little personal site seemed unlikely, looking at the code examples, and then profiling them... this guy was right!
And now I don't remember the site. Gah. I wish I could give credit. I took what that guy was doing, which was itself
sort of a variant of A*, and realized there were actually a number of other optimizations I could do at that time (such as solving 300 paths for the price of one, better diagonals handling, etc). So I built all that stuff in, and then mine was even worlds better than the one from that other website, at least for the specific uses inside Alden Ridge. I'm sure others have developed out similar things for other games (as I know most games have hybrid pathfinding systems), but this was unique in what I'd seen (as most of commercial pathfinding algorithms actually in use aren't shared).
So... with AI War's pathfinding for planets, it's a trivially easy problem, actually, compared to what I was doing in Alden Ridge. I basically made a stripped down version of what I had been doing in AR, but based on arbitrary linkages rather than a fixed grid, and the result is what is here.
It's super simple, in concept:
1. Set all the distances on all planets to -1.
2. Set the distance on the target planet(s) to 0.
3. Now the loop: hang on to the index from the prior step, and all of the adjacent planets to that index get index +1. Then increment the index and repeat. Hang on to the number of distances that were set, and if that is ever 0, then end.
4. Now you've got the distances from every planet to the target planet(s) you're interested in, all in one go.
With diagonals and such it gets a bit more tricky, but that's how I'm able to do the "solve for everything in one pathfinding step," and it doesn't have any of the complexity of the A* algorithm. Elegantly simple, and ridiculously fast and powerful.