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

Pathfinder doesn't consider blocked tiles past destination station #7941

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

Pathfinder doesn't consider blocked tiles past destination station #7941

esigra opened this issue Jan 15, 2020 · 5 comments
Labels
bug Something isn't working component: pathfinder This issue is related to Pathfinder

Comments

@esigra
Copy link

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

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 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

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 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

@2TallTyler 2TallTyler added component: pathfinder This issue is related to Pathfinder enhancement Issue would be a good enhancement; we accept Pull Requests! labels Oct 19, 2022
@2TallTyler 2TallTyler changed the title train pathfinder acts as if station exits had built-in signals Pathfinder doesn't consider blocked tiles past destination station Nov 28, 2023
@2TallTyler
Copy link
Member

This bug was also reported, with another example savegame and explanation, as #11506.

@2TallTyler 2TallTyler added bug Something isn't working and removed enhancement Issue would be a good enhancement; we accept Pull Requests! labels Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component: pathfinder This issue is related to Pathfinder
Projects
None yet
Development

No branches or pull requests

4 participants