Train to platform pathfinding

First off, this is an incredible game design and implementation; great mix of city builder and traffic flow management. Once you have the story, and event generators, expect a timeless classic.

The biggest issue frustrating end-game (for me, 50k+ citizens) enjoyment is throughput optimization for train stations. It becomes critical. Mostly pathfinding logic around platform consumption. One example; lines of trains waiting at forks for the same platform, with multiple empty platforms immediately accessible. Station output can supply mega cities without jamming, but getting the trains into the station efficiently enough (no unused platforms) is currently quickly outpaced.

For the devs (from a fellow game dev)…

  • path cache time is perhaps too long (I know it overwhelms cpu, but it’s too conservative rn),
  • or, path needs to be recalculated at 3, 2, and 1 nodes away from platform entrance (cheap cpu cost if you trigger then, and filter out bypasses).
  • Alternative ideas are a self-decrementing pathfinding cost for a platform that has already been reserved by or is in use by a train,
  • or have per-platform counters of number of paths currently routing to it and weight that in subsequent pathfinding to avoid the current clumping of routes to platforms that are no longer available.

On the subject of pathfinding, of lower priority, can we increase the default cost for empty platforms to increase the algorithm solution chance for station bypasses. Late-game requires expedited routes that skip a few stations, instead of clogging yet not using a platform slot.

Cheers, and keep up the amazing work!

Thanks for the post!
I think the train checks its target platform for being free every second or so. Is it possible the jam is caused by trains that just want to go through the station without stopping?

Maybe if you could share a save where one train does not go to a free station even though it could that would be helpful.