Tutorial:Train signals: Difference between revisions
No edit summary |
No edit summary |
||
Line 106: | Line 106: | ||
[[File:Train_waiting_area.png|800px]] | [[File:Train_waiting_area.png|800px]] | ||
There are two ways to design waiting areas, parallel and sequential. The image shows a parallel waiting area for two stations. The parallel | There are two ways to design waiting areas, parallel and sequential. The image shows a parallel waiting area for two stations. The parallel version is easily extendable, takes less space and multiple stations can share a parallel waiting area. The sequential version as shown below is easier to set up but cannot be shared by multiple stations (and has very minor UPS benefits). It is particularly suitable to mining outposts. Waiting areas are often referred to as stackers. | ||
[[File:Train_waiting_area_sequential.png|800px]] | [[File:Train_waiting_area_sequential.png|800px]] | ||
Line 114: | Line 114: | ||
Roundabouts provide a convenient and easy to remember way to make an extendable intersection. However compared to other intersections they only allow low throughput and in rare scenarios they can cause deadlocks. The four way junction shown here is serviceable and has decent throughput. | Roundabouts provide a convenient and easy to remember way to make an extendable intersection. However compared to other intersections they only allow low throughput and in rare scenarios they can cause deadlocks. The four way junction shown here is serviceable and has decent throughput. | ||
There are other junction designs with more throughput, however the size of the junction goes up immensely. There is a [https://forums.factorio.com/viewtopic.php?t=46855 forum post] where a number of four way junctions and their throughput parameters are collected. However for normal gameplay | There are other junction designs with more throughput, however the size of the junction goes up immensely. There is a [https://forums.factorio.com/viewtopic.php?t=46855 forum post] where a number of four way junctions and their throughput parameters are collected. However for normal gameplay intersections shown here are usually more than enough. | ||
<gallery mode="nolines" widths=400px heights=400px> | <gallery mode="nolines" widths=400px heights=400px> |
Revision as of 17:44, 8 October 2018
Rail signals are necessary to run a functioning rail system in factorio. This tutorial explains why and when signals are used, what deadlocks are and where they can happen. The aim is to enable the reader to keep a rail system running smoothly and fix common issues. Examples of frequent use cases are shown.
For beginners who are just learning the usage of signals it is recommended to place radars near all intersections to help identify issues quickly. It is also recommended to set up automation for fuelling trains as soon as possible whenever a new train or station is added to the system. Trains can either be fuelled at one stop on their usual schedule (this may or may not involve transporting fuel to a station) or by adding a separate fuel station to the schedule.
Regular Signals
Whenever there is more than one train on a track, there is the possibility that trains can crash into one another. To prevent trains from doing this, we place signals at intervals along the track and at crossings. A regular signal protects the rail block behind it, up to the next signal or the end of the track. Rail blocks are shown with colors when a player has a signal in hand, as in the picture. Signals ensure that only one train can be in any block. Whenever a second train would enter a block that already has a train in it, the train will wait at the signal leading into the block instead.
A regular signal is green when there is no train on the block behind it. When a train enters the block, all signals going into the block will turn red. When a train is in the process of entering the block, the signal turns yellow for a short time before turning red.
Signals are placed on the right side of the track. Trains are only allowed to go past signals that are on the right hand side from direction of travel. A train in automatic mode will not drive on a track if it would pass a signal on the left side unless there is also a signal on the right side at that signal. This can sometimes cause a "no path" error where the track appears to be connected, but part of the connection is a one way track.
In the image, the tracks are from top to bottom:
- left to right,
- right to left,
- bidirectional,
- bidirectional,
- bidirectional on the left side, splitting into a right to left (upper) and a left to right track (lower).
Chain Signals
Using signals prevents trains from crashing into each other but brings with itself other potential issues. Every train will wait until the block in front of it is cleared, so trains are waiting for other trains. This becomes a problem when a train starts waiting on an intersection. In that case other trains will have to wait even if they are not going in the same direction. These trains may in turn cause other trains to wait, resulting in a slowdown of the entire system. Traffic systems should avoid having trains waiting on intersections. In Factorio, chain signals are used to ensure that this cannot happen.
The most important rule is that a train cannot wait for an extended period of time in a block after a chain signal, whereas it can wait in a block after a regular signal. Since trains should not wait on crossings, this leads to the commonly stated rule: Use chain signals on and before crossings and use regular signals at the exits of crossings. In general, whenever a waiting train would block another train that is going on a different track, a chain signal should be used to prevent the train from waiting.
How do chain signals work? To determine if a train is allowed to drive past a chain signal, consider the path the train will take from that signal up to the next regular signal or until it reaches the station, whichever comes first. The train is only allowed to go through if all rail blocks on this path are free. If the train goes through, it will reserve all blocks on this path and not allow other trains to pass through a block until it leaves the block. A chain signal which leads to a block that has only one outgoing signal will always have the same color as that signal. If a rail line splits up, it can happen that one outgoing signal is red and the other is green. In that case the chain signal leading into the block will turn blue to indicate that some paths are free while others are not.
If the rail network contains many chain signals it is possible that a very large number of blocks is reserved when a train drives by a chain signal. This would restrict other trains, reducing throughput in general. Hence it is often suggested to use regular signals whenever possible and chain signals only where they are necessary.
Deadlocks
Using signals can lead to trains waiting for other trains. As a consequence, there might be a chain of trains, each waiting for the next, with the last waiting for the first. This situation is called a deadlock, because the trains will wait forever or until the situation is resolved manually. It should be avoided and resolved as soon as possible because every train going through the area will get stuck. The most frequent causes of deadlocks are
- trains waiting on intersections and
- a rail network that does not allow enough space for trains.
The image above shows a deadlock caused by missing chain signals since only regular rail signals were used. As a result trains can wait on a crossing which leads to a deadlock. Note that a deadlock can happen with as few as two trains. The positions where the regular signals should be replaced by chain signals are marked with hazard concrete.
The deadlock in the image happened because there is a circle in the network which was used by more trains than can fit into the circle. To fix the source of the deadlock the circle must be removed.
Signal Spacing
The image shows a deadlock between two T-junctions. It happened because while a train was waiting at the intersection, its tail end was still in the last intersection. The junctions when taken individually are signalled correctly, however they are too close to each other. One might argue that they form a single big intersection. There are two ways to fix this: the regular signals between the two junctions could be turned into chain signals or the junctions could be moved further away from each other.
After an exit signal of a junction, the next signal must be at least far enough away to fit the longest train in the rail system between the signals. In general, after every regular signal there should be at least that much space.
Splitting Rail Blocks
The following aims to explain where signals should be placed. Long uninterrupted rail tracks should have signals at regular intervals because this allows more trains to move on the track simultaneously leading to higher throughput. Crossings should be separated from uninterrupted rails with signals. Inside crossings, signals should be used so that multiple trains can pass through the crossing without slowing down - for example trains going in opposite directions should not have to slow down for each other, so they need to pass through different blocks inside an intersection. The examples below all follow these rules.
Examples
The most common way to build a rail system is using two parallel rails, one for each direction. The examples mostly follow this architecture. A single bidirectional rail line should not be used for 'main' rail lines in most situations.
T-Junction
The image shows a basic three way junction. Rail signals have been placed inside the junction to ensure that more than one train can enter the junction in some cases. For example for one train going left to right and one going right to left, the trains will pass through different blocks: the first will go through the left yellow, the blue and the lower right yellow block; the second will use the upper yellow and upper red blocks. Because they use different blocks, they can use the junction simultaneously. While this is not strictly necessary for a junction to work, it will allow better throughput at a low cost.
Single Split Off
Stations should never be on a main rail line as trains waiting there would block other trains for extended periods of time. So usually a single line is split off from the main line to make a station there. If a station is used by more than one train, it should have a waiting area which has been left out in the image for clarity and will be explained later.
Blueprint of the junction:
In the image above, a train can enter and leave the station through the same junction. The train will need to have locomotives facing in both directions for this to work. The image below shows a variation where the train enters and leaves via different junctions.
The signals in all the examples are done according to the 'chain before, regular after' rule.
Upper Junction (entering main line):
Lower Junction (leaving main line):
Waiting area
If multiple trains use the same station, the trains will wait on the main rail line, which leads a traffic jam in the network. One way to avoid this is to add waiting areas for trains at each station.
There are two ways to design waiting areas, parallel and sequential. The image shows a parallel waiting area for two stations. The parallel version is easily extendable, takes less space and multiple stations can share a parallel waiting area. The sequential version as shown below is easier to set up but cannot be shared by multiple stations (and has very minor UPS benefits). It is particularly suitable to mining outposts. Waiting areas are often referred to as stackers.
Four Way Junctions
Roundabouts provide a convenient and easy to remember way to make an extendable intersection. However compared to other intersections they only allow low throughput and in rare scenarios they can cause deadlocks. The four way junction shown here is serviceable and has decent throughput.
There are other junction designs with more throughput, however the size of the junction goes up immensely. There is a forum post where a number of four way junctions and their throughput parameters are collected. However for normal gameplay intersections shown here are usually more than enough.
- Roundabout.pngCopy blueprint string
- Four way junction compact.pngCopy blueprint string