Yet Another PBS Patch

From OpenTTD
(Redirected from PBS)
Jump to: navigation, search

Outdated content.png

Out of Date
This article or section is outdated. Some of its content may no longer be accurate due to changes in the latest release. Please update this article.
March 2011, especially the pictures

Yet Another PBS Patch (or just YAPP) is a path based signalling (PBS) patch developed by Michi_cc, that was included in OpenTTD trunk in r13926. The first stable release containing the features of this patch is OpenTTD 0.7.0.

YAPP implements a realistic signalling system, similar to Tekky's proposed PBS system, but without realistic bi-directional double track. It is not related to the old PBS system of OpenTTD.



  • Works with NPF and YAPF.
  • Implements a signal system similar to Tekky's proposed PBS system (without realistic bi-directional double track).
  • Is fully backwards compatible, the old block signals and the new path signals can be used in parallel.
  • Can highlight the reserved paths.


The basics

This paragraph covers the basic features of YAPP, and should get you going on using it.

The Signals

Two new signal types in the signal GUI.
YAPP adds two new signal types to the game. These signals enable trains to reserve a path through a signal block before entering the block. If another train wants to enter the block, and succeeds in reserving a path through the block, both trains can use one signal block at the same time.

As mentioned before, there are two signal types, available in the Signal GUI. The first type is the basic path signal. There are two things you should know about this signal:

  • Place it only where trains can stop and wait safely without blocking junctions and other things.
  • Trains can pass through this signal from the back side.
Path Signal
This signal will be called a Path Signal.

There are also two things you should know about the second signal type:

  • Place it only where trains can stop and wait safely without blocking junctions and other things.
  • Trains can pass through this signal from one direction.
One-Way Path Signal
This signal will be called a One-Way Path Signal.

Most of the times it will be sufficient to use a default path signal, as passing a signal from the back is penalised by the pathfinder, however, one-way path signals might be useful in certain specific cases.

The two new signal types behave a bit different than standard OpenTTD signal types. The path signals are red by default, and will only show green as soon as a train can reserve a path to the next safe waiting position on its route. Safe waiting positions are - by definition - in front of signals, depots and track ends. The back of a path signal is not considered a safe waiting position, and therefore paths are reserved through these signals.

Because the front of every signal is defined as a safe waiting position, you would normally not want to place a signal immediately behind a junction, only in front of a junction. This is because it is only safe for a train to wait in front of a junction. It is not safe for a a train to wait at a signal immediately after a junction before the whole train has cleared the junction, as it would be blocking the junction while waiting, as illustrated in the example below. This is a major advantage against standard OpenTTD signals, where you had to place signals before and after junctions, which caused trains to block junctions while waiting.

The signal indicated by the arrow is an unsafe waiting location, as the train in the junction now blocks the otherwise free path of the train coming from the top. There's a second unsafe waiting location in this picture. Can you find it?

Patch Options

YAPP Patch options
YAPP adds three patch options to the game.

One option is to highlight reserved tracks. This option is useful to troubleshoot your junctions, as you can see what paths trains have reserved through a signal block.

The other two options control how the build signal tool should behave. You can set the signal type which should be built by default when building a new signal with the signal tool and change which signal types should be cycled through on ctrl-clicking an already existing signal.

There are a few more patch options which are not available through the Configure Patches windows. What these options are, and how to edit them is covered below under Advanced patch options.

Basic Examples

Below are some example track layouts which use the path signals. Advanced track layouts that are not recommended for beginners are on a separate page.

Basic junction

This basic junction now has a much higher throughput.

Basic junction for trains with maxlength three tiles. Note the use of normal signals on plain track.

Basic two-way station

With this station layout, trains can use both platforms when coming from either direction.

Basic station.

Basic single track

This is the basic layout of a single track line that can be used in both directions. A single track line with several passing points can be built by repeating the layout. Increased throughput can be achieved with an improved layout.

Basic single track building block. The outward signals should be moved far enough away from the junction tiles that waiting trains do not block the junctions.

Advanced patch options

YAPP has several options not accessible through the patch settings window. These are saved in your openttd.cfg and can be changed either with a text editor or through the in-game console using the "patch" command. Changes made in openttd.cfg will not affect already started savegames, you have to use the console to change the values of a running game.

Advanced options
Option Default Description
pf.wait_for_pbs_path 30 How long to wait for a path reservation (in days). Set this value to 255 if you don't want trains to ever turn around at a path signal on their own.
pf.path_backoff_interval 20 Ticks between checks for a free path. Increase if you have a slow computer. Set to 255 to disable path look-ahead if you don't want to use advanced signals.
pf.npf.npf_rail_pbs_cross_penalty 300 Pathfinder penalty for crossing a reserved tile when using NPF.
pf.npf.npf_rail_pbs_signal_back_penalty 1500 Pathfinder penalty for passing a path signal from the backside when using NPF.
pf.yapf.rail_pbs_cross_penalty 300 Pathfinder penalty for crossing a reserved tile when using YAPF.
pf.yapf.rail_pbs_station_penalty 800 Pathfinder penalty for crossing a reserved station tile when using YAPF.
pf.yapf.rail_pbs_signal_back_penalty 1500 Pathfinder penalty for passing a path signal from the backside when using YAPF.
pf.yapf.rail_doubleslip_penalty 100 Pathfinder penalty for passing a double slip switch when using YAPF.

Feature availability







See also

Personal tools