Page 1 of 1

Train pathing - forbid passing through stops

Posted: Thu Jul 28, 2016 5:52 pm
by SpeedDaemon
It would be nice if trains got a massive pathing penalty when trying to pass a train stop that's not their immediate destination or departure point. I would actually prefer if the algorithm completely forbid the practice (or at least an option to have it do so).

With the new train conditions in .13, a train can stay at a stop for a LONG time, and having other trains decide they want to use that bit of track to get around another train, turn around, or whatever means they can get stuck behind a train at a station that won't leave for a long time. Not to mention when you're being safe by crossing the tracks "downstream" of the stop, only to be run down by a train blasting through at full speed... :P

You can design around the problem to some extent (waste space by adding a turn-around loop to the entry of every station, not build stations that "cut corners" on the main line, etc.), but the trains sometimes have a mind of their own.

Re: Train pathing - forbid passing through stops

Posted: Fri Jul 29, 2016 2:23 pm
by atloomis
I agree that train pathing in general still needs a lot of work. Fixing that the train won't move in this situation would help with stations. Even though the train could easily go around the red signal with very little distance in difference, it insists on waiting.

Image

Re: Train pathing - forbid passing through stops

Posted: Fri Jul 29, 2016 2:56 pm
by Engimage
The idea is good.

But the issue is that this behaviour might be intended in some cases. I would propose to extend this idea a bit.

Introduce "Sets of pathing rules" for trains. These sets will include various parameters like station crossing, maximum runaround length etc. Later you might want to assign these rules to trains. There will be a default set with default rules as well which will be assigned to all new trains.

Re: Train pathing - forbid passing through stops

Posted: Sat Jul 30, 2016 12:09 pm
by siggboy
SpeedDaemon wrote:With the new train conditions in .13, a train can stay at a stop for a LONG time, and having other trains decide they want to use that bit of track to get around another train, turn around, or whatever means they can get stuck behind a train at a station that won't leave for a long time.
I've already run into this problem in 0.12, because with my train system ALL trains run through a central depot (it's using the SmartTrains mod, in case you're wondering). And the trains are waiting in the depot until it's their turn to leave. Sometimes, a train would, for whatever reason, try to take a "shortcut" through the depot, and then had to wait "in line", possibly behind a lot of other trains, just to continue on its way.

I kind of worked around it by laying out the way into and out of the depot so that it's supposed to never be a shortcut, but I think I never managed to eliminate the problem entirely.

Sometimes it can be beneficial if the train can take a shortcut through a train stop, but of course only if the train stop is not occupied.

In general it would be much better if the passing algorithm didn't allow tiles with a train stop at all, unless the train stop is actually the destination of the train.

Re: Train pathing - forbid passing through stops

Posted: Sat Jul 30, 2016 12:33 pm
by steinio
Sounds like are missing chain signals and a bypass route without train stop in your depot.

Re: Train pathing - forbid passing through stops

Posted: Sat Jul 30, 2016 1:19 pm
by siggboy
I have chain signals, this is not bush league :).

Why should I build a bypass route? It's even possible for a train to plot a path through the depot while it's empty, but at the time that train arrives (and wants to go through the depot), there's already another train there waiting (possibly for a long time).

Signals do not solve the problem, believe me.

And bypass routes should not be needed to work around suboptimal train pathing by the game (and I don't think they'd solve the problem either, because the train might still plot a route through the station instead of through the bypassing railway).

Re: Train pathing - forbid passing through stops

Posted: Sat Jul 30, 2016 1:34 pm
by ssilk
Added to viewtopic.php?f=80&t=21899 Control Train Pathfinder (Passthru stations, Add Penalty)