Train waiting for free path when there is one

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

Post Reply
odalman
Engineer
Engineer
Posts: 37
Joined: 07 Jan 2020 01:46

Train waiting for free path when there is one

Post by odalman »

I watched this station for a long time and it seemd to work. Trains would enter the free track at the station. Until a train breaks down when the last car just left the platform. Then the next train stops and waits. I assume that if the last car had still been on the platform, the next train would just have continued onto the free track. Can this be fixed with by changing tracks/signals/orders or only by changing the game logic?
Image
Attachments
waiting_for_free_path.png
(183.25 KiB) Not downloaded yet
User avatar
kamnet
Moderator
Moderator
Posts: 8586
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Train waiting for free path when there is one

Post by kamnet »

Without a save game available, I'm going to guess that what's happened is that Train 13's logic has it going ahead to the platform without turning (and incurring a pathfinding penalty). Train 12 had the misfortune of breaking down, and while it has cleared the station tiles, the last car is still on the tile with the signal, so it's not safe for Train 13 to proceed.
odalman
Engineer
Engineer
Posts: 37
Joined: 07 Jan 2020 01:46

Re: Train waiting for free path when there is one

Post by odalman »

I can send a savegame if someone wants it as a test case.
User avatar
This is my name
Director
Director
Posts: 515
Joined: 17 Sep 2008 01:36
Location: SOMEWHERE IN LINGGI
Contact:

Re: Train waiting for free path when there is one

Post by This is my name »

You will have to use path based signalling, not block signals or pre-signals.
Attachments
waiting_for_free_path.png
(348.87 KiB) Not downloaded yet
usecubes.com 3-D Pixel Design Software
User avatar
jfs
Tycoon
Tycoon
Posts: 1761
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Train waiting for free path when there is one

Post by jfs »

This is my name wrote: 11 Jan 2020 03:17 You will have to use path based signalling, not block signals or pre-signals.
No that one you marked is in fact a 1-way path signal.
Attached screenshot has OpenGFX block exit signal on the left, and one-way path signal on the right. The right hand one matches odalman's screenshot.
Attachments
openttd_2020-01-11_10-32-47.png
openttd_2020-01-11_10-32-47.png (7.76 KiB) Viewed 3280 times
Transportman
Tycoon
Tycoon
Posts: 2781
Joined: 22 Feb 2011 18:34

Re: Train waiting for free path when there is one

Post by Transportman »

The pathfinder only looks to the current order, not what is going on after it. So in your current situation, it sees a cheap path to the station straight ahead (as the train has left the station it is not adding to the penalty) and a more expensive path by taking the corner.

One way to fix this is by using this setting and rework the station to have two way exit signals before the station entrance and an entry signal before the junction. Then a train not clearing the signal after the station will keep the platform blocked (as the exit signal to the platform is red and the setting will make the pathfinder considering that red signal as unpassable).
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
odalman
Engineer
Engineer
Posts: 37
Joined: 07 Jan 2020 01:46

Re: Train waiting for free path when there is one

Post by odalman »

Transportman wrote: 11 Jan 2020 11:04 The pathfinder only looks to the current order, not what is going on after it. So in your current situation, it sees a cheap path to the station straight ahead (as the train has left the station it is not adding to the penalty) and a more expensive path by taking the corner.
Just to clarify. It is one station with two tracks. That station is the current order. It seems clear that it is more expensive to stop and wait than taking the corner.
LaChupacabra
Route Supervisor
Route Supervisor
Posts: 389
Joined: 08 Nov 2019 23:54

Re: Train waiting for free path when there is one

Post by LaChupacabra »

Without the save, it's hard to state it clearly, but it seems to me that the train just suddenly felt pee and wanted to go to the nearest toilet.;)
That is why I forbid my trains to go there voluntarily more often than every 800 days.

If not, then probably the best solution would be to use presignals. They are also very useful when the station is very large and has more than 5-6 platforms, or when there are very fast trains on the routes (especial Vactrains). Pathsignals sometimes do not keep up with them and quite often block the movement. Presignals don't have this problem.
presignals.PNG
presignals.PNG (411.5 KiB) Viewed 3227 times
I am sorry for may English. I know is bed.
Transportman
Tycoon
Tycoon
Posts: 2781
Joined: 22 Feb 2011 18:34

