New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Pathfinder prefers occupied plain track over free station track #9609
Comments
Can you provide a savegame exhibiting this behaviour? |
Here's my reproduction attempt: |
Wondering if #9554 could have a similar cause. |
The relevant pathfinder penalties are: (default values)
So, currently it will prefer waiting for the reverse-pbs signal, if the station platforms are longer than 1 tile. I think the problem here is the station penalty:
So, I think there should be two different station penalties:
|
Tried the save game with NPF, trains don't use middle track with it. |
To follow on from earlier comments, there are two further YAPF penalties which need to be considered for this type of layout: rail_pbs_cross_penalty is the per-tile penalty for a reserved non-station tile. rail_pbs_station_penalty is the per-tile for a reserved station tile. As station platforms are always reserved either not at all or in their entirety, the total penalty is proportional to the platform length, and is predictable. The problem here is that the cumulative rail_pbs_cross_penalty cost of the occupied centre track is too small to make the centre path more expensive than going via the platform. I happen to use a similar layout frequently in my own games, except that going via the platforms is the normal path, and the centre track is only used for bypassing trains when the platform is occupied. To make this work the cost of the centre track is artificially made more expensive than the cost via the platform but less expensive than the cost via the platform when occupied.
The trouble with this is that it makes the track cost a function of the instantaneous state of the vehicle which is problematic for the segment cost caching which is used outside of the signal look-ahead distance. |
I don't quite see the problem with this. By the time you arrive at the station from outside the lookahead distance, the situation probably changed anyway. |
#10804 Should fix this. The impatience value would rise until a train takes a route through a station. |
I just bumped into similar (same) issue - on a high-throughput loading bay trains sometimes stop while there are still empty tracks available. If it is the same, then it is happening with long (7-tile) trains. I haven't looked at implementation but hope that the fix will address long trains as well. (have a save at exactly this moment as well) |
Version of OpenTTD
1.11.2, Windows 10
Expected result
Train picks the path through the station
Actual result
Train always picks the passing track, and if there is already another train in the passing track, it does not pick the other track through the station. Depending on the situation this can result in both trains to become stuck forever.
Steps to reproduce
The text was updated successfully, but these errors were encountered: