Train Signals

<tabber>
Block=
|-|
Path=
</tabber>
Block and Path Signals are structures that can be placed on Railways to control the movement of trains and to prevent collisions.
== Construction ==
Both types of train signals can only be built on the joints of constructed Railway tracks and will automatically snap to them. The forward direction of the signal is determined by which side of the joint is targeted. It helps to point at the track rather than the edge of the track. An arrow also indicates the forward direction. 
Up to 2 signals facing opposite directions can be placed on each track joint. If only one signal is present, it will prevent trains in the opposite direction from passing through. A bi-directional track can be achieved by placing signals on both sides of the track.
== Usage ==
==== Blocks ====
Signals divide the track into blocks, which is a section of track bounded by other signals. Blocks have to have at least one entry signal, as well as at least one exit signal (which will be the next block's entry signal). Blocks on a linear track will have only one entry and one exit signal, but branches will have multiple exit signals, merges will have multiple entry signals, and more complex intersections can have multiple entry and multiple exit signals. All entry signals for a block have to be of the same type, either all Block or all Path.
A block which contains any part of a train is considered to be occupied, otherwise it is vacant. Rails which touch or clip through other rails will be considered part of the same block, even if the rails do not snap together at the ends: this makes it possible to build crossroads where one track crosses another. There must be only one possible path between each pair of entry and exit signals in a block, otherwise the entry signals may show an error with the message "Signal loops into itself".
Blocks are colored while a signal is being placed. Each block is given a different color. It can help understand signal placement errors to select a signal to place then examine where each block begins and ends by looking at their coloring.
==== Block Signals ====
A Block Signal will be red if the block beyond the signal is occupied, otherwise it is green. Automated trains will automatically stop at red signals, but player-driven trains are free to ignore red signals, at their peril. There is no sort of automatic brake to stop an oblivious driver. 
A Block Signal will not "look ahead" to the block ahead of its own block to check whether it is occupied or not. However, automated trains can look beyond the next signal and slow down accordingly. Additionally, any other Block Signals protecting a block with multiple entrances will turn red before an approaching train enters the block if the approaching train is going so fast that it can not stop before passing the signal. Keep in mind that this only happens on blocks that have multiple entrances. This feature helps prevent collisions caused by two trains approaching the same block at the same time. 
Satisfactory does not have "chain signals", and there is no way to set up a block signal that changes state based on any block other than its own. (except the specific scenario mentioned above) However, for many of the problems that chain signals typically solve in other games, Path Signals provide a simple and elegant solution. 
Note: Block Signals shouldn't be used for blocks where tracks merge from mutliple entrances. Due to a bug (see below), multiple trains might be able to enter and collide, even if the junction is signalled properly.
==== Path Signals ====
Path Signals are designed specifically for intersections, especially complex ones. They automatically subdivide a block into paths, and treat them as individual sub-blocks. An automated train will reserve a path through the block as it approaches. Other trains can reserve their own paths at the same time, as long as they do not intersect with a path that is already reserved by another train. This allows multiple trains to pass through the same block simultaneously without colliding.
It is possible to chain Path Signals one after the other for especially complex intersections to increase their throughput. This technique can help to avoid "Signal loops into itself" issues, however, it can also allow for gridlocks to occur if used incorrectly. Trains appear to reserve paths through multiple Path Signals at once up to the next Block Signal, and will not pass the first Path Signal if any single portion of the path cannot be reserved. 
Unlike Block Signals, Path Signals will "look ahead" to the Block Signal that follows a train's reserved path. The Path Signal will stop a train if it would have to stop for the next Block Signal while still traversing its reserved path. The Path Signal will turn green once the block at the end of the reserved path is vacant. This system ensures that trains do not stop in the middle of an intersection, which helps to prevent gridlocks. However, trains can be forced to stop within an intersection if their desired exit block becomes occupied with a manually driven train.
Pathfinding is done by Locomotives, not signals. Path Signals reserve paths based on information received from incoming trains. Signals cannot change the paths trains have chosen, they can only tell the trains whether they can proceed on their path or not. This renders "rail stackers" or yards impossible to build. Instead, waiting areas have to be constructed as long tracks divided into successive blocks.
Path Signals remain red until an automated train has reserved a path through that signal, at which time they will turn green to allow the train through. Automated trains treat the Path Signal as red until it turns green because it has approved the path. An approaching automated train will not reserve a path through a Path Signal's block until the next signal is the Path Signal. This means that if there is a Block Signal just before the Path Signal, the Automated train will have to slow down because the Path Signal will remain red until the train passes the Block Signal. 
There is no way for a player who is manually driving a train to reserve a path through a Path Signal, so a player will always appear to be "running a red" when they pass through a Path Signal, even though the block ahead is vacant. When a player-driven train enters a Path Signal, the entire block seems to be considered occupied, and the Path Signals will act like Block Signals and not allow automated trains to enter (needs testing).
== States ==
* Green
** Block Clear (Block Signal)
** Path Approved (Path Signal)
* Red
** Block Occupied
** Waiting for Path Reservation (Path Signal)
* Error (treated as red by trains)
** Invalid Signal
** Signal has missing connections
*** The signal is placed on the very end of a Railway or is not connected to one, leading nowhere
** Block has no exit signal
** Block has conflicting entry signal types
*** All entry signals have to be either Block or Path, this does not apply to exit signals
** Path block cannot contain stations
** Signal loops into itself
*** This error means the signal failed to divide a block, even when no loops are present. It can occur when, for example, two unconnected tracks are too close to each other and a signal is placed on one of them.
== Tips ==
* Track joints can be found easily by aiming at a Railway in dismantle mode.
* Collisions generally shouldn't happen if any signals are in place. Gridlocks may occur instead. See § Current issues for exceptions.
* Trains appear to slow down for red/error signals at a distance of about 250 m, or 2.5 maximum track lengths. If they fail to brake in time (if the block has a steep downhill slope, for example), they will be forcefully stopped at the signal, much like with Train Stations.
** Path Signals are red until reserved, and they aren't reserved until the train is in a block immediately before the Path Signal. Thus, blocks leading to Path Signals should be long enough to prevent trains slowing down due to approaching a red signal.
* There isn't a general guidance for appropriate block sizes. A good factor is the length of the longest trains. To avoid signal spam, blocks even 3 or 4 maximum track lengths long (300-400 m) are appropriate.
== Trivia ==
* Train signals were originally planned for Update 6.YouTube - October 19th, 2021 Livestream - Q&A: Updates planned to be bigger or smaller in the future?
== Current issues ==
* Train collisions can occur even with seemingly properly placed signals:
** A train can be made to loop into itself within one block (much like in Snake).
** More than one entry Block Signal may turn green once a block is freed. This allows multiple trains awaiting entry to enter simultaneously. If their paths cross within the block, they will collide.https://questions.satisfactorygame.com/post/62ad0e51ca608e0803514f86
*** This can be mitigated by using Path Signals for blocks where tracks merge, which don't seem to suffer from this issue.
== External links ==
* Train Signal Guide by TotalXclipse on YouTube
* Signal Logic Rules by u/Sevrahn on Reddit
== History ==
* Patch 0.5.2.1:
** Stations cannot be placed inside Path blocks anymore, Path Signals now give a proper error message if a Station is found inside a block
** Short blocks, about 75% the size of a Freight Car, should now work with Path Signals
** Fixed Path Signals placed right after a station being incorrectly reserved by trains going to the station
* Patch 0.5.1.13: Multiple fixes related to issues with Path Signals and Block Signals
* Patch 0.5.1.11: Potential fix for multiblock reservation issues for train signals
* Patch 0.5.1.4:
** Fixed a bug where trains docked at a Train Station could reserve Path Signals when saving and loading
** Fixed a case where trains approaching Train Stations with a Path Signal right after the station would reserve the same Path Signal over and over
* Patch 0.5.0.11: Added visual feedback for blocks when placing down signals
* Patch 0.5.0.0: Introduced
== References ==
Category:Transportation