Skip to content
perpetualKid edited this page Oct 25, 2026 · 7 revisions

Service files (.srv)

An MSTS service file defines a reusable train service: the consist to run, the path it follows, default performance, and an ordered station-stop template. Service files normally reside in ROUTES/<route>/SERVICES/ and are referenced by activities or traffic definitions. A scheduled instance's start time and arrival/departure times belong to the activity/traffic records, not the examined .srv timetable.

This page compares the derived FTS/Open Rails lineage with independent TSRE5 readers/writers, published Open Rails authoring guidance, and a read-only community-content sample. These establish useful structure and producer behavior, not a complete original MSTS specification. Unresolved acceleration, speed, selector, and default semantics follow MSTS units and numeric values.

On this page

Serialization and outline

A service uses Kuju/SIMISA structured serialization. A simplified outline is:

SIMISA...service-signature...

Service_Definition (
    Serial ( serial-value )
    Name ( service-name )
    Train_Config ( consist-name )
    PathID ( path-name )
    MaxWheelAcceleration ( value )
    Efficiency ( value )
    TimeTable (
        StartingSpeed ( value )
        EndingSpeed ( value )
        StartInWorld ( value )
        EndInWorld ( value )
        StationStop (
            PlatformStartID ( track-item-id )
            DistanceDownPath ( distance )
            SkipCount ( path-stop-index )
        )
        ...
    )
)

The exact signature and encoding must be detected from the file. Preserve unknown records, raw values, count fields, record order, and absent-versus-explicit values.

TSRE5's writer emits UTF-16 with a BOM and SIMISA@@@@@@@@@@JINX0v0t______. The inspected SCE service has the same signature and a UTF-16LE BOM. This is producer/observed-content evidence, not a claim that other envelopes are invalid.

Core records

Record Working interpretation Evidence status
Serial Serialized revision/serial value Common implementation field; do not assume a format-version selector.
Name Service display name, distinct from the referenced service filename stem FTS reader/runtime and TSRE5 evidence.
Train_Config Consist name, normally resolved under TRAINS/CONSISTS/ Cross-file implementation evidence; exact lookup rules remain open.
PathID Path name, normally resolved under the route's PATHS/ directory Cross-file implementation evidence.
MaxWheelAcceleration Maximum wheel acceleration value Parser field; units and defaults require original-content confirmation.
Efficiency Default performance factor Open Rails manual describes the MSTS editor's percentage divided by 100; 0.75 represents 75%. Original range enforcement and absent-value defaults remain open.
TimeTable Stop template and initial/final state fields TSRE5 reads/writes nested StationStop records; the examined FTS reader retains only StartingSpeed.

Timetable stop template

The .srv TimeTable is not the flat arrival/departure schedule used in .act and .trf. TSRE5 Service::load / save corroborate this nested, count-free template:

Record Interpretation and boundary
StartingSpeed / EndingSpeed Serialized initial/final speed values. TSRE5 retains both; FTS reads only StartingSpeed, with its generic numeric unit category rather than a speed-specific reader. Do not infer an original unsuffixed speed unit from that reader alone.
StartInWorld / EndInWorld Numeric start/end selectors retained by TSRE5. Names suggest boundary/spawn behavior, but original value mappings and runtime effects are unresolved.
StationStop Repeated nested stop record, with no leading count in the examined writer/sample.
PlatformStartID TDB platform track-item reference; not a station-name index or world-object UID.
DistanceDownPath Distance along the selected path. Derived activity/traffic readers interpret this family as distance with metres as the unsuffixed default; original .srv unit rules are not independently specified here.
SkipCount Path-stop selection/index value. TSRE5 assigns the path-object ordinal, retaining gaps when stops are deselected. Do not interpret it as a count of repeated following records or blindly renumber it.

The observed SCE service contains four stops with SkipCount values 0, 1, 4, 8, alongside increasing distances. This supports sparse selection, not a requirement for consecutive stop indices. TSRE5 builds these fields from path objects; acceptance of every sparse or malformed variant by MSTS is untested.

The narrow FTS TimeTable model is not evidence that EndingSpeed, the world selectors, or StationStop bodies are invalid or disposable. A lossless reader must retain them even if its simulator does not consume them.

Service template and scheduled instances

Owner Data carried
.srv Service_Definition Consist/path selection, default Efficiency, and nested stop template.
.act Player_Service_Definition Service filename stem; nested Player_Traffic_Definition with start and stop times. TSRE5/sample content also retain player UID/per-stop performance metadata outside that nested schedule.
.act Traffic_Definition / Service_Definition Traffic filename stem; each AI service stem and start time, UID, and per-stop performance/path fields.
.trf Traffic_Definition / Service_Definition Traffic name/serial; each service stem and start time, followed by arrival/departure/path fields.

