Reply To: [FeatureRequest] Trains automatically selecting free track

Home Forums General Discussion [FeatureRequest] Trains automatically selecting free track Reply To: [FeatureRequest] Trains automatically selecting free track


Train Fever uses a static path-finding algorithm (whereas OpenTTD uses a dynamic pathfinder). This means that once a route is decided on, the pathfinder finds a path and only changes it if the track-layout changes. Introducing a dynamic pathfinder to TF would be quite a big task – especially considering TF has got path-based signalling as well (even OpenTTD did not have path-based signalling for several years – this meant that only one train could be in a signal block at any one time until PBS was introduced, whereas both TF and OpenTTD-post-PBS allow multiple trains in a signal-block as long as the paths do not cross).

However, I’ve had an idea for a compromise – a mostly static-pathfinder with only a bit of dynamicness. Imagine a station with two tracks and an island-platform with one of the tracks on the left side and one of the tracks on the right side. If the first switch for both tracks on either end of the platform was the switch joining the two tracks, then what could happen is that the trains could then choose only at the last minute which platform to go to, so they would always pick a free platform instead of an occupied platform (unless both were occupied). In this case, the pathfinder only needs to make a decision at the switch just before the platform, while keeping the rest of the path static (other stations with a similar layout would also be dynamic). I’m not sure how much more complicated the algorithm would be if other switches occur between the switch joining the two tracks and the platforms, but I do know that if both tracks were one-way (heading the same way), it would make the platform and two tracks more efficient. Also, making sure that all routes that use either of the two tracks have the option of taking both tracks (this will always be the case if the last switch before the platform and the first switch after the platform are the switches joining the two tracks). When this is implemented, the route-colour overlay would show the route splitting at the pre-platform switch and merging again at the post-platform switch. This also has the advantage that this sort of thing is done in the real-world too, and the passengers don’t have to walk to a different platform – they just change the side of the same platform they are already on.