Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

Deadlocks caused by drive by sight

Started by Sirius, July 08, 2020, 08:30:27 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Hey there.
There seems to be a design issue with drive by sight.
A simple junction can deadlock if there is any diagonal involved. Only cardinal 90° junctions are safe from deadlocking.

Would it be possible to reservate all adjacent junctions along a route as one in drive by sight?

Special consideration might be required in case the whole set of junctions cannot be sighted before actually entering the first junction tile.
We might
a) simply ignore sighting distance in that special case or
b) try to reservate the whole junction as soon as it is completely in sight; Reservate the parts that are in sight if the whole junction cannot be seen from one tile before that junction.

It would be very nice to also include stations into this atomic drive by sight "block", to allow safe reversal at dead-end station in drive by sight, which is common practice in real-world tram networks.
That means, when a platform starts immediately adjacent to a junction, ensure that trains will only enter that junction if the platform behind it is clear either.



Can you clarify what you mean by "adjacent junctions" here? I am not sure that I entirely understand this in the context of a linear reservation.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.


When you have one junction and there is another one on a neighboring tile, that means (x,y) being a junction and (x+1,y) being a junction, those are adjacent to each other.

So, if (0,0), (0,1) and (0,2) are junctions and a train travels along (0,0)->(0,1)->(1,1), it will reserve (0,0) and (0,1) as a block.
That means, if it cannot reserve both, it won't reserve any of these, i.e. it will stop in front of the junction.

As pointed out above, considerations need to be taken in cases where the whole junction block is not in sight. We could either ignore sighting distance in that case, or create such reservations only up to the point we can see.

That behavior would solve the most troublesome deadlocking in drive by sight, where a very simple junction tat nobody would expect to ever cause a deadlock can deadlock (and in practice does)
Deadlocking issues related to terminus stations will persist.