The same token name therefore has different grammars depending on its owner. A .srv root is not an embedded AI service instance, and a .trf entry does not supply a new consist/path definition.

The Open Rails manual's Default Performance and Performance Parameters section distinguishes the .srv default factor from per-section Efficiency values in the activity's AI service records. It describes the latter as the next stop's section performance, with the default used after the last stop. These are published compatibility/authoring claims, not newly tested original-runtime rules.

See traffic schedules and time domains for concrete instance grammars. Do not regenerate schedules merely because the service template has changed: the observed activity's player stops differ from its service template.

Platform and path references

PlatformStartID belongs to the selected route's rail TDB track-item domain. In the examined FTS activity runtime it is used as a zero-based track-item array lookup, checked for a platform item; that item's linked platform endpoint supplies the other boundary. It is not a TrackNode index, tile-local world UiD, station label, or index into the stop list.

TSRE5 generates stop platform IDs from path objects' trItemId, independently supporting the TDB relationship. The original editor's endpoint-choice rules under path reversal remain open. Preserve the actual endpoint ID rather than replacing it with a preferred endpoint or station name.

Validate both identity and path context: the platform should resolve in the owning route, and the stop's distance/selection should agree with the intended path occurrence. A valid TDB item alone does not establish the right visit when a path reverses or passes a platform twice. Distinct IDs, endpoint pairing, and lookup states follow MSTS coordinates and identity and MSTS references, collections, and graphs.

Cross-file relationships

Service, path, and consist logical names and filename candidates follow MSTS names and resource lookup.

flowchart LR
    ACT[activity.act] -->|player or AI service reference| SRV[service.srv]
    SRV -->|Train_Config| CON[consist.con]
    SRV -->|PathID| PAT[path.pat]
    PAT -->|spatial anchors| TDB[route.tdb]
    SRV -->|route context| TRK[route.trk]
Loading

A service's consist selects rolling-stock vehicles through the consist file, while PathID selects a .pat path whose points must resolve onto the route's TDB. The same service can participate in more than one activity, so a service parser must not attach activity-only events or objects to the .srv model.

Implementation differences and open questions

FTS/Open Rails parse services as part of the derived MSTS format lineage. TSRE5 independently edits the fuller stop template. The examined FTS ServiceFile keeps display name, consist/path, acceleration, efficiency, and a narrow TimeTable with initial speed; it does not provide a lossless model of all service records.

Requiredness, original speed/acceleration/distance unit rules, StartInWorld / EndInWorld mappings, serial semantics, malformed stop handling, and defaults remain open. The observed/writer signature and the manual's performance scale reduce earlier uncertainty but do not define every accepted encoding or range.

Validation checklist

  • Detect the actual SIMISA envelope and encoding.
  • Validate the root and preserve the declared serial value.
  • Resolve Train_Config and PathID without replacing the raw names.
  • Validate timetable order, counts, station/platform references, and path distances.
  • Preserve unknown timetable records, duplicate entries, skipped stops, and raw time values.
  • Keep service data separate from activity events and traffic-list metadata.
  • Distinguish the nested stop template from flat timed schedules; preserve endpoint choice and nonconsecutive SkipCount values.

Sources

  • Open Rails ServiceFile.cs: derived service parser and timetable records.
  • FTS service format code in the Orts.Formats.Msts source tree: derived format implementation.
  • TSRE5 activity/service structures in Activity.h and ActivityTimetable.h: independent editor evidence.
  • TSRE5 Service.cpp, load, save, setNewPath, and enableStationStop: service template grammar, writer encoding, and path-stop ordinals; ActivityTimetable.cpp, reloadTimetable, load, and save: schedule/template relationship. Inspected 25 October 2026.
  • FTS ServiceFile.cs, TimeTable.cs, and runtime Activity.cs, constructor: narrow reader and platform endpoint resolution.
  • Open Rails Train Operation manual, Default Performance and Performance Parameters: editor percentage/factor relationship and default versus per-section performance.
  • Read-only SCE community service/activity/traffic samples: identities, hashes, scope, and provenance limits are recorded under Service and traffic schedule evidence. No content assets are republished.
  • [[Activity files (.act)|MSTS-Activity-Files]] and [[Path files (.pat)|MSTS-Path-Files]]: consuming activity and path contracts.

Navigation

User documentation

Development and architecture

MSTS domain knowledge

News archive

Clone this wiki locally