Difference between revisions of "Signals"

From #openttdcoop wiki

Jump to: navigation, search
(Merged with signalling)
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Merge |Guides:Presignals}}
 
{{Merge |Signal Types}}
 
 
{{update}}
 
{{update}}
 +
{{cleanup}}
 +
 +
See also: http://wiki.openttd.org/Signals
  
 
== Signal types ==
 
== Signal types ==
 
OpenTTD currently has 4 basic signal types (not counting presignals). These 4 are:
 
OpenTTD currently has 4 basic signal types (not counting presignals). These 4 are:
[[Image:Signals_basic.png|center]]
+
[[Image:Signals_basic_fixed.png|center]]
  
 
Each of these 4 signal types has different properties and should be used in different circumstances. An overview:
 
Each of these 4 signal types has different properties and should be used in different circumstances. An overview:
Line 15: Line 16:
 
! Comments
 
! Comments
 
|-
 
|-
! Standard single
+
! One-way block signal
 
| Block
 
| Block
 
| One-way
 
| One-way
| The standard signal for one-way tracks, and therefor the most-used signal in coop games.
+
| The standard signal for one-way tracks, and therefore the most-used signal in coop games.
 
|-  
 
|-  
! Standard double
+
! Two-way block signal
 
| Block
 
| Block
 
| Two-way
 
| Two-way
| Arguably the hardest signal to use properly. Standard double signals have an EOL property that means that if they are red, the pathfinder considers the signal the End Of a Line, thereby discaring its route. This property can lead to very unexpected and unwelcome behaviour. Use with caution.
+
| Arguably the hardest signal to use properly. Standard double signals have an EOL property that means that if they are red, the pathfinder considers the signal the End Of a Line, thereby discarding its route. This property can lead to very unexpected and unwelcome behaviour. Use with caution.
 
|-  
 
|-  
 
! PBS 1-Way
 
! PBS 1-Way
 
| Path-based
 
| Path-based
 
| One-way
 
| One-way
| The bath-based version of the standard single signal. In general, use this instead of the PBS signal. However, whenever path-based signals are nog strictly needed, use the standard single signal instead.
+
| The path-based version of the standard single block signal. In general, use this instead of the PBS signal. However, whenever path-based signals are not strictly needed, use the standard single block signal instead.
 
|-  
 
|-  
 
! PBS
 
! PBS
 
| Path-based
 
| Path-based
 
| Two-way
 
| Two-way
| While this path-based signal can be driven two-ways, it does have a preference for one direction. This preferred driving direction is indicated by the single signal pole and is the same as with the PBS 1-Way. Driving a PBS signal the wrong way gives a massive penalty in the pathfinder. This is the reason why we commonly use the reversed versions of these signals as penalties in our games.
+
| While this path-based signal can be driven two-ways, it does have a preference for one direction. This preferred driving direction is indicated by the single signal pole and is the same as with the PBS 1-Way. Driving a PBS signal the wrong way gives a fairly massive penalty in the pathfinder. This is the reason why we commonly use the reversed versions of these signals as penalties in our games.
 
|}
 
|}
  
 
The two block signals themselves have specific versions, called pre-signals. More about those can be found in [[Presignal Basics]].
 
The two block signals themselves have specific versions, called pre-signals. More about those can be found in [[Presignal Basics]].
 
Path-based signals themselves have their own unique features, which are detailed [[Guides:Advanced_Signals|here]].
 
Path-based signals themselves have their own unique features, which are detailed [[Guides:Advanced_Signals|here]].
 
 
  
 
==Placing Signals==
 
==Placing Signals==
Line 59: Line 58:
 
[[Image:Signalling breakpoints.png|right|thumb|200px|Breakpoints]]
 
[[Image:Signalling breakpoints.png|right|thumb|200px|Breakpoints]]
 
