Skip to content

MSTS Speedpost Configuration

perpetualKid edited this page Sep 13, 2026 · 1 revision

MSTS speedpost configuration (speedpost.dat)

Route-root speedpost.dat is an authoring catalog for speed-limit signs, warning signs, resume signs, and mileposts. A selected catalog definition is copied into a placed world Speedpost; operational speed, displayed number, train class, units, and orientation remain in linked TDB SpeedPostItem records.

Keeping these layers separate is essential: speedpost.dat is not a list of placed signs and does not contain each location's speed restriction.

On this page

Location and structure

The file normally resides at ROUTES/<route>/speedpost.dat and uses the Kuju/SIMISA structured-text family. The recovered structure has a Speedpost_Set_Count container with repeated Speedpost_Set records, plus temporary-restriction shape references:

Speedpost_Set_Count (
    declared-set-count
    *Speedpost_Set ( ... )
    [ Speed_Warning_Sign_Shape ( shape-file ) ]
    [ Restricted_Shape ( shape-file ) ]
    [ End_Restricted_Shape ( shape-file ) ]
    *unknown-record
)

Observed producer placement of the three temporary-restriction records needs broader comparison. TSRE5 parses them at the top level and has encountered files placing Restricted_Shape and End_Restricted_Shape where its Speedpost_Set parser regarded them as unknown. Preserve their exact scope and order instead of moving them automatically.

The presence of Speedpost_Set_Count in token tables and existing files supports the wrapper name. The examined TSRE5 loader iterates sets without enforcing the declared value, while the FTS/Open Rails reader intentionally reads only temporary-restriction shape names. Neither behavior establishes original MSTS count tolerance.

Top-level records

Record Recovered role Evidence
Speedpost_Set_Count Container carrying a declared set value and repeated definitions. Token vocabulary, content structure, independent implementation.
Speedpost_Set One named family of ordinary speed, warning, resume, and milepost display assets. Independent implementation.
Speed_Warning_Sign_Shape Shape used for a temporary restriction warning in the examined derived runtime. Derived and independent implementations.
Restricted_Shape Shape used at the start of a temporary restriction in the examined derived runtime. Derived and independent implementations.
End_Restricted_Shape Shape used at the end of a temporary restriction in the examined derived runtime. Derived and independent implementations.

FTS/Open Rails resolves the three top-level shape strings beneath the route SHAPES directory and warns when files are absent. That is derived lookup behavior; the serialized strings must survive failed resolution.

Speedpost_Set

The independently implemented TSRE5 reader recognizes this child inventory:

Speedpost_Set (
    Name ( text )
    [ Speed_Resume_Sign_Shape  ( shape-file face-count *face-tuple ) ]
    [ Speed_Warning_Sign_Shape ( shape-file face-count *face-tuple ) ]
    [ Speed_Sign_Shape         ( shape-file face-count *face-tuple ) ]
    [ Speed_Digit_Tex          ( texture-file ) ]
    [ Speed_Text_Size          ( glyph-size step-x step-y ) ]
    [ Milepost_Shape           ( shape-file face-count *face-tuple ) ]
    [ Milepost_Digit_Tex       ( texture-file ) ]
    [ Milepost_Text_Size       ( glyph-size step-x step-y ) ]
    *unknown-record
)

face-tuple = local-x local-y local-z rotation-degrees

The brackets describe observed optionality in implementations and content, not a proven original MSTS requiredness rule. An empty shape filename causes TSRE5 to retain no usable face array for that family. Preserve the empty string, any following count/token material, and the distinction between an absent record and an explicitly empty reference.

Shape tuples

Each sign or milepost shape record begins with a shape filename and a face count. It then carries that many ordered four-value tuples:

Position Interpretation in TSRE5
1 Local X offset of a text-bearing face.
2 Local Y offset.
3 Local Z offset.
4 Face rotation, read as degrees.

TSRE5 converts the fourth source value to radians when preparing copied world-object data. This conversion is implementation evidence and a representation boundary, not permission to rewrite the source token. Retain the original numeric lexeme and unit context; a normalized radian value may be stored separately.

The face count governs tuples within one shape record. It is independent of the number of Speedpost_Set records and independent of the number of TrItemId links later stored on a world object.

Text records

Speed_Digit_Tex and Milepost_Digit_Tex name texture resources used to draw variable text. Their exact original lookup precedence is unresolved.

Speed_Text_Size and Milepost_Text_Size each contain three numeric values. The examined world/runtime representation uses the first as glyph size and the next two as per-character X and Y offsets. Preserve all three raw values even when a renderer ignores one offset.

World and TDB copies

When TSRE5 places a catalog entry, it copies the selected family into the world object:

Catalog data World Speedpost data
selected shape filename FileName
face count and tuples Speed_Sign_Shape
digit texture Speed_Digit_Tex
text-size triple Speed_Text_Size

The world data is therefore a per-placement copy, not a live catalog reference. Editing speedpost.dat does not by itself prove that existing world objects are rewritten.

The linked TDB SpeedPostItem separately stores packed type/option flags, speed or milepost distance when applicable, an optional displayed number, and angle. One world object may link to several TDB items. See world speedposts, TDB speedpost items, and MSTS flags and selectors.

Validation and preservation

A validator can report:

  1. A declared set value inconsistent with serialized Speedpost_Set cardinality, while preserving both.
  2. A shape record whose available values do not match face-count * 4.
  3. Negative or otherwise suspicious counts without discarding the record.
  4. Missing shape or texture resources in the route context.
  5. A placed world copy that differs from its apparent catalog source, as a diagnostic rather than proof of corruption.
  6. World TrItemId links that do not resolve to compatible TDB SpeedPostItem records.

Lossless handling should retain the envelope, source encoding, declared count, set order, duplicate names, record order, empty and missing references, raw numeric strings, every face tuple, unknown records, and original nesting. Do not normalize degrees to radians in the source model, recalculate counts on load, or delete a definition merely because no current world object uses it.

Evidence and open questions

The broad catalog grammar and authoring-copy behavior come from independent TSRE5 sources: SpeedPostDAT.cpp, SpeedPost.cpp, and SpeedpostObj.cpp. FTS/Open Rails SpeedpostDatFile.cs independently within its lineage corroborates the three temporary-restriction names and route-shape lookup, but intentionally does not parse the ordinary catalog.

Still unresolved:

  • exact original requiredness, order, and count enforcement;
  • whether all producers place temporary-restriction records at the same nesting level;
  • exact coordinate basis and rotation convention for each face tuple in original MSTS;
  • original texture lookup precedence and accepted texture formats;
  • original behavior for empty families, missing assets, duplicate names, and malformed tuples;
  • whether existing world objects retain snapshots after catalog changes in every editor/runtime.

Navigation

User documentation

Development and architecture

MSTS domain knowledge

News archive

Clone this wiki locally