Cite as
OpenTTD 15.3 source
Original
https://github.com/OpenTTD/OpenTTD
Pinned
OpenTTD/OpenTTD @ 14ec60f248547d4d062a1160f0fc26d742319888
Accessed
2026-10-26
Licence
GPL-2.0-only. README.md says "OpenTTD is licensed under the GNU General Public License version 2.0"; COPYING.md is GPL v2. Some 3rd-party modules in src/3rdparty are under Zlib, MIT, Boost, Unicode, BSD-2-Clause/CC0 and Apache-2.0, as README.md lists.
Credit
The OpenTTD contributors. The project began as Ludvig Strigeus's reverse-engineered Transport Tycoon Deluxe in C, released as OpenTTD 0.1 by Owen Rudge on 6 March 2004.
Notes
Pinned at the 15.3 release tag (commit 14ec60f, 2026-04-04). Code paths for this brief: signals in src/signal.cpp, src/signal_type.h, src/pbs.cpp and src/pbs.h, with the build/UI in src/rail_cmd.cpp and src/rail_gui.cpp; train pathfinding (YAPF) in src/pathfinder/yapf/ (entry src/pathfinder/yapf/yapf_rail.cpp); orders in src/order_base.h, src/order_cmd.cpp and src/order_gui.cpp; timetables in src/timetable.h, src/timetable_cmd.cpp and src/timetable_gui.cpp; the train and vehicle windows in src/train_gui.cpp and src/vehicle_gui.cpp. changelog.md holds the per-release feature entries going back to 0.1.1.

Cited on

Claims (21)

OpenTTD's changelog lists "preliminary presignal support" in 0.1.1 (14 March 2004) and pre-signals, set by Ctrl-clicking an existing signal, in 0.2 (3 April 2004).changelog.md L7825–7827changelog.md L7693–7700Developer
OpenTTD's changelog lists "a form of timetabling for vehicles" in 0.6.0-beta1 (18 November 2007).changelog.md L6040changelog.md L6079Wiki
OpenTTD's changelog lists "path based signalling" in 0.7.0-beta1 (16 February 2009); 0.7.0 came out on 1 April 2009.changelog.md L5411changelog.md L5455changelog.md L5296Developer
Until the end of 2009 OpenTTD needed Transport Tycoon Deluxe's graphics and sounds; free replacements (OpenGFX, OpenSFX and OpenMSX) made it a stand-alone game, and the release that marked it was numbered 1.0.0, which the changelog dates 1 April 2010.changelog.md L4596Wiki
Rudge writes that the move to GitHub in 2018 and the release on Steam in 2021 re-energised development. Rock Paper Shotgun reported in February 2021 that OpenTTD would reach Steam on 1 April, with the 1.11 update, after it had reached the Microsoft Store; the changelog dates 1.11.0 to 1 April 2021.changelog.md L1583Dev blog
OpenTTD 15.3 has six kinds of rail signal: the block signal; three pre-signals (entry, exit and combo); the path signal; and the one-way path signal. Each comes as a light signal or a semaphore, which look different and behave alike.src/signal_type.h L15–19src/signal_type.h L22–29Code
Any signal that isn't a path signal holding a reservation turns red while a train is anywhere in the block it leads into; a train inside a depot doesn't count. A block runs from signal to signal through junctions, stations, level crossings, tunnels and bridges, over the owning company's track only.src/signal.cpp L422–428src/signal.cpp L194–197src/signal.cpp L279src/signal.cpp L302–306Code
With no train in the block, an entry signal turns red when the block ahead has at least one exit or combo signal leading out of it and none of them is green, whichever way the waiting train would go. A combo signal acts as an entry and an exit at once; one placed both ways doesn't count its own back face as a way out. When an exit or combo signal changes color, the block behind it is worked out again, so a chain of combo signals passes the state back block by block.src/signal.cpp L432–446src/signal.cpp L329–338src/signal.cpp L448–454src/rail_map.h L307–315Code
A path signal with no reservation behind it is red when a train is in its block, and also when the block holds a junction or has more than one signal leading into it; otherwise it is green. A train at a path signal reserves track to the next safe place to stop, and the signal turns green for it when the reservation succeeds. A safe place is a depot, a signal that isn't a path signal, the tile before a path signal on a single line ahead, or, where the search allows it, a dead end; a one-way path signal facing the other way counts only as such a dead end.src/signal.cpp L422–431src/pbs.cpp L381–417src/train_cmd.cpp L2747–2750src/train_cmd.cpp L2759–2764Code
The pathfinder treats a signal that faces only against the train as a dead end, unless it is a two-way path signal: that one a train may pass from behind, at a cost of 15 tiles of track while it is within the first ten signals of the path.src/pathfinder/yapf/yapf_costrail.hpp L176–183src/pathfinder/yapf/yapf_costrail.hpp L237–239src/rail_map.h L318–321src/table/settings/pathfinding_settings.ini L261–264Code
OpenTTD's block signal does what Factorio's rail signal does: it keeps a train out of a block another train is in.src/signal.cpp L426–428Dev blog
OpenTTD's entry pre-signal and Factorio's chain signal both look past the next block, but differently: the entry signal clears when any exit signal of the block ahead is green, whichever exit the train will take, while the chain signal looks only at the exit on the train's path. Friday Facts #81 (2015) says the chain signal resembles the "TTD pre signals" but works differently.src/signal.cpp L443–444Dev blog
Trains route with YAPF ("Yet Another PathFinder"); OpenTTD 15.0-beta1 (December 2024) removed the older NPF pathfinder and the setting that chose between them.src/train_cmd.cpp L2505changelog.md L609Code
YAPF prices a route in hundredths of a tile: 100 for a tile of straight track and 71 for a corner piece, the short piece inside a curve, plus 100 for a 45° bend, 600 for a 90° turn, 200 for an upward slope, 300 for a level crossing, added only on a straight tile, 5000 for reversing in a depot, and 1000 for each tile of a station platform the train passes through. The destination's platform instead costs 800 if it's longer than the train and 4000 if it's shorter.src/pathfinder/pathfinder_type.h L16–19src/pathfinder/yapf/yapf_costrail.hpp L124–146src/pathfinder/yapf/yapf_costrail.hpp L102–108src/pathfinder/yapf/yapf_costrail.hpp L450–453src/pathfinder/yapf/yapf_costrail.hpp L604–607src/table/settings/pathfinding_settings.ini L153–201src/table/settings/pathfinding_settings.ini L279–300Code
For each of the first ten signals along a route, a red block or pre-signal adds a cost that falls with distance: 500 for the first, then 405, 320, 245, 180, 125, 80, 45, 20 and 5; green signals and red path signals add none. If the first signal is red, a block or entry signal adds 1000 more and an exit or combo signal 10000. With the rail_firstred_twoway_eol setting on, as it is by default, a red first block or pre-signal that is two-way, met after the route has had a choice of track, ends that branch of the search as a dead end.src/pathfinder/yapf/yapf_costrail.hpp L62–69src/pathfinder/yapf/yapf_costrail.hpp L192–229src/table/settings/pathfinding_settings.ini L111–129src/table/settings/pathfinding_settings.ini L207–237Code
Both games' train pathfinders count a red signal or a busy block for less the farther ahead it lies: Factorio divides the penalty for an occupied block by how many blocks it is from the start, and OpenTTD's default penalty for a red signal that isn't a path signal falls from 500 at the first signal to 5 at the tenth and stops.src/pathfinder/yapf/yapf_costrail.hpp L214–218src/pathfinder/yapf/yapf_costrail.hpp L67–68src/table/settings/pathfinding_settings.ini L207–237Wiki
Factorio's pathfinder, which costs a route by the length of its rail segments in tiles, adds 2000 for each train stop on the route other than the one at the train's start, while OpenTTD's charges 10 tiles' worth for each tile of station platform a train runs through.src/pathfinder/yapf/yapf_costrail.hpp L450–453src/table/settings/pathfinding_settings.ini L153–156Code
A vehicle's orders send it to stations, depots and waypoints, or skip ahead on a condition: its load, reliability, maximum reliability, top speed, age, remaining lifetime or need for servicing, or always. At a station an order sets how to load (if available, full load, full load any cargo, or none) and how to unload (normally, unload all, transfer, or none).src/order_type.h L50–61src/order_type.h L67–81src/order_type.h L128–136Code
A train with a full-load order stays at the station until every vehicle in it is full; with "full load any cargo" it may leave once all the vehicles carrying some one cargo are full. The test runs on a loading round in which nothing was loaded or unloaded. Aircraft with passengers are the exception to the any-cargo rule: they wait until the passenger hold is full.src/economy.cpp L1824–1828src/economy.cpp L1866–1876src/order_type.h L77–81Code
Without a full-load order, a vehicle stops loading once a round has unloaded nothing and filled no vehicle to the round's limit, no cargo reserved for it is left, and it has waited its timetabled time at the stop, less however late it is running.src/economy.cpp L1855–1859src/economy.cpp L1789–1793Code
A train's window holds a small view of the map that follows the train and zooms with the mouse wheel unless the wheel is switched off in the settings; its location button centers the main view on the train, follows it on a double click, and opens a new viewport on it with Ctrl.src/vehicle_gui.cpp L2837src/vehicle_gui.cpp L3039src/vehicle_gui.cpp L3338–3343src/vehicle_gui.cpp L3249–3262src/lang/english.txt L4441Code