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.

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

Branch
OpenTTD JGR's Patch Pack Not in TTDPatch

A simple branch of a single-tracked station can be built easily using path signals. The important thing is to place the signal at the branch line facing the junction, so that trains reserve a path from the main line into the branch station, and trains going back onto the main line wait in front of the junction. The signal to the left on the main line is a one-way path signal to prevent trains from entering the main line on the wrong track.

Branch
OpenTTD JGR's Patch Pack Not in TTDPatch

For branch lines with passing places there is a trick: Use a path signal in the middle as shown here. A train going from the main line onto the branch line will just ignore it, but trains going the other direction will reserve a path from the passing place to this signal, instead of reserving the whole path from the passing line through the branch on the main line. The effect is simply that the main line is blocked for as short as possible. That is the only reason for the signal being placed there.

Branch
OpenTTD JGR's Patch Pack Not in TTDPatch

The optimal solution concerning blocking times of the main line is the usage of bridges or tunnels instead of crossing the main line. The one-way path signal at the branch entry prevents trains from going onto the main line in the wrong direction. The pathfinder should be clever enough to sort it out without that help, but enforcing the correct behavior is always a good idea.

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

Branch
OpenTTD JGR's Patch Pack Not in TTDPatch

The only thing that needs to be explained about this setup is the one-way path signal to the left. It just prevents trains coming from the branch from going onto the main line on the wrong track. A standard path signal should suffice as well, the pathfinding should be able to puzzle it out correctly, but relying on "it should work" has often led to disaster...

Branch
OpenTTD JGR's Patch Pack Not in TTDPatch

Since path signals are used in the rest of the network, one can use it here just as well. This allows the usage of fewer signals while the functionality stays the same.

The following series of images shows the development of one junction in one of my games. It starts out really simple, but with increasing traffic it had to be adapted and rebuilt and extended several times.

Branch

In the beginning, it was a simple branch on a double-tracked line. At this time, only a few trains were going along here, so that was no problem. However, this changed rather soon as the game progressed.

Most traffic jams happened left of the branch, on the track leading towards the branch section. This was caused by trains coming from the lower right and going to the left, which obviously block the path from the bottom left to the top right. The trains had to wait, this caused traffic jams. In order to solve it, the tracks needed to be changed.

Branch

Goal of the change was the reduction of crossing tracks. This was achieved by using bridges. One could also have built a bridge or a tunnel for the track coming from the lower right, it would have worked the same way.

That improved traffic flow, but as new industries were being served, the number of trains going through the branch junction increased. This finally led to traffic jams again. This time, the problem was simply the number of trains to the left of the junction. All the trains had to go through there, to the right of the branch the load on the lines is roughly halved. In this specific case the traffic was distributed somewhat evenly along the line to the top right and bottom right. So the solution was to increase the line capacity on the left side.

Branch

Increasing capacity was achieved by adding two additional tracks, one per direction. The junction itself was not changed. This improved the situation, traffic jams were reduced.

While it now worked well for trains going to the left, there were again issues with trains coming from the left: All trains have to go across the same junction tiles. So any trains on the outer track heading for the bridge would block trains from the inner track going to the bottom right (or the other way around). Any such train movement blocks the whole crossing, causing trains to wait and resulting in traffic jams.

Branch

The final version of the branch removes the bottleneck by adding another bridge and removing crossing paths. There is no actual path crossing in here anymore, only splits and merges. Trains coming from the left, regardless of the track they are on, can go through the branch area independently and will only merge onto the destination line afterwards. There, the number of trains is only half as big, so that is not much of a problem. In order to handle increased traffic in future, this layout now allows an easy addition of further tracks on the lines to the top right or bottom right, depending on the situation.

Icon
Takeaway: To avoid traffic jams, think of Ghostbusters: Do not cross the streams (of traffic, that is)! ;-)

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-Crossing
OpenTTD JGR's Patch Pack Not in TTDPatch

A T-junction with a single track is simple, just remember to use one-way path signals to enforce the correct choice of tracks. The standard path signal in the middle just serves as a optimization, trains coming from the passing place do not reserve their path through the junction until they have actually arrived there. This just shortens the time the main line is blocked.

T-Crossing
OpenTTD JGR's Patch Pack Not in TTDPatch

If one has not disallowed trains from using 90 degree turns one has to take care not to build them, as that would allow trains to go awkward ways. That is also the reason why this junction was built like this. Regardless of the direction a train comes from, it only has a choice of two directions. The signals are one-way to ensure trains are not going onto the wrong tracks - the pathfinder should work that out itself, but if something can possibly go wrong, it will, so we'd better prevent it.

This solution will only work with little traffic, as soon as the number of trains increases, the different paths through the junction are blocking each other too often, then you need to replaces crossing paths with bridges and tunnels.

T-Crossing
OpenTTD JGR's Patch Pack Not in TTDPatch

On heavily trafficked lines the blocking of the junction will create jams, so bigger solutions with bridges and tunnels are necessary. This solution is a slightly modified half cloverleaf. The track behind the bridge does not go to the right, but to the left. This small change makes the junction follow the "split before merge" rule. It also prevents trains coming from the lower right to return back into that direction.

The paths through the junction should always be long enough to prevent waiting trains from blocking other trains behind them - the solution in the image is built very compact so that everything fits into the image.

T-Crossing
OpenTTD JGR's Patch Pack Not in TTDPatch

Sometimes the main line with most traffic does not go straight, but in a curve. In that case the junction should be built differently, so that traffic on the main line is not forced to go complicated ways with slopes and additional curves.

The following series of images shows the development of one T-junction in one of my games. It starts out really simple, but with increasing traffic it had to be adapted and rebuilt and extended several times.

Junction

In the beginning, it was a simple t-junction on a double-tracked line. At this time, only a few trains were going along here, so that was no problem. However, this changed rather soon as the game progressed.

In the beginning, traffic was evenly distributed, about 2-4 trains from every directions going left and right. Things started to become complicated once I started serving a factory to the right of this junction, which caused lots of traffic for delivering raw materials to go through this junction to the top right. The paths from the bottom left to the top left and in the opposite direction were used by far fewer trains. That of course meant that any blocking of the important connections to and from the top right would cause issues with trains jamming. So this junction had to be improved.

Junction

The main goal of the changes was the removal of crossing paths by using a bridge and a tunnel. Additionally, the line to the top right was extended to have four tracks instead of only two. The line to the top left is reduced to two tracks right outside of the screenshot, the long tracks just help with waiting trains not blocking the important tracks.

This improved traffic flow, however, the number of trains increased once more, as further industries near that factory were served. So the same problems arose, there were traffic jams because of too many trains for too little tracks.

Junction

This extension did not change the junction itself, but the line at the bottom left was extended to four tracks, as there were many trains waiting here. The long signal distances are intended, the trains going there were rather long and when they had to wait, they should not block any crossing tracks.

Now that the line leading to the junction had been extended, the junction itself became the bottleneck, as there was only one track to go from bottom left to top right. The same issue occurred in the opposite direction. As that was the connection with most traffic, something had to be done.

Junction

Now we already see three bridges, so that for the whole connection between bottom left and top right there are two independent tracks. Trains going to or from top left only have one track, but that was enough for the number of trains going that way. It was more critical that a train coming from the bottom left on the inner track would have to block everything while going to the tunnel in order to continue to the top left. As that were only a few trains, that only caused small interruptions, not really traffic jams.

However, there was a huge change in traffic flow as trains transporting goods were introduced, coming from the top right and going to the top left (and back again), which increased traffic on that connection drastically. So, yet another extension of the junction was needed.

Junction

The bridges got longer and the amount of crossing paths were reduced. Now any trains from bottom left and top right had two independent tracks to go to the top left. The connection from the top left to the top right was still limited to one track, but that was somewhat ok, as the trains were empty when going that way, and that meant way better acceleration, so having them waiting was not so much of an issue. Full trains should not wait if avoidable, that costs money - fast transport pays better. Time is money and all that.

Finally there still came the day that also that direction had to be improved as the traffic jams increased and the line at the top left got blocked more often.

Junction

The final version of that junction has now already become quite a mess. For each direction there are two tracks which go through the whole thing without crossing. Getting there required a more or less complete rebuild of the area. One could now discuss whether the connection from bottom left to top right is optimal for the outer track as trains have to go down and up a slope. This could be avoided, but at the time of the game, powerful electric engines had already been available, so that slope was not a problem anymore. I did not show the overhead catenary in the pictures, as it makes figuring out the track connections even more difficult, it is next to impossible behind the bridges anyhow.

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.

Crossing
OpenTTD JGR's Patch Pack Not in TTDPatch

A cross of two double-tracked lines is easily possible without taking too much space. If trains are not allowed to do 90 degree-turns the layout would become even more compact. The signals are always placed in front of the junction are one-way to prevent trains from leaving on the wrong track.

Crossing
OpenTTD JGR's Patch Pack Not in TTDPatch

Having crossing tracks becomes a real problem with heavy traffic. In such cases, the old complex solutions with bridges and tunnels need to be used, where traffic flow is interrupted as little as possible. In addition, the junction should follow the "split before merge" rule. One possible solution is shown in the picture, it might look chaotic, but it is very efficient.

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.