Train path finding to station

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
Big Broter
Engineer
Engineer
Posts: 4
Joined: 09 Jan 2024 14:31

Train path finding to station

Post by Big Broter »

Hello,
I built a long station for trains of the length 2. I use path signals everywhere but the trains can't find the 4th and 5th set of stations. They are all one station, so that's not the problem. The direction is from bottom to top on the picture. Blue is station, green tunnels and the down rail. Red is normal rail.
As said, the trains don't reach further than the 3rd set of stations. Is there something to change with the AI? Less signal or is it just not possible?Image
Attachments
IMG_20240109_153348.jpg
(4.93 MiB) Not downloaded yet
User avatar
kamnet
Moderator
Moderator
Posts: 8591
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Train path finding to station

Post by kamnet »

A copy of your save game would be more helpful when trying to diagnose these issues.
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: Train path finding to station

Post by Eddi »

try to increase this (hidden) setting on the console:

Code: Select all

yapf.rail_pbs_station_penalty
default value is 800 (try doubling that)

it means "try 8 tiles of detour around an occupied platform [tile]". as your station is very long, but your platforms are very short, the accumulated distance penalty for the last platforms might exceed that, so the trains decide it's rather worth waiting for the occupied platform to free up.

warning that messing with pathfinder penalties may result in weird behaviour in other areas of the map, which may be spotted only much later
User avatar
odisseus
Director
Director
Posts: 568
Joined: 01 Nov 2017 21:19

Re: Train path finding to station

Post by odisseus »

This problem can be solved without tweaking the pathfinder. However, you'll have to use pre-signals and perhaps change the station layout a little bit.

You need to place a two-way exit signal at the entrance of each individual platform, and a one-way block signal at the entrance of each platform block. With the two-way end of line setting (which is enabled by default since version 13.0), this will cause the train to skip the taken platform and head on to the next platform or block.

If there are no free platforms at all, the train will pass through the entire station and emerge at the top end without ever stopping. However, with 25 platforms this situation is rather unlikely. You can also add a loop back to the station entrance to give such trains a second chance.
Dronnbridge Transport, 1961-01-23-fs8.png
Dronnbridge Transport, 1961-01-23-fs8.png (19.17 KiB) Viewed 993 times
Big Broter
Engineer
Engineer
Posts: 4
Joined: 09 Jan 2024 14:31

Re: Train path finding to station

Post by Big Broter »

Eddi wrote: 10 Jan 2024 02:51 try to increase this (hidden) setting on the console:

Code: Select all

yapf.rail_pbs_station_penalty
default value is 800 (try doubling that)

it means "try 8 tiles of detour around an occupied platform [tile]". as your station is very long, but your platforms are very short, the accumulated distance penalty for the last platforms might exceed that, so the trains decide it's rather worth waiting for the occupied platform to free up.

warning that messing with pathfinder penalties may result in weird behaviour in other areas of the map, which may be spotted only much later
Thank you very much. Hopefully it won't cause problems
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 13 guests