Automatic Signal Completion won't stop at: '''Tunnels''' and '''Bridges'''
 
Automatic Signal Completion won't stop at: '''Tunnels''' and '''Bridges'''
but stops at: Junctions, Stations and Existing Signals
+
but stops at: Junctions (inculding merges), Stations, Waypoints, and Existing Signals
  
 
===Checking anyway===
 
===Checking anyway===
Line 72: Line 71:
 
A red two-way signal directs train to a different route if one is available.  
 
A red two-way signal directs train to a different route if one is available.  
  
''While used in combination with the default YAPF pathfinder, two-way signals have a weird and often misunderstood property. This property, called rail_firstred_twoway_eol, means that if the first encountered signal is a red two-way, that signal is considered a dead end. Now to understand the impact of this, one must first understand the basics of YAPF. In a nutshell: YAPF calculates all possible routes, called paths, from the train's current position. Each path is evaluated to a single score, determined by the length of the path, obstacles like stations, roads and hills, and upcoming red signals and ofcourse the ability to reach the destination (station). The train then chooses the path with the lowest penalty score.
+
Read more: http://wiki.openttdcoop.org/Two-way_end_of_line
  
Consider the train is on a junction and has multiple exit possibilities. The issue with red two-way signals is that if the first signal on a path is a red two-way, that path is not evaluated at all as it is considered a dead end. You could say that the path gets a penalty score of infinity. This also means that any other possible path, if it exists, is automatically better than the two-way path. Even if the other possibility is a trivial, detouring or outright useless path.
+
== Presignals ==
What this means in practice is:
+
* If all possible paths start with red two-way signals, the paths are considered equal and a choice is made without considering the network after the signals.
+
* If there is a single path not starting with a red two-way signal, that path is automatically chosen without considering the usefulness of the path itself.
+
Most important is that a choice is made without looking ahead at all. This includes checking if the chosen path actually leads to the desired destination. This can cause massive problems in our games, with games detouring or even driving themselves into a station or actual dead end.
+
  
Now is the EOL property a setting that can be changed. However, on our servers it is always on, as it gives trains the ability of free choice. If two different paths share a destination, but are considered by the pathfinder to be very unequal penaltywise, with single signals a train might decide to take the path with the lowest penalty, even though that means waiting for a red light. With two-way signals this will never happen.
+
Presignals are widely used in openttdcoop games for simple constructions  as well as the most advanced ones.
  
 +
Read more: http://wiki.openttdcoop.org/Guides:Presignals
  
In short:
+
== PBS ==
* Only use two-way signals when you understand their workings and use. Otherwise, use single signals.
+
PBS stands for Path-Based Signaling
* Only use two-way signals in situations where each path has the same destination but a possibly very unequal penalty, and where it is important for the train to make an indiscriminant choice. You can think of mergers and SLH joins. But please remember that you don't always have to use them. If you can avoid them, do so.
+
* Especially avoid two-way signals when not all of the exits are two-way, and not all paths lead to the same place. The most common error is combining a double bridging of a mainline with the exit of a track.
+
* The exception is ofcourse for track that actually has to be two-way, like the signals next to platforms in terminus stations.
+
* Two-way signals can also legitimately be used in logic systems and the creation of priorities.''
+
  
 +
Details: http://wiki.openttdcoop.org/PBS
  
=== Pathfinder trap ===
+
===Why not PBS everywhere?===
The most use of this setting is found in our [[SRNW]] games, we control trains to either take an exit to the sideline or stay on the mainline. We also combine this signal with a certain station or shortcut to create pathfinder traps. Pathfinder traps give us options to trick trains, we can decrease the pathfinder penalties to an actual station and so create more balanced traffic or we can balance mainline mergers. There are occasions where the inner lane is preferred so much we will create a shortcut from each lane to the inner lane after a merger. We disable an exit with the pathfinder trap so the trains will not actually take this path and a merger gives us a balanced output.
+
{| align="center"
+
|| [[File:Pftrap.png|300px|thumb|center|Pathfinder trap in its raw form.]]
+
|| [[File:Pftraponmainline.png|300px|thumb|center|Pathfinder trap on mainline to create a shortcut that can never be used.]]
+
|}
+
=== Station with overflow ===
+
In our games we often use overflows and this setting can help us create easy to implement overflows for our primaries. One example of this is found in the picture below.
+
  
{| align="right"
+
Though PBS dosn't lag computers (unless you've got thousands of trains constantly making requests), PBS checks for a clear route only every few ticks. Block signals can turn green the tick the block is clear becuase it only needs to know the block is clear, not the path. Therefore, it is slightly faster to use block signals vs. PBS when there can't be more than one train in the block with PBS. This logic is also true with a few Presignal blocks vs one PBS block, such as at station entrances.
|| [[File:Overflow primary.png|300px|thumb|center|Overflow on the a primary with reverser arrows.]]
+
 
|| [[File:TerminusPrimary.png|300px|thumb|right|Arrows on a primary station]]
+
== Signal Gaps ==
|}
+
[[Image:Signal gap settings.png | thumb | 400px | right | Configuring auto-signalling]]
 +
A signal gap, or gap for short, is the amount of unsignalled space in a single signal block.  Understanding signal gaps is important for maximizing train density on a rail line and ensuring that trains continue to move at the maximum allowable speed.  In coop games, we adhere to a maximum signal gap of 1 tile.
 +
 
 +
In general, use of the term "gap" indicates that a signal gap of length greater than 1 has been detected, and as a result, the efficiency of the network is at risk.  Steps should be taken to fix any gaps marked in this manner.
 +
 
 +
Do not confuse a "signal gap" with a "train gap". A train gap is the minimum space between two trains.  Because our signals are 2 spaced tiles apart (also known as [http://wiki.openttd.org/Railway_Designs Signal Density]), there is a minimum gap of 3 (the Signal Density +1). 
 +
 
 +
<br clear=all>
 +
=== Why is understanding gaps important? ===
 +
 
 +
A rail line is only as fast as its weakest link.  If there is any point on the line where traffic must slow down or stop, the disruption will have a domino effect on any following trains, resulting in an inefficient network.  As the goal is often to build a highly-efficient, and highly-dense network, these types of disruptions must be avoided at all costs!
 +
 
 +
<br clear=all>
 +
=== What if I need to create a signal gap larger than 1? ===
 +
[[Image:Signal gap sync.png | thumb | 400px | right | Make sure alternate routes are in sync]]
 +
To create a signal gap larger than 1, you must provide following trains an alternate route until the gap is restored to 1.  Larger gaps are created at station platforms, bridges, and tunnels, since none of these items can be signalled.
 +
 
 +
To create an alternate route, simply make a new line parallel to the first line.  This line should continue until the signal gap can be restored to 1, making sure to keep the trains [[Line sync|synchronize]]d.
 +
 
 +
<br clear=all>
 +
=== How to count the length of a gap ===
 +
When using normal block signals, a gap's length is defined as the number of unsignalled spaces between two signals.  Normal coop [[mainline]]s use a signal gap of 1, meaning there is only 1 unsignalled tiles between two signalled tiles.
 +
 
 +
When using pre-signals, the gap is counted from the tile after the first pre-signalled (or combo-signalled) tile through to (but not including) the next normal block signal (exit signals are still counted as part of the gap).  If multiple routes exist, the largest value is the gap.
 +
 
 +
Placing a pre- (or combo-) signal and an exit signal (in that order) on a mainline will create a gap larger than 1, so this type of construction should not be done without creating an alternate route.
 +
 
 +
When using PBS signals, the gap is counted just like normal block signals: from the tile after the PBS signal through to (but not including) the next signalled tile.  If multiple routes exist, the largest value is the gap.
 +
[[Image:Signal gap counting.png | 400px | thumb | left | Counting signal gaps]]  [[Image:Signal gap signals.png | 400px | thumb | left | Other signals]]
 +
 
 +
<br clear=all>
 +
 
 +
=== How many alternate routes do I need to create? ===
 +
[[Image:Signal gap bridges.png | thumb | 400px | right | Two bridges for this gap is enough for any train length]]
 +
The number of alternate routes is dependent on the length of the gap and the minimum train length that might encounter the gap.
 +
 
 +
The typical formula used to calculate the maximum gap length for a certain number of lines (LineCount) is
 +
 
 +
'''SignalGapLength = (TrainLength + 2) * LineCount - (TrainLength - 2)'''
 +
 
 +
Where TrainLength is the minimum train length to encounter the gap, and LineCount is the sum of the alternate routes provided + 1 (the original route).<br />
 +
(This can be quickly calculated with [[User:KenjiE20/Webster|Webster's]] @gap)
 +
 
 +
Conversely:
 +
 
 +
'''LineCount = (SignalGapLength  + TrainLength -2) / (TrainLength+2)'''
 +
 
 +
Always round any fractions up to the next whole number.<br />
 +
(This can be quickly calculated with the [[IRC Commands|PublicServer bot's]] !gap)
 +
 
 +
Refer to the section above for information about how to count a gap properly.
 +
 
 +
<br clear=all>
 +
==The Evil X ===
 +
[[Image:Signal gap evilx.png | thumb | 400px | right | The Evil X]]
 +
When two lines cross each other in an oblique (non-perpendicular) way, it creates an "evil X".  The main problem with the evil X is that it inherently creates a signal gap of 2. 
 +
 
 +
A simple merge does not create a large gap, as long as the tiles before (on both lines) and after (on the single output line) are signalled.
  
In the picture you can see the “ arrow” in the reverser. It is not eye-candy it actually has a use. The pathfinder sees that the other tracks are blocked and considers the reverser only a viable line if it has at least 2 options. This means we create a split in the reverser so the pathfinder thinks it has two options.
+
However, note that when the tracks cross obliquely, it is not possible to signal the output line, creating the gap.
  
Similarly we advise you to also use this arrow on every reverser, and in every terminus station with  pre-signals at the final X as seen in picture below.  In theory only the track that has a straight line to the exit track should have one, but we still prefer using them on all platforms for a terminus station.
+
In practically all cases, evil X's should be avoided.
  
  
=== Setting up two-way end of line ===
 
To setup this behaviour in your own game you can do this in two ways: We at openttdcoop prefer you use the second way because it is permanent, stable and easier.
 
  
*Either in game trough the console command accessible with the “~”  key. Follow this by sending the following command:
 
“set yapf.rail_firstred_twoway_eol 1”
 
*The second way of changing this setting is by editing your openttd config file. And please do this when the game is closed. The location of this file is a question Google has an answer to. In here you find the line “yapf.rail_firstred_twoway_eol = false” and change it to “yapf.rail_firstred_twoway_eol = true” Follow this by saving and closing the config file.
 
  
 
[[Category:Guides]]
 
[[Category:Guides]]
 
[[Category:Basic networking]]
 
[[Category:Basic networking]]

Latest revision as of 02:43, 22 January 2024


See also: http://wiki.openttd.org/Signals

Signal types

OpenTTD currently has 4 basic signal types (not counting presignals). These 4 are:

Signals basic fixed.png

Each of these 4 signal types has different properties and should be used in different circumstances. An overview:

Signal Type Direction Comments
One-way block signal Block One-way The standard signal for one-way tracks, and therefore the most-used signal in coop games.
Two-way block signal Block Two-way Arguably the hardest signal to use properly. Standard double signals have an EOL property that means that if they are red, the pathfinder considers the signal the End Of a Line, thereby discarding its route. This property can lead to very unexpected and unwelcome behaviour. Use with caution.
PBS 1-Way Path-based One-way The path-based version of the standard single block signal. In general, use this instead of the PBS signal. However, whenever path-based signals are not strictly needed, use the standard single block signal instead.
PBS Path-based Two-way While this path-based signal can be driven two-ways, it does have a preference for one direction. This preferred driving direction is indicated by the single signal pole and is the same as with the PBS 1-Way. Driving a PBS signal the wrong way gives a fairly massive penalty in the pathfinder. This is the reason why we commonly use the reversed versions of these signals as penalties in our games.

The two block signals themselves have specific versions, called pre-signals. More about those can be found in Presignal Basics. Path-based signals themselves have their own unique features, which are detailed here.

Placing Signals

Basic Signalling

Before you start to use Automatic Signalling or Signal Dragging you should check the signal density. You can change it in the signal interface or edit the drag_signals_density value in your openttd.cfg. Make sure the value is set to two.

Basic Signalling

The first thing you should know is how use the basic signal dragging feature of OpenTTD: Build a signal (fastest Shortcut is A & S), left-click it and hold the button, drag it as far as you want to build signals. Release the button and the signals will be built. Very easy.

Automatic Signal Completion

Automatic Signal Completion

Now we are ready to build signals and know how to use the basic feature of dragging. We can go a step further. Again Build a signal and drag it. While you are dragging it a little bit press the CTRL button and release it. The track will be filled up with signals until a breakpoint which are existing signals on the track, stations and junctions.

Removing Signals

Removing Signals

It's also possible to remove Signals with the Automatic Completion feature. If you have build a track with signals, use the signal deletion function (Shortcut: A & S & R): click the signal, drag it while pressing the CTRL button and all the signals will be deleted. The breakpoints are stations and junctions.

Breakpoints

Breakpoints

Automatic Signal Completion won't stop at: Tunnels and Bridges but stops at: Junctions (inculding merges), Stations, Waypoints, and Existing Signals

Checking anyway

After you have "signaled" a track, you should optimize signaling at junctions, they might need a signal right before or after the interruption to avoid signal gaps.

Two-way signals

Two-way signals are a common way to influence trains on coop servers. This is possible with the setting Two-way end of line.

Two-way end of line

Two-way end of line is a setting in OpenTTD that can be altered to create interesting train behaviour. By default it is off, but it is activated on every openttdcoop server. A red two-way signal directs train to a different route if one is available.

Read more: http://wiki.openttdcoop.org/Two-way_end_of_line

Presignals

Presignals are widely used in openttdcoop games for simple constructions as well as the most advanced ones.

Read more: http://wiki.openttdcoop.org/Guides:Presignals

PBS

PBS stands for Path-Based Signaling

Details: http://wiki.openttdcoop.org/PBS

Why not PBS everywhere?

Though PBS dosn't lag computers (unless you've got thousands of trains constantly making requests), PBS checks for a clear route only every few ticks. Block signals can turn green the tick the block is clear becuase it only needs to know the block is clear, not the path. Therefore, it is slightly faster to use block signals vs. PBS when there can't be more than one train in the block with PBS. This logic is also true with a few Presignal blocks vs one PBS block, such as at station entrances.

Signal Gaps

Configuring auto-signalling

A signal gap, or gap for short, is the amount of unsignalled space in a single signal block. Understanding signal gaps is important for maximizing train density on a rail line and ensuring that trains continue to move at the maximum allowable speed. In coop games, we adhere to a maximum signal gap of 1 tile.

In general, use of the term "gap" indicates that a signal gap of length greater than 1 has been detected, and as a result, the efficiency of the network is at risk. Steps should be taken to fix any gaps marked in this manner.

Do not confuse a "signal gap" with a "train gap". A train gap is the minimum space between two trains. Because our signals are 2 spaced tiles apart (also known as Signal Density), there is a minimum gap of 3 (the Signal Density +1).


Why is understanding gaps important?

A rail line is only as fast as its weakest link. If there is any point on the line where traffic must slow down or stop, the disruption will have a domino effect on any following trains, resulting in an inefficient network. As the goal is often to build a highly-efficient, and highly-dense network, these types of disruptions must be avoided at all costs!


What if I need to create a signal gap larger than 1?

Make sure alternate routes are in sync

To create a signal gap larger than 1, you must provide following trains an alternate route until the gap is restored to 1. Larger gaps are created at station platforms, bridges, and tunnels, since none of these items can be signalled.

To create an alternate route, simply make a new line parallel to the first line. This line should continue until the signal gap can be restored to 1, making sure to keep the trains synchronized.


How to count the length of a gap

When using normal block signals, a gap's length is defined as the number of unsignalled spaces between two signals. Normal coop mainlines use a signal gap of 1, meaning there is only 1 unsignalled tiles between two signalled tiles.

When using pre-signals, the gap is counted from the tile after the first pre-signalled (or combo-signalled) tile through to (but not including) the next normal block signal (exit signals are still counted as part of the gap). If multiple routes exist, the largest value is the gap.

Placing a pre- (or combo-) signal and an exit signal (in that order) on a mainline will create a gap larger than 1, so this type of construction should not be done without creating an alternate route.

When using PBS signals, the gap is counted just like normal block signals: from the tile after the PBS signal through to (but not including) the next signalled tile. If multiple routes exist, the largest value is the gap.

Counting signal gaps
Other signals


How many alternate routes do I need to create?

Two bridges for this gap is enough for any train length

The number of alternate routes is dependent on the length of the gap and the minimum train length that might encounter the gap.

The typical formula used to calculate the maximum gap length for a certain number of lines (LineCount) is

SignalGapLength = (TrainLength + 2) * LineCount - (TrainLength - 2)

Where TrainLength is the minimum train length to encounter the gap, and LineCount is the sum of the alternate routes provided + 1 (the original route).
(This can be quickly calculated with Webster's @gap)

Conversely:

LineCount = (SignalGapLength + TrainLength -2) / (TrainLength+2)

Always round any fractions up to the next whole number.
(This can be quickly calculated with the PublicServer bot's !gap)

Refer to the section above for information about how to count a gap properly.


The Evil X =

The Evil X

When two lines cross each other in an oblique (non-perpendicular) way, it creates an "evil X". The main problem with the evil X is that it inherently creates a signal gap of 2.

A simple merge does not create a large gap, as long as the tiles before (on both lines) and after (on the single output line) are signalled.

However, note that when the tracks cross obliquely, it is not possible to signal the output line, creating the gap.

In practically all cases, evil X's should be avoided.

Powered by MediaWiki
  • This page was last modified on 22 January 2024, at 02:43.