Michiel wrote: ↑25 May 2010 20:29
It should really have a lake detector... the pathfinder is still slow when it tries to find a route across or around a large body of water. Never mind, just thinking out loud
It's fun giving it infinite money and watching it spew forth all over the map
It's taken almost 14 years, but today I added... a lake detector!
It's dead simple really, but the idea only came to me the other night. Consider the following mockup:
- lake-detector-small.png (519.04 KiB) Viewed 1890 times
When trying to find a spot for a station, it'll look at the four edges of the rectangle defined by the start (crossing exit) and destination (station entrance). It checks the tiles along each edge and if it finds a long run of water (longer than the maximum bridge length it is allowed to use) it considers that edge "blocked by water". However, it will only consider this problematic if
two parallel edges are blocked. In that case, it will declare it an unviable spot for a station, and look elsewhere.
This may lead to some missed opportunities (there might be a perfectly fine bit of land in between the edges), but that's fine - the network building algorithm tends to sprawl its tendrils across the map anyway. It's much better than ChooChoo sitting there, pathfinding for 20 years.
I still need to do some more testing and tweaking, but expect another release soon