Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Thanks for the thorough response.

The problem I think I'm seeing is that they're reserving detours that just lead them back to the same blockage—it's as though they're going "oh boy, clear track!" without regard to the fact that the clear track in question is just a longer route to the same blocked track they're trying to route around. I hope I'm not missing what you meant—my sticking point is that it doesn't seem like there's any "past" or "future" planning required to see that both routes end up at the same bottleneck, and to then prefer the route that's shorter before the bottleneck.

This screenshot has a good example. If one train is in the station, the next will pause at the signal just before the station, then embark upon the much longer loop, even though the end result is that the train is stuck waiting for the same blockage to clear even farther from the station. Just after building this, I even saw the second train wait before the station, and when the train occupying the station left, going around the entire loop rather than just go into the soon-to-be-empty station. I think it's hard to avoid this behavior when I have multiple stations coming off a main line. I recognize that this is a nontrivial problem which you've thought about a lot more than I have, but isn't there any way the pathfinding can recognize when an alternate route doesn't actually help with a given obstacle?

Mainly, it just isn't generally true that we should always want trains to avoid longer paths to the same blocked track like in your idea. Given a layout like you have in your screenshot, it is entirely reasonable to *want* the second train to use the loop as a buffer if there is a blockage: If the second train is long, then taking the loop will free up track behind it, which might be important to avoiding jams in the rest of your network. I would not be content to add heuristics that take away opportunities like this.

I am, however, working on an option to modify how a train considers detours when it is stuck in traffic. I believe this will help for your playstyle.