The idea.
I've fiddled around with some data CCP provides of their game Eve Online (for the unaware, MMORPG, space-based, http://www.eve-online.com will tell you all), part of this data is the information of all solar systems in the game, what constellations and regions they lie in etc etc.. but also to which they are connected.
So after a good night of coding I came up with a simple test on how their optimalisation seemed to work.
Normal A* works like this:
Having a grid like that, through normal A* without any optimisation, it would explore every cell there is trying to find the path untill it reached B, you could add optimisation where it would look at the direction and try that first, saves a few cells, but in OpenTTD with wierd landscapes that wouldn't allways work, so is pretty much useless.
What -does- work, is using regions for the water, making another grid, only this time 8x8 instead of 1x1, and making one even bigger (for big maps mostly) doing 64x64, you increase the time spent calculating a path in small areas by only a tiny bit, probably an increase of 10% in cycles needed, but the huge difference would come with big (200-squares+ routes).. going from 'unable to find path', to actually finding a path.
The main idea:
when calculating a path, calculate a path using the 64x64 regions from start to end , this should give a 'general path' of the direction the ship would take, then calculating the same path using a 8x8 regions, but this time the regions can only be within the 64x64 path found, or adjacent to it (Because, obviously, sometimes the map can be an ass and throws in a de-tour), after that is done, the similar thing with a normal 1x1 grid, using the 8x8 path..
every region is connectable to it's adjacent when there's water on it's side, might want to have some optimalisation where it rules out small lakes (so it only inlcudes open water)
I'll attach some sample C# code i am fiddling with, it might not really compile that good since there's 1 function that i was working on.. the data you'll have to imagine yourself since i'm not going to upload 10 megs worth of xml data
