Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Train prefers service in depot over station #7901
Version of OpenTTD
Train prefers stop at station rather than going to the depot. And prefers going the right direction rather than going to the depot.
When train is comming into the station and needs to be serviced, it goes to the depot which is behind station and completely ignores the station. This causes big issues when you have only one-way routes.
Steps to reproduce
I think fix can be done in pathfinder and make bigger priority to stop in the station (or go the right direction) rather than servicing.
I assume you are talking about the automatic servicing, i.e. that a train decides it has passed its servicing interval/reliability threshold, and needs to visit a depot. Therefore it automatically searches for a path to the nearest depot. When it reaches that depot and has entered it, the train resumes its regular schedule by going to the station it was on the way to before the automatic servicing.
This is different from manual servicing (clicking the "go to nearest depot" button in the train window) and from scheduled servicing (a depot appearing on the orders list). With manual servicing, you presumably clicked the button because you want the train in a depot as soon as possible and don't want any stops on the way. With scheduled servicing, presumably the schedule is planned so the train won't need to turn back to visit the next station.
Yes, I understand now. I was talking about automatic servicing.
So, as you said,
can be solution. This can also be applied with crossroad.
PBS is Path-Based Signals, so the signal type you are using.
The following here are some general gameplay tips learned from experience with how things have always worked.
In your first example, the signals are placed badly, in a way that will definitely cause problems. With path signals, you should never put signals at the entry to a station, only at the exit from the platform. Instead you should place signals before the junction in front of the station, path signals use track reservations and not blocks, so other trains can pass the junction as soon as the previous has cleared the points the next needs to traverse.
Your second example doesn't have any reliable way of working, it would be very difficult to make the pathfinder able to reason that by taking that depot, the train would be unable to reach its destination again. Having depots on dead end branches, combined with automatic servicing, is generally a recipe for problems.
Some situations can be improved with additional checks in the pathfinder, but many will never be able to get a good solution.