Path signal doesn't allow a train to a free path

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
popka.enota
Engineer
Engineer
Posts: 6
Joined: 05 Feb 2023 04:58

Path signal doesn't allow a train to a free path

Post by popka.enota »

My goal: I want to build a 3-track railroad. with 2 conditions:
1. 2 outer tracks are the main tracks, each works in its own direction(opposite).
2. The middle tack is a shared one and works in both directions. It should be used only if the main track is busy with a broken or slower train. And trains should get back to the main track as soon as it is possible.
Image
The problem: If I use no signals on the middle track, it will be always used by trains even if their main track is free. From egoistic approach it makes sense to use the middle track if it is free. But I want to let trains only use it to pass other trains on the main track.

I think I need to add some penalty to the middle track, so it will be less preferable to the pathfinding algo. I tried to place PBS so that trains have to approach them from behind and as I understand this method does create some penalty. BUT PBS also create some strange conditions, so trains get stuck when there is clearly a free path.

I created a minimal example to demonstrate that.
Here you can see the main track on top is busy with a stopped train. Another track under it is free and could be used by the second train. But the second train is waiting for free path.
The problem is in the block, pointed by two railroad arrows. Somehow pathfinding algo gets lost in this place even though it can choose any of two ways:
- either through PBS pointed by the lower arrow
- or a free path pointed by the top arrow
I assume, PF gets into a loop or smth in that place, because if I remove either a PBS or a piece of railroad pointed by the arrows, then PF immediately resolves the way.
Image

Anyways, even though I'd like to resolve the general PBS problem in the simplified example, my main issue is how to build a three-track railroad. Maybe I need to use something else, not inverted PBS. Please advice.
User avatar
jfs
Tycoon
Tycoon
Posts: 1760
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Path signal doesn't allow a train to a free path

Post by jfs »

You should have stopping points (signals) on the passing track too, but in both directions.
popka.enota
Engineer
Engineer
Posts: 6
Joined: 05 Feb 2023 04:58

Re: Path signal doesn't allow a train to a free path

Post by popka.enota »

Thanks for your idea. I was also experimenting with block signals. It made it somewhat better, now train doesn't reserve the entire middle lane. But they still prefer middle over outer tracks. So the block signals do not solve the priority issue.
Image
User avatar
odisseus
Director
Director
Posts: 568
Joined: 01 Nov 2017 21:19

Re: Path signal doesn't allow a train to a free path

Post by odisseus »

AFAIK the train pathfinder doesn't look whether the path is free beyond the first encountered signal. It assumes that all trains are moving, and the sections that are occupied now will be free once the train reaches them. The pathfinder does not make any attempts to overtake a slow-moving train, although I've heard this feature exists in the JGR's patch pack.

Also, the pathfinder tries to select the path that contain the fewest penalties (i.e. sharp turns, backwards signals, or road crossings). This is why your trains consistently prefer the middle track. However, you can take advantage of this behaviour by placing artificial penalties on your middle track.
skc
Traffic Manager
Traffic Manager
Posts: 175
Joined: 17 Sep 2022 02:02

Re: Path signal doesn't allow a train to a free path

Post by skc »

If the approach tracks are aligned with the outside tracks, the pathfinder will prefer to put trains down the outside tracks if everything else is equal.
Eddi
Tycoon
Tycoon
Posts: 8271
Joined: 17 Jan 2007 00:14

Re: Path signal doesn't allow a train to a free path

Post by Eddi »

a 3rd track will probably never work "right", as the pathfinder can not know when a train is "slow" or "broken down".

however, the least thing you need to do is:
  1. put path signals in the middle, not block signals
  2. carefully blance the penalty for passing a reverse path signal with your train length (= number of occupied track penalties). however that may break other parts of your network
  3. possibly reduce the lookahead distance (typically 10 signals)
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 10 guests