modding:developerinfo:tracks

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

modding:developerinfo:tracks [2019/03/19 10:18] (current)
Line 1: Line 1:
 +===== Tracks =====
 +
 +==== Overview ====
 +
 +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:
 +
 +<code lua>
 +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
 +</​code>​
 +
 +=== Name, description,​ availability ===
 +
 +<code lua>
 +    name = _("​High-speed tracks"​)
 +    desc = _("​Specialized tracks for higher speeds"​)
 +
 +    yearFrom = 1925
 +    yearTo = 0
 +</​code>​
 +
 +=== Shape configuration ===
 +
 +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.
 +
 +<code lua>
 +    shapeWidth = 4.0                -- [m] shape width
 +    shapeStep = 4.0                 -- [m] shape step
 +    shapeSleeperStep = 8.0 / 13.0   -- [m] distance between sleepers
 +</​code>​
 +
 +=== Ballast configuration ===
 +
 +Ballast is the bed for track usually made from crushed stone. The height and material (see below) can be configured.
 +
 +<code lua>
 +    ballastHeight = .3              -- [m] height of the ballast
 +    ballastCutOff = .1              -- [m] amount ot cut off the profile from the top at a certain angle
 +</​code>​
 +
 +=== Sleeper configuration ===
 +
 +Sleepers (or ties) are the rail supports usually made from wood, concrete, or steel. The dimension and material (see below) can be configured.
 +
 +<code lua>
 +    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
 +</​code>​
 +
 +=== Rail configuration ===
 +
 +<code lua>
 +    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
 +</​code>​
 +
 +=== Catenary configuration ===
 +
 +Electrified tracks need catenary for the power transfer. The poles are instances of a model, whereas the cable is procedurally generated.
 +
 +<code lua>
 +    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
 +</​code>​
 +
 +=== Track configuration ===
 +
 +Multiple tracks
 +
 +<code lua>
 +    trackDistance = 5.0   -- [m] distance between track centers
 +</​code>​
 +
 +=== Speed configuration ===
 +
 +The maximum speed on straight segments is ''​speedLimit'',​ and on curved segments calculated according the formula below.
 +
 +<code lua>
 +    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
 +</​code>​
 +
 +=== Material configuration ===
 +
 +Material and model configuration. Bumper and switch signal models are optional.
 +
 +<code lua>
 +    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"​
 +</​code>​
 +
 +=== Cost configuration ===
 +
 +Maintenance cost was introduced with patch "Build 13240" on June 21, 2017, and is not active in the vanilla game.
 +
 +<code lua>
 +    maintenanceCost = 25.0   -- [$/m/M]
 +    cost = 80.0              -- [$/m]
 +</​code>​
 +
  
modding/developerinfo/tracks.txt · Last modified: 2019/03/19 10:18 (external edit)