"Throttle-power" container: Difference between revisions

From TrainzOnline
Jump to navigationJump to search
Expand on how Trainz code determines power output for engines with more than 8 throttle notches
Pware (talk | contribs)
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 8: Line 8:


Note that a maximum of 8 such containers is supported, to match the common use-case of 8 throttle notches. Any extra containers will be unused. For engine assets with more than 8 throttle notches, the maximum throttle notch will map to the notch 8 data in the config file, the middle throttle notch will map to notch 4, etc. The game code will use linear interpolation to determine the power output for the other (in between) throttle notches, as required.
Note that a maximum of 8 such containers is supported, to match the common use-case of 8 throttle notches. Any extra containers will be unused. For engine assets with more than 8 throttle notches, the maximum throttle notch will map to the notch 8 data in the config file, the middle throttle notch will map to notch 4, etc. The game code will use linear interpolation to determine the power output for the other (in between) throttle notches, as required.
The throttle-power container tags '''SHOULD''' be integer values (e.g. 1, 2, 3, etc). A bug in Trainz Plus SP7 that would not accept decimal values (e.g. 1.0, etc) has been fixed in Trainz Plus SP8.


==Example throttle-power container==
==Example throttle-power container==

Latest revision as of 04:36, 27 August 2026

The Throttle-power container is a top-level config.txt file entry used by Enginespec assets.

Supported Tags

The Throttle-power container has a sequence of numeric subcontainers. Each one refers to a specific throttle notch.

Within each subcontainer, there are a series of numeric named lines. Each line specifies a speed (m/s) and a tractive effort (kN) value. Together, these points define a tractive effort graph for a specific throttle notch.

Note that a maximum of 8 such containers is supported, to match the common use-case of 8 throttle notches. Any extra containers will be unused. For engine assets with more than 8 throttle notches, the maximum throttle notch will map to the notch 8 data in the config file, the middle throttle notch will map to notch 4, etc. The game code will use linear interpolation to determine the power output for the other (in between) throttle notches, as required.

The throttle-power container tags SHOULD be integer values (e.g. 1, 2, 3, etc). A bug in Trainz Plus SP7 that would not accept decimal values (e.g. 1.0, etc) has been fixed in Trainz Plus SP8.

Example throttle-power container

Here is an example throttle-power container. (Several notches have been omitted for brevity - the format is identical throughout).

throttle-power
{
  0
  {
    0                                   0
  }
  
  1
  {
    0                                   165
    2.2                                 83
    4.4                                 55
    6.6                                 41
    8.8                                 33
    13.0                                0
  }

....

  8
  {
    0                                   1320
    2.2                                 800
    4.4                                 750
    5.5                                 700
    6.6                                 480
    8.8                                 250
    11.25                               200
    13.3                                195
    28.5                                190
    30.0                                26
    31.0                                0
  }
}

Note that the high notch values are way beyond what the loco can actually put into the track at low speed - this loco cannot be opened up to full throttle at very low speeds, otherwise it's wheels will slip. The max tractive effort it can put into the rails before slipping is configured in the loco config file - the reason for this is that the weight of the loco (also set in the loco config file) will affect this value.