How to guide: Train signaling done right

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
Frightning
Filter Inserter
Filter Inserter
Posts: 807
Joined: Fri Apr 29, 2016 5:27 pm
Contact:

How to guide: Train signaling done right

Post by Frightning »

This guide will explain how rail signals work, and how to use that knowledge to get your trains to be able to do what you want and as efficiently as possible.

What do rail signals do?

Rail signals are used to define blocks. Specifically, a block is actually the collection of connected and/or overlapping rail segments which are cordoned off by a group of rail signals. Hence the rail signals actually define the boundaries of blocks. A train moving along a rail line will attempt to reserve the next block in its intended path the moment the signal preceding that block is exactly as far away as the trains current stopping distance. If it succeeds in doing so, the signal will become yellow indicating that the block that it precedes is now reserved and cannot be reserved by another train (and hence that other train cannot enter that block). If it fails to reserve that block (usually because it is either already occupied by another train or already reserved by another train), then the train will begin slowing to a stop until it either succeeds at reserving that block, eventually stopping at the signal that precedes the given block if it hasn't yet succeeded in reserving that block. Once a train enters the block, the signal(s) preceding it will turn red indicating that the block is occupied and cannot be reserved by another train.

So what does this actually look like in game?
1-way block.jpg
1-way block.jpg (564.32 KiB) Viewed 15213 times
The red line denote the boundaries of the block pictured, as defined by the signals. The purple arrow indicates in what direction trains may move through this block. Note that it is a 1-way block, trains can only enter it from the south and exit from the north. In general, if you want a train to be able to head in a particular direction through a desired block, than you need to make sure that there are signals on the right at both ends of that block relative to the desired direction of travel (in short: always signal to the right of the train; this is the same as train station placement). The bottom signal in the picture will indicate the status of the block marked in red, whereas the top signal will indicate the status of the next block in the train's direction of travel.

The preceding has hinted that it is possible to signal rail so that trains may travel in both directions. Rail signaled in that way is called 2-way rail, whereas rail signaled as above is 1-way rail. In order to allow a train to enter a block at a given signal location, there must be a signal on that train's right at that location, conversely, in order for a train to be able to exit. In a 2-way block, a train needs to be able to enter and exit from the block at either end, hence there needs to be a signal on both sides, as pictured below.
2-way block.jpg
2-way block.jpg (575.43 KiB) Viewed 15213 times
With a little thought, one may be able to recognize a potential problem with the above situation: what happens if there is a train in the block north of the red block, heading south and another train in the block south of the red block, heading north? At some point, one of those trains will be the first to attempt to reserve the red block, and will eventually get to enter it, however the 2nd train is still occupying the next block, so that train can go no further until that changes. Meanwhile the other train can't reserve the red block and hence will slow to a stop at the entrance signal. The two trains will end up both stopping face-to-face, unable to get past each other. The solution to this predicament is to use chain signals. Before discussing chain signals however, there is one last detail about blocks that is important enough to show in a picture.

Note that in my description of what a block was, I said that a block could contain overlapping rail segments. As a result, in this crossing...
crossing block.jpg
crossing block.jpg (575.82 KiB) Viewed 15213 times
...the four signals define a single block, not two blocks, which I have enclosed with a red square. Note that the west and south signals are chain signals, which serve the same block defining function as regular signals, but behave differently with respect to how trains reserve the block for which that given chain signal allows entry.

So how do chain signals work, then?

Chain signals work exactly like regular signals in that they perform the identical block defining functions, however where they differ is in what must be true for a train to succeed in reserving the block that they precede. In order for a train to succeed in reserving a block preceded with a chain, not only does the block itself have to be unoccupied and not already reserved, but so does the next block in the train's intended path. The point is that this prevents the train for entering that block unless it can also exit that block. Moreover, a block preceded by a chain signal is considered occupied by that chain signal if the block after it is considered occupied, hence chain signals make good on the word 'chain' in their name, if you have two blocks in a row preceded by chain signals (hence the first block's exit signal is the 2nd chain signal) and the latter block has a regular signal at its exit, then a train cannot pass the 1st chain signal unless the block that the regular signal precedes is unoccupied and not reserved. In the event that all chain signal conditions are met and train is permitted to pass, it will reserve every block along it's desired path up to and including the block preceded by the first regular signal on that path. Chain signals have a fourth indicator color: blue. A blue indicator can only appear if the block that the chain signal precedes has more than one exit path from the entrance that the given chain signal defines. A blue indicator appears when the statuses of the exits are not all the same. A train approaching a blue chain signal will check the status of its desired path and will be able to pass that signal if and only if the signals on that path would be green or blue all the way to the next regular signal on it. In this case, it will reserve all relevant blocks on that path.

We return to the crossing pictured above...
Crossing signaled.jpg
Crossing signaled.jpg (575.74 KiB) Viewed 15213 times
In this crossing, trains approach from the west or south, and will exit to the east or north respectively. Due to the chain signals to the west and south, a train may not enter the crossing unless it can exit out the other side. Now suppose the block north of the crossing was occupied, and a 2nd train approaches from the south. The 2nd train will not be permitted to enter the crossing because of the southern chain signal, which can see that the block north of the crossing (the only exit path) is occupied and thus denies entry to the 2nd train. Now suppose a 3rd train approaches from the east. Because it is impossible to path from the west chain signal to the north regular signal within the crossing block, the west chain signal does not see the status of the north regular signal, and so long as the block east of the crossing is available, it will allow the eastbound train to enter the crossing (and thus exit to the east). This is one of the benefits of proper chain signal usage: Cross-traffic will never be blocked by a backup on the other rail line.

So how do you figure out how to signal a crossing, merge/split, or junction properly?

It can, at first, appear to be a daunting task to signal a complex rail network so that it will even function, let alone optimally. However, there are a number of techniques that greatly simplify this task. We illustrate them, by example:

1-way merge

Suppose you have two 1-way rail lines that you would like to combine into one at a given location with a junction such as the one pictured below.
1-way merge.jpg
1-way merge.jpg (578.17 KiB) Viewed 15213 times
Here, the purple arrows indicate desired traffic directions (we will use colored arrows in this manner for the remainder of this post). The most basic principle of signalling railways is that you should cordon off junctions from the rest of the network. This is for two reasons: Trains in the junctions don't immediately impact trains that aren't, and more importantly, junctions (including crossings) are the only places where otherwise separate rails interact (there are however reasons to put a few regular signals on long stretches of rail even if it has no junctions in order to allow multiple trains to be travelling on it at the same time; the minimum distance between signals on straight, junction-free rail should be the minimum braking distance at that point in the route among all trains that traverse that section of rail). There is generally no reason not to put the signals as close to the junction as you can, so long as they aren't actually in the junction (which can cause problems; you can tell by which pieces of rail are highlighted when going to place the signal, or subsequently by mousing over the signal). A good rule of thumb (especially for complicated junctions) is to put chain signals before the junction and regular signals after it, but there are exceptions, and the present 1-way merge is such an exception. The reason is that there is only one exit, every entrance leads only to that exit and there are no crossings in the junction. Hence if traffic backs up into the merge, it doesn't matter if the junction itself becomes blocked or not: nothing's getting through until the exit gets unplugged. As a result the ideal way to signal this junction is...
1-way merge signaled.jpg
1-way merge signaled.jpg (207.81 KiB) Viewed 15213 times
The three regular signals cordon off the junction into a single block. Because it only has one exit, there is no issue for letting trains into the junction when they are not assured an exit from it. A 1-way split can be signalled analogous (no chain signals needed) for analogous reasoning.

In 2-way systems, merges and splits are in fact one and same because a merge for traffic heading one direction is a split for traffic heading the opposite direction, however, in the two way case, chain signals are needed because of the possibility of traffic heading in opposite directions meeting at the split/merge. In fact, in 2-way rail systems, it is important to ensure that the entirety of a 2-way section of rail cannot be entered unless the given train can also exit it successfully. This means have a chain signal before any turnoff leading into the stretch of rail at both ends of it. This also shows why 2-way systems can have poor throughput, but there is a solution (used in the real world for 2-way rail lines), which is to have periodic sidings next to the main line which let traffic heading in either direction get out of the way of oncoming traffic long enough for that traffic to get by. 2-way systems have advantages in cost and reduced complexity though, hence they can be very useful for sections of rail not needing high throughput. This begs the question if 1-way rail can be merged, or split from, 2-way rail...and the answer is: yes.

Teardrop

A more common version of split/merge involving 2-way and 1-way traffic occurs at end-of-the-line stations, such as the one pictured below.
Teardrop.jpg
Teardrop.jpg (612.09 KiB) Viewed 15213 times
The signalling here has quite a few subtleties, if only one train ever serves this outpost, and then none of the signals pictured are needed, but if more than one does, then every signal placed here is needed, however, some of the signals need or need not be chain signals depending on certain conditions about the number of trains serving this outpost as well as whether or not the 2-way exit block is connected to only 1-way rail lines or not.
The signal circled in yellow is necessary if 2 or more trains serve that outpost so that the incoming train can actually clear the junction, and thus let the outbound train leave.
The signal circled in grey need not be chain if the exit block is connected to only 1-way rail.
The signal circled in green needs to be chain if the exit block is not connected only to 1-way rail.
The signal circled in red needs to be chain if 2 or more trains serve the outpost in order to prevent the leaving train from possibly blocking the junction from an inbound train (creating a 2-way rail face-to-face deadlock).

T-junction
At the other end of the 2-way parts of mixed rail systems, one often has T-junctions such as this...
T-junction.jpg
T-junction.jpg (215.01 KiB) Viewed 15213 times
...which serves as both split and merge for the 2-way N-S line into the eastbound 1-way main line. If the 2-way exit block is not connected to only 1-way rail at the other end, then the regular signal at its entrance needs to be made chain instead (to prevent 2-way 'face-off' deadlocks). Otherwise, the signalling shown is optimal since no train can enter the junction without an assured exit, no matter it's choice of exit or which entrance it is entering from. This is achieved by the chain signals preceding the junction and regular signals following it (with aforementioned caveat).

Complex junctions
All of the above junctions are fairly simple, but, especially in large rail networks, larger more complicated junctions are often required, and it also becomes much more important to try and maximize the throughput of your junctions so that they don't become unnecessary bottlenecks for your trains. Often, just signaling the entrances with chain signals and the exits with regular signals, while functional, is not optimal. The essential problem is that the entire junction is being made into a single block, even if there are situations where two trains which wish to enter that junction would take paths that do not overlap, and hence there is no reason not to allow both of them to be in the junction at once. Thus the goal is to strategically divide the junction into smaller blocks so that, for every situation where two (or more) trains could have non-overlapping paths through the junction, each of those paths are the only path in the blocks that path used. That way, the trains can take their desired paths at the same time because they are never attempting to enter the same block as another train. These intra-junction signals need to be chain signals so that an incoming train reserves its entire path through the junction (otherwise you can have trains getting stuck in the junction and causing deadlocks). The one exception to this is when there is an isolated path within the junction longer than the longest train that would use it. Then it is safe because the long isolated track effectively becomes a waiting bay inside the junction allowing the train to complete its journey in stages without becoming an obstruction to other trains.

1-way Loop
As a first example, we examine the widely used 1-way loop.
Loop.jpg
Loop.jpg (620.16 KiB) Viewed 15213 times
If all 4 entrances were given chain signals and all 4 exits were given regular signals, then this junction would function and would never cause a deadlock on it's own (could still have a deadlock because of having too many trains in network), however, if you had an eastbound train and a westbound train arriving at about the same time, one of them would have to stop for the other because the entire junction is one block. In this case, what is needed is to separate the top and bottom half of this junction into two blocks. But then, by symmetry with north-south situation, you also need to divide it left from right. Another way to see this is consider a train taking a 90 degree left turn, and another heading in the opposite direction (making a 90 degree right turn). In that case, the quadrant with the 90 degree right turn should be separated from the rest of the 270 degrees of the circle, and thus again by symmetry, you obtain the necessity of dividing the junction into quadrants. Thus the optimal signalling for the picture junction is...
Loop signaled with blocks.jpg
Loop signaled with blocks.jpg (624.75 KiB) Viewed 15213 times
#3 Continued on next post
Because can't upload more than 10 attachments.... :evil:

Frightning
Filter Inserter
Filter Inserter
Posts: 807
Joined: Fri Apr 29, 2016 5:27 pm
Contact:

Re: How to guide: Train signaling done right

Post by Frightning »

#3 Continued

2-way rail intersection
What about a 2-way example?
2-way rail intersection signaled with blocks.jpg
2-way rail intersection signaled with blocks.jpg (603.66 KiB) Viewed 15204 times
Here, the throughput is improved by allowing trains approaching the station from opposite directions and wishing to turn either both to the left or both to the right 90 degrees to move through the junction simultaneously. Technically, the center block is unneeded, but only a single set of the paired signals that define it may be removed without issue. The result of doing so is that the middle block becomes part of one of the entrance/exit blocks (which one being determined by which set of paired signals was removed). This junction has another subtle issue. Each of the regular signals defining an exit onto some 2-way rail needs to be replaced with a chain signal if the other end of that block is not only connected to 1-way rail.

Final example
Sometimes, one ends up with more exotic looking junctions.
final junction.jpg
final junction.jpg (604.2 KiB) Viewed 15204 times
I came up with this junction much earlier tonight while playing with my cousin. The north exit lead to our unloading station, after which trains would return from the west to this junction. The 2-way rail leaving SE went to our copper mine and the 2-way NE exit lead to our coal mine. When I went to signal this junction, I realized that it should be done so that if the copper train was heading to the copper mine and the coal train was returning from the coal mine, both could enter the junction at the same time because their paths do not cross. Furthermore, there are no other pairs of paths that don't have a crossing somewhere (merges count). Hence what was needed, intra-junction signalling-wise, was to split the NE-N route into a separate block from the W-SE route. Which I achieved with the signals shown, which create the blocks defined by the red edges.

Post Reply

Return to “Gameplay Help”