Have a look at viewtopic.php?p=466888#p466888. In gameplay terms, I think the rail network is close to optimal - highly redundant, high throughput and full coverage everywhere within the walls. I have had rail networks with "narrower" cores buckle with fewer trains than you see there, and that is exceptionally painful to retrofit a fix for. The unfortunate part is that frequently eating up 5 ms or more of your 16 ms budget for trains is pretty significant.Rseding91 wrote: Fri Oct 11, 2019 6:52 pmIf you say so. The only time I've ever seen rail path finding being "slow" is on rail networks like this: https://www.factorio.com/blog/post/fff-296 and even then it's not actually slow relative to the rest of the simulation (still runs at 60 UPS) - it just takes enough time that I can measure it. All of the time ends up being memory latency at that point.PunPun wrote: Fri Oct 11, 2019 10:37 amOHGODS. It's a djikstra. The only thing djikstra has over A* is that it is easier to implement. No wonder big railnetworks with lots of intersections are slow.
In addition to the absolute cost of the trains, the spiky nature of their performance cost is also annoying. 50 UPS steady is noticeably less annoying than bouncing between 40 and 60 UPS.
Would it be possible to amortize the pathfinding cost over multiple ticks? Perhaps for longer trips trains plot a path to an intermediate point that's closer to their destination and then replot when they get (close to) there instead of plotting out the entire path from the get go.