The flexibility of a network is the result of the ability to share lines and to add junctions and line crossings at appropriate places. Thus, one can easily connect lines, add access to industries or branch lines. In some ways, one can compare the double tracked network with a highway network: There are dedicated tracks per direction, there are junctions and connections and so on.

Icon
The layouts shown here are built in a compact way to make them fit onto the screenshots. If there is enough room, it is a good idea to build junctions a bit bigger in order to allow long trains to wait at branches without blocking the rest of the traffic.

Characteristics

Some characteristics of a good junctions are easy to understand:

  • short tunnels or bridges for minimized signal distances
  • simplicity, only built tracks and connections that are actually necessary
  • as little height changes and turns as possible, especially for the tracks with most traffic

One word about simplicity: Many people tend to build their network junctions on a very large scale, with bridges and tunnels and connections into every direction. This is both unrealistic and space-wasting. Plan your junctions before you start building. Check whether you really need to connect all directions with each other. This reduces the number of possible ways for the trains and decreases the probability that they choose the wrong way. On the other hand, plan the layout in such a way that it can be extended later in the game, when a certain additional connection becomes necessary.

Another feature which is very important for the pathfinding and the network can only be explained in difficult words:

  • Trains cannot get into a "deadlock" (blocking each other, so that the player has to manually solve the blocking).

"Deadlock"

Deadlock

This is an example of a deadlock. The trains block each other, the player has to interfere to solve the blocking. With signals or junctions built incorrectly it might easily possible to run into such troubles. The tricky thing about that is that it might not be easily visible. In the beginning it all works well, but with an increasing number of trains problems suddenly arise. And most likely you will only spot them when trains do not earn money or the game warns you that trains got lost.

So how does one prevent that from happening? Without going too deep into the theories, one can safely say that building junctions according to the "Split before merge"-pattern prevents such deadlocks.

Icon

Split before merge

No matter on which path a train crosses a junction, the lines always split up first for the different directions before tracks join in coming from other lines. A track never merges before another branch.

Deadlock

Here the splits are marked yellow, merges are marked red. As can be seen there are several ways through the junction (for example just going straight through), where splits and merges are encountered in the wrong order. The white line marks a loop inside the junction. This means trains cannot only turn around by 180 degrees and go back to where they came from, but they could possibly loop around endlessly. So you hopefully understand now that this layout is quite horrible.

Pathfinder Woes

The pathfinding in TTDX resp. TTDPatch is rather simple and limited. Especially when using path-based signalling at branches and crossings one might encounter problems with trains going into a direction they should never go, just because the correct direction is blocked by another train at that moment. This can always happen as long as the pathfinding is able to find another path within the limit of 64 tiles. However, a train leaving the correct route is a potential risk, so this should prevented in any way.

Falscher Pfad

Here you can see the train on the left taking the wrong path and going into the wrong direction. The correct destination, waypoint WP NE is to the upper right, but since the track is currently blocked the train goes towards waypoint WP SE. In the worst case it will get lost there.

Falscher Pfad

The solution here is to use routing restrictions. The signals behind the crossing are limited so that only trains which are going towards the corresponding waypoint should go there. So for any oncoming train, all other exits of the junction are treated by the pathfinder as a dead end. The train only "sees" the correct way and waits until it can reserve a path there.

The disadvantage here is that the waypoints have to be added to every schedule. Trains currently looking for a depot instead of heading for the waypoint might also cause troubles. Still, this can be solved using goto depot-orders.

Branches

The simplest kind of junction is the branching of a line. Two lines split up into two in the form of a Y. This is not to be confused with a T-junction, which is discussed further down.

Single-tracked branches

Abzweig
TTDPatch Not in OpenTTD

A simple branch towards a single-tracked station can be built this way. Trains leave the main line towards the station and can go back the way the came from. This is usually the case for industrial stations. The station can of course be further away from the main line, but the two-way signal should be placed at the beginning of the branch line. That makes the junction area as small as possible and decreases the time in which a train from the branch line can block traffic on the main line. Instead of using a two-way path signal one could also use through signals, so that trains can reserve a way right into the branch station.

Abzweig
TTDPatch Not in OpenTTD

In case the branch line has passing places, one should use through signals at the branch. This prevents trains going towards the main line from reserving a path through the branch when leaving the passing place (that would block the main line for quite some time). So, the train only reserves a path towards the through signal and once it gets there the path through the branch itself. Of course, as long as the train waits at the through signal, no other train can enter the branch line.

Abzweig
TTDPatch Not in OpenTTD

If you really want to prevent the main line being blocked by trains from the branch track, you will have to build more elaborate solutions using bridges or tunnels. One possibility is shown in this image. The path signal at the slope onto the branch line triggers correct reservation of the branch line, no matter if there is a passing place or station at the other end.

Icon
A solution with tunnels or bridges might be the best concerning the blocking times for the main line, on the other hand trains going onto the branch line have to climb a hill. For heavy freight trains this might be quite a huge penalty. This should be taken into account when creating a junction or branch layout.

Double-tracked branch

Abzweig
TTDPatch Not in OpenTTD

A branch of a double-tracked line is quite simple, the single-lined branch is just enhanced by a second track. The path signals regulate traffic in the correct way and solve the problems that block signals would create here. This layout is much smaller and easier than the complex junctions which were necessary before the advent of path-based signalling.

Abzweig
TTDPatch OpenTTD

For lines with heavy traffic, the blocking of the lines becomes increasingly problematic. Depending on the trains and their power it can be helpful to replace the crossing with tunnels or bridges. In this case, one could even get away without using path signals.

T-junction

A T-junction is an extended branch where the branch can be accessed from both directions of the main line and trains coming from the branch line can go in either direction onto the main line. The main difficulty here is to avoid layouts where a train can suddenly turn around to leave in the direction it came from.

T-Kreuzung
TTDPatch Not in OpenTTD

A simple T-junction can be developed from the branch just by adding the tracks so that both directions of the main line are connected to the branch line. Signalling stays the same.

Remark: It might happen that trains go the wrong way here because of pathfinder issues, when the correct way is blocked. In that case, one can use restricted routing and waypoints to solve the problem.

T-Kreuzung
TTDPatch Not in OpenTTD

A T-junction with a double-tracked line is a bit more difficult to create. The main problem is to avoid track connections that would allow trains to turn by 180 degrees. That is why this solution looks a bit unordered at first, but it prevents just that behaviour. Trains can only leave the junction in two directions, regardless of where they come from.

The waypoints and the restricted signalling is explained in the section about the pathfinding trouble.

T-Kreuzung
TTDPatch Not in OpenTTD

A T-junction with path-based signalling becomes problematic for lines with heavy traffic. In such cases, the old big solutions with bridges and tunnels are still optimal. Still, turning around by 180 degrees is prevented, that is why the track behind the bridge is curved towards the left and not to the right. This ensures the junction follows the "split before merge" rule. One could also build this layout using path-based signals, but then one would also have to make sure to restrict pathfinding to avoid trains going onto the wrong branch.

T-Kreuzung
TTDPatch Not in OpenTTD

In cases where most trains come from the right and go towards the lower right, it is impractical to lead them through tight curves and across a bridge. In this example, the connection from the upper right to the lower right and vice versa is the main line, branches towards the left use bridges and tunnels. Again, this junction can be built using PBS, risking routing problems which need to be solved using routing restrictions.

Crossings

Crossings of multi-tracked lines are finally the most complex layouts possible. However, the hilariously big junctions which need the space of several screens are usually hopelessly oversized. In most cases, not all connections are actually needed. When playing realistically, one only builds the tracks that are necessary.

Kreuzung
TTDPatch Not in OpenTTD

A rather simple solution for medium traffic is the simple cross with additional connection tracks. These tracks are built so that no turning around is possible, trains can only go straight or turn left and right.

The waypoints and additional signals with routing restrictions in front of the waypoints are necessary to solve the pathfinding problems.

Kreuzung
TTDPatch Not in OpenTTD

If the crossing lines need to be separated, quite a lot of terraforming will be necessary. This example might look quite messy, but it strictly follows the "split before merge" rule and does not allow trains to turn around into the direction it came from. The example does not use path-based signals, that is why so many signals were placed. When using path-based signals, one should build waypoints behind the junction and restrict the pathfinder for the branch lines so that trains will always travel on the correct tracks.

Icon
If most trains change direction (for example from the lower right to the lower left), this junction is anything but perfect: These trains have to go through lots of curves and climb slopes. Usually, one knows which paths through the junction will see most traffic, so one should optimize it in such a way that these paths have as little curves and slopes as possible.