Cite as
Factorio Wiki: Train path finder
Original
https://wiki.factorio.com/Train_path_finder
sha256
18aaead44093f44ef16ab1f1e13e9ae1cbd1ca3d1704d3ee66712c4ddee14c14
Archived
https://web.archive.org/web/20261026221656/https://wiki.factorio.com/Train_path_finder
Accessed
2026-10-26
Licence
CC BY-NC-SA 3.0
Credit
Official Factorio Wiki editors; see the page history.
Notes
Used for the path cost's base term (segment length) and the occupied-block penalty; the fixed penalties themselves are read in core/prototypes/utility-constants.lua.

Cited on

Claims (4)

The train pathfinder searches the rail graph, from both ends of the train when it can drive either way, for any stop with the scheduled name that isn't disabled, scoring each rail segment by its length, plus a penalty for an occupied block of twice its length divided by how many blocks it lies from the start.Path finding penaltiesPath finding penaltiesPath finding penaltiesWiki
On top of length, a path pays fixed penalties: 2000 for each train stop it passes, 1000 for a signal the circuit network holds red, 500 for a train standing at a stop (1000 if it has no other valid stop), 100 for a train arriving at a stop or signal, 100 plus 0.1 per tick waited for a train waiting at a signal, 1000 for a train with no path, 2000 for a manually driven train stopped with a passenger and 7000 without one, and 7000 for an automatic train with no schedule.Path finding penaltiesCode
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.Path finding penaltiesWiki
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.Path finding penaltiesPath finding penaltiesHistory, 0.18.1Code