Re: Train waiting for free path when there is one

Post by Transportman »

odalman wrote: 11 Jan 2020 15:06
Transportman wrote: 11 Jan 2020 11:04 The pathfinder only looks to the current order, not what is going on after it. So in your current situation, it sees a cheap path to the station straight ahead (as the train has left the station it is not adding to the penalty) and a more expensive path by taking the corner.
Just to clarify. It is one station with two tracks. That station is the current order. It seems clear that it is more expensive to stop and wait than taking the corner.
I meant platform in my post.

But from a pathfinder point of view, taking a corner has a higher penalty. The pathfinder does not consider what the situation is after the current order, it only looks to fulfil the current order. So that train that is stopped after the platform? The pathfinder doesn't care about it, as it stopped calculating the penalty for the path once it traversed the entire platform to calculate the penalty and the stopped train is not part of it. Would it have stopped partially on the platform, it would have counted and the pathfinder might have send the train to the other platform (or not).

Sometimes you need to help the pathfinder a bit, that was the other part of my post.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
odalman
Engineer
Engineer
Posts: 37
Joined: 07 Jan 2020 01:46

Re: Train waiting for free path when there is one

Post by odalman »

Transportman wrote: 11 Jan 2020 17:32 Would it have stopped partially on the platform, it would have counted and the pathfinder might have send the train to the other platform (or not).
Yes, it would. Like I wrote first, I watched the station for a long time.

The easiest solutuion seems to be if station exits had built-in signals like depots.
mak
Traffic Manager
Traffic Manager
Posts: 205
Joined: 30 Sep 2015 13:16

Re: Train waiting for free path when there is one

Post by mak »

[/quote]
Yes, it would. Like I wrote first, I watched the station for a long time.

The easiest solutuion seems to be if station exits had built-in signals like depots.
[/quote]

Just put 'path signals' at each end facing the platform, ensure there is enough track, before the next signal, to accomodate the train when it leaves the platform.
odalman
Engineer
Engineer
Posts: 37
Joined: 07 Jan 2020 01:46

Re: Train waiting for free path when there is one

Post by odalman »

There is a path signal on the tile after the station track. The problem is that when the pathfinder decides to chose that particular station track, it only checks that the station track is clear, not the track beyond to the next signal (including the tile that the signal is on). So if stations had built-in signals at exits, it would match what the pathfinder actually checks for.

There is no issue with space for the train after the signal. The track leads into a depot with infinte space. The issue is when the train breaks down at that particular place. If the train had broken down a little earlier it would still be on the station track and the pathfinder would have sent the next train to the other track. If the train had broken down a little later it would have passed the signal and the next train could enter the track it prefers.
Transportman
Tycoon
Tycoon
Posts: 2781
Joined: 22 Feb 2011 18:34

Re: Train waiting for free path when there is one

Post by Transportman »

odalman wrote: 11 Jan 2020 21:11 There is a path signal on the tile after the station track. The problem is that when the pathfinder decides to chose that particular station track, it only checks that the station track is clear, not the track beyond to the next signal (including the tile that the signal is on). So if stations had built-in signals at exits, it would match what the pathfinder actually checks for.
That wouldn't solve your problem. Even a partially blocked platform can have a lower penalty for the pathfinder than the completely empty platform because switching directions also has a penalty. So if train 12 broke down one tile earlier (and still in the station), it might still result in train 13 waiting at its current location. That is just how the pathfinder works, everything has a penalty and it sees the lowest penalty as the "correct" path even if it might never become available and there is a perfectly other valid path next to it.

I already gave a solution earlier in this topic, but that would require a small redesign of your station entry:
Transportman wrote: 11 Jan 2020 11:04 One way to fix this is by using this setting and rework the station to have two way exit signals before the station entrance and an entry signal before the junction. Then a train not clearing the signal after the station will keep the platform blocked (as the exit signal to the platform is red and the setting will make the pathfinder considering that red signal as unpassable).
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: No registered users and 7 guests