A track configuration files specifies a set of parameters to define the properties, dimension, features, and visuals of tracks. They are stored in .lua
files in the folder res\config\track\
.
The file has the following format:
function data() return { -- name, description, availability -- shape configuration -- ballast configuration -- sleeper configuration -- rail configuration -- catenary configuration -- track configuration -- speed configuration -- materials, models, textures configuration -- cost configuration } end
name = _("High-speed tracks") desc = _("Specialized tracks for higher speeds") yearFrom = 1925 yearTo = 0
Shapes represent the base geometry of the tracks and are used for collision tests, terrain alignment generation and generation of the procedural geometry. The width should be high enough to contain the actual procedural geometry. The step size allows for smoother curves (small) or less geometric primitives (high), which speed up collision checks.
shapeWidth = 4.0 -- [m] shape width shapeStep = 4.0 -- [m] shape step shapeSleeperStep = 8.0 / 13.0 -- [m] distance between sleepers
Ballast is the bed for track usually made from crushed stone. The height and material (see below) can be configured.
ballastHeight = .3 -- [m] height of the ballast ballastCutOff = .1 -- [m] amount ot cut off the profile from the top at a certain angle
Sleepers (or ties) are the rail supports usually made from wood, concrete, or steel. The dimension and material (see below) can be configured.
sleeperBase = ballastHeight -- [m] base height from ground level sleeperLength = .24 -- [m] length of the sleeper sleeperWidth = 2.6 -- [m] width of the sleeper sleeperHeight = .08 -- [m] height of the sleeper sleeperCutOff = .04 -- [m] amount ot cut off the profile from the top at a certain angle
railTrackWidth = 1.435 -- [m] track gauge (spacing between the rails) railBase = sleeperBase + sleeperHeight -- [m] base height from ground level railHeight = .15 -- [m] height of the rail railWidth = .07 -- [m] width of the rail railCutOff = .02 -- [m] amount ot cut off the profile from the top at a certain angle
Electrified tracks need catenary for the power transfer. The poles are instances of a model, whereas the cable is procedurally generated.
catenaryBase = 5.917 + railBase + railHeight -- [m] base height of the cable over ground level catenaryHeight = 1.35 -- [m] height of the support cable at the poles catenaryPoleDistance = 25.0 -- [m] distance between poles
Multiple tracks
trackDistance = 5.0 -- [m] distance between track centers
The maximum speed on straight segments is speedLimit
, and on curved segments calculated according the formula below.
speedLimit = 300.0 / 3.6 -- [m/s] maximum speed on a straight track speedCoeffs = { .9, 15.0, .63 } -- curve speed limit = a * (radius + b) ^ c
Material and model configuration. Bumper and switch signal models are optional.
ballastMaterial = "track/ballasmtl" sleeperMaterial = "track/sleeper_concrete.mtl" railMaterial = "track/rail.mtl" catenaryMaterial = "track/catenary.mtl" trackMaterial = "track/track_high_speed.mtl" tunnelWallMaterial = "track/tunnel_ug.mtl" tunnelHullMaterial = "track/tunnel_hull.mtl" catenaryPoleModel = "railroad/power_pole_2.mdl" catenaryMultiPoleModel = "railroad/power_pole_1.mdl" catenaryMultiGirderModel = "railroad/power_pole_1a.mdl" catenaryMultiInnerPoleModel = "railroad/power_pole_1b.mdl" bumperModel = "railroad/bumper.mdl" switchSignalModel = "railroad/switch_box.mdl" fillGroundTex = "ballast_fill_stone" borderGroundTex = "ballast"
Maintenance cost was introduced with patch “Build 13240” on June 21, 2017, and is not active in the vanilla game.
maintenanceCost = 25.0 -- [$/m/M] cost = 80.0 -- [$/m]