Skip to content
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

train pathfinder acts as if station exits had built-in signals #7941

Open
esigra opened this issue Jan 15, 2020 · 4 comments
Open

train pathfinder acts as if station exits had built-in signals #7941

esigra opened this issue Jan 15, 2020 · 4 comments

Comments

@esigra
Copy link

@esigra esigra commented Jan 15, 2020

After watching OpenTTD trains for many hours I conclude that the most notable pathfinding problem is that when a train has left a station but stopped (due to breakdown or waiting at a signal) with the last car on the tile after the station exit, where a signal is, the next trains sees that the whole station track is free and decides to wait for that particular station track, possibly indefinitely, even though another station track is available. Thus it blocks the whole queue of trains to the station.

This could be fixed in either of the following 2 ways:

  1. The pathfinder only picks a station track for a train when it can reserve the station track AND the track beyond to the next signal.
  2. Station exits are considered to have built-in signals (like depots have). This is the solution that I would prefer (even if someone would decide that then the train length capacity of stations would have to be reduced by 1 car to compensate).
@MingweiSamuel
Copy link
Contributor

@MingweiSamuel MingweiSamuel commented Feb 9, 2020

I'm not sure exactly what you're describing, could you provide a save or image (with path reservations on)?

I wish stations had built in signals (2) but it would be a major change. Currently you can usually get the same behavior by putting two way path signals on the end(s) of your station.

@esigra
Copy link
Author

@esigra esigra commented Feb 9, 2020

waiting_for_free_path
At this station with 2 tracks traffic usually flows fine. If a station track is occupied, the next train takes the other. Problem is only when a train has left a station track but not yet the tile after with the signal, and breaks down there.

@MingweiSamuel
Copy link
Contributor

@MingweiSamuel MingweiSamuel commented Feb 12, 2020

I personally have run into situations like this where trains get stuck deciding at PBS. I don't know if the devs would consider it a bug though. It may be possible to fix/improve based on some yapf settings.

For this situation specifically you can fix it by using block signals at the entrance instead of PBS

@Eddi-z
Copy link
Contributor

@Eddi-z Eddi-z commented Feb 12, 2020

the problem here is that pathfinding and path reserving happens in two separate phases:

  1. the pathfinding adds up penalties until the destination station is reached, and then picks the platform with the lowest penalty
  2. the path reserving reserves up to that destination platform, and then a little bit further until the next safe waiting point (signal or end of track), however, this additional bit of track was not part of the pathfinder penalties earlier, so there were no penalties added for if these tiles are blocked
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.