Repository navigation
MSTS Signals and Scripting
Microsoft Train Simulator signaling is a route subsystem spread across configuration, scripts, shapes, world placement, and the track database. No single file is a complete signal definition:
-
sigcfg.datdefines light resources, signal types, visual states, aspects, and signal shapes; -
sigscr.dat, or a producer-named equivalent, contains the logic for named signal types; -
.sfiles provide the animated model and named subobjects; - world
.wfiles place a signal shape and enable selected subobjects; - the route
.tdblocates operational signal heads on the track graph and stores route links.
This page documents original MSTS structures, observed content, and later implementation evidence separately. Signal rules are route- and railway-specific; names and examples are not universal aspect standards.
Signal functions, aspects, states, draw states, and option flags use the shared MSTS flags, selectors, and enumerations model. Resolve script, shape, texture, and sound names using their owning contexts as described in MSTS names and resource lookup.
On this page
-
Architecture: Files and relationships ·
sigcfg.dat· Signal shapes · Script-file declarations - Configuration: Light resources · Head display grammar · Aspect mappings · Configuration validation
- Logic: Signal scripts · Language and declarations · Operators and compatibility · Constant domains · State and draw state · Documented function families · FTS runtime profile
- Integration: World and TDB links · Observed variants · Preservation
- Research: Implementation boundaries · Open questions · Sources
The common route-level arrangement is:
<route>/
|-- sigcfg.dat signal types, aspects, lights, and shapes
|-- sigscr.dat signal logic; producers can use another basename
|-- SHAPES/
| `-- <signal>.s animated signal model and subobjects
|-- TEXTURES/
| `-- <signal>.ace shape and lamp textures
|-- WORLD/
| `-- w...w placed Signal objects
`-- <route>.tdb SignalItem records and track/junction relationships
Global and route-local sigcfg.dat and sigscr.dat files all occur in preserved content. Their lookup, replacement, and fallback precedence must be documented per consumer; do not flatten global and route definitions into one collection during preservation.
The observed SCE files demonstrate Unicode SIMISA structured text for sigcfg.dat and ordinary text with C-like syntax for its producer-named signal script file. As with other MSTS extensions, the filename alone must not be used to infer encoding.
The primary-era configuration note and examined files describe a sequence of top-level collections rather than one route-object root. The resource/type/shape collections carry numeric headers; the script-file list does not:
LightTextures ( texture-count
LightTex ( texture-id "texture.ace" u0 v0 u1 v1 )
)
LightsTab ( colour-count
LightsTabEntry ( colour-id colour ( alpha red green blue ) )
)
SignalTypes ( type-count
SignalType ( "type-name" ... )
)
SignalShapes ( shape-count
SignalShape ( "shape.s" "description" ... )
)
ScriptFiles (
ScriptFile ( "sigscr.dat" )
)
Collection headers and record order are serialized data. Their meaning is collection-specific: the note describes some as entry counts and the SignalLights/SignalDrawStates headers as maximum sequence number plus one. Preserve both declared metadata and actual cardinality; do not assume every leading integer is the same kind of count.
LightTextures maps an identifier to an ACE filename and four numeric texture-coordinate values. LightsTab maps another identifier to a four-component colour value. The observed signal types reference these identifiers rather than repeating texture names and colors.
The recovered authoring note's configuration-format description specifies u0 v0 as the top-left corner and u1 v1 as the bottom-right corner, using texture coordinates from 0 to 1. FTS independently reads four floats and documents U left-to-right and V top-to-bottom. These are texture coordinates, not world distances.
The same note explicitly defines colour ( a r g b ) with unsigned integer components and alpha 255 meaning opaque. The derived FTS reader corroborates this by reading alpha first, then constructing its runtime colour from the following red, green, and blue values. This is stronger evidence than the earlier inference from a first component of 255 in observed files. Preserve the original component tokens rather than replacing them with normalized runtime colour values.
A SignalType names one logical head type. Records observed within signal types include:
| Record | Observed role |
|---|---|
SignalFnType |
Functional category. Observed values include NORMAL, DISTANCE, SHUNTING, REPEATER, and INFO. |
SignalLightTex |
Selects a LightTex identifier. |
SigFlashDuration |
On-duration followed by off-duration, according to the authoring note. Original timing units and precise runtime phase behavior remain unconfirmed here. |
SignalLights / SignalLight
|
Defines indexed lamps using a color identifier, Position, Radius, and optional flags. |
SignalDrawStates / SignalDrawState
|
Defines indexed visual states and the lamps or semaphore position active in each state. |
DrawLights / DrawLight
|
Selects one or more local lamp indices; an individual selection can carry SignalFlags ( FLASHING ). |
SemaphoreInfo |
Supplies a numeric parameter for semaphore types; its exact physical meaning remains unresolved. |
SignalFlags |
Type or light flags. Observed values include SEMAPHORE and SEMAPHORE_CHANGE. |
SignalAspects / SignalAspect
|
Maps named operational indications to default draw-state names and optional speed records. |
SignalNumClearAhead |
Declares a look-ahead-related value; its complete original MSTS semantics remain unresolved. |
Observed aspect names include STOP, STOP_AND_PROCEED, RESTRICTING, APPROACH_1, APPROACH_2, APPROACH_3, CLEAR_1, and CLEAR_2. Some SignalAspect records carry SpeedMPH; absence of a speed record must remain distinct from an explicit zero.
Identifiers such as a_..., b_..., and c_... form separate reference spaces in observed files. Preserve them as opaque identifiers. Their prefixes and numeric suffixes are not established field semantics.
The authoring note's configuration-format description and the derived parser support these nested record shapes. This is a structural excerpt, not a complete mandatory SignalType template; optionality and malformed-input tolerance must not be inferred from its layout:
SignalLights ( lamp-index-bound
SignalLight ( lamp-index colour-name
Position ( x y z )
Radius ( radius )
SignalFlags ( light-flag ... )
)
...
)
SignalDrawStates ( draw-state-index-bound
SignalDrawState ( draw-state-index "draw-state-name"
DrawLights ( selection-count
DrawLight ( lamp-index
SignalFlags ( draw-light-flag ... )
)
...
)
SemaphorePos ( animation-key )
)
...
)
The domains are deliberately different:
| Value | Owning domain |
|---|---|
lamp-index |
Zero-based sequence ID in this head type's SignalLights; a DrawLight references this ID. |
colour-name |
Named entry in the top-level LightsTab, not a lamp number. |
draw-state-index |
Zero-based visual-state ID within this head type. |
draw-state-name |
Name used by SignalAspect to select its default visual state. |
animation-key |
Semaphore-arm animation position, documented as a floating-point keyframe value; not a lamp index or duration. |
Position is an offset from the signal subobject's origin according to the note, not a tile/world location. It defines Radius as a light radius but does not explicitly establish the spatial units in this passage.
The note describes the lamp and draw-state headers as maximum sequence ID plus one. Thus a header can describe an index extent rather than the number of physically present records if IDs are sparse. That distinction does not prove original MSTS accepts sparse collections; record the extent, actual count, and IDs separately. DrawLights, in contrast, describes the selected-light collection.
SignalFlags is context-dependent. Type flags, lamp flags, draw-light flags, and aspect flags are not one interchangeable domain. The derived reader interprets lamp SEMAPHORE_CHANGE and draw-light FLASHING; unknown strings must remain preserved under their original owner.
TSRE5 independently reads lamp IDs, colour names, positions/radii, draw-state IDs/names, and selected lamp IDs. Its reader obtains SemaphorePos into an integer local that is not retained there, and several other signal-type branches are stubs. That partial support corroborates structure, not fractional-key preservation or full signal behavior.
The primary-era note defines an operational indication and a default draw-state name, followed by optional speed and flag records:
SignalAspects ( aspect-count
SignalAspect ( indication-name "default-draw-state-name"
SpeedMPH ( speed )
SignalFlags ( aspect-flag ... )
)
...
)
SpeedKPH ( speed ) is the documented alternative speed record. SpeedMPH explicitly denotes miles per hour and SpeedKPH kilometres per hour; this is not an implied unit chosen from a route setting. The note describes their operands as unsigned integers, while FTS accepts floating-point values and converts either unit to internal metres per second. Keep documented authoring type and implementation acceptance separate.
The default mapping resolves by draw-state name within the owning head type. Runtime draw_state and a SignalDrawState sequence ID belong to the visual domain; neither is the indication string, lamp ID, or shape-subobject index.
The FTS parser initializes an absent aspect speed to an internal sentinel of -1. That does not establish an authoring requirement to write SpeedMPH ( -1 ). If both speed records or repeated records occur, retain them and diagnose ambiguity instead of selecting one as a universal MSTS rule. The examined derived reader overwrites its single normalized speed as records are processed.
OR_SPEEDRESET and OR_NOSPEEDREDUCTION are explicitly marked Open Rails-only by the derived aspect parser. Their acceptance must not expand the original vocabulary silently. See the shared numeric-value and symbolic-domain foundations.
Validate this chain without merging its identifier domains:
-
SignalLightTexresolves toLightTex, which resolves its texture filename in context. - Each
SignalLightcolour name resolves toLightsTabEntry. - Each
DrawLightselects an existing lamp ID in the same head type. - Each
SignalAspectdefault draw-state name resolves within that type. - Declared index extents, actual counts, duplicate IDs/names, and out-of-range selections are reported independently.
- Semaphore key values are compared with the applicable shape animation without rounding fractional keys automatically.
- Each script filename resolves under a documented lookup context, and each logical head/script association is checked separately.
Report unresolved or ambiguous relationships without creating missing lamps, renumbering IDs, substituting draw states, or discarding unknown records. The derived parser's dictionaries and bounded lists may omit duplicates or extra entries; successful parsing is not proof of a lossless representation.
Each SignalShape associates an .s filename and display description with a counted SignalSubObjs collection:
SignalShape ( "signal.s" "description"
SignalSubObjs ( subobject-count
SignalSubObj ( index "matrix-name" "description"
SigSubType ( SIGNAL_HEAD )
SigSubSType ( "type-name" )
SignalFlags ( OPTIONAL JN_LINK )
SigSubJnLinkIf ( 1 2 )
)
)
)
The subobject index is the index selected by a world SignalUnit. The following subobject categories occur in the observed route:
-
SIGNAL_HEAD: an operational head whoseSigSubSTypeselects aSignalType; -
NUMBER_PLATEandGRADIENT_PLATE: feature subobjects exposed to signal logic; -
DECOR: non-operational visible structure; -
USER1throughUSER4: producer-defined features interpreted by scripts.
Observed SignalFlags include DEFAULT, OPTIONAL, and JN_LINK. SigSubJnLinkIf occurs on signal heads, but the two numeric values and their interaction with JN_LINK need primary-source confirmation. Preserve unknown categories, flags, repeated matrix names, and original subobject order.
The primary-era note explicitly lists script sources in sigcfg.dat:
ScriptFiles (
ScriptFile ( "example-signals.dat" )
ScriptFile ( "example-shunting.dat" )
)
These names are illustrative. This collection has repeated ScriptFile blocks and no leading count. The FTS/Open Rails configuration reader corroborates that grammar and retains an ordered filename collection. The conventional sigscr.dat basename is therefore not the only possible source: a producer-named file is associated through a declaration, not merely by sharing a directory.
Do not confuse this list with the name of a SCRIPT inside a file. One source can contain several scripts; type-to-script association and source-file lookup are separate relationships.
The examined FTS runtime passes the declared list and a script root to its loader. It normally derives the root from the selected configuration's directory but can receive a ScriptFilesPath override. This is implementation behavior, not a recovered universal rule for original MSTS global/route precedence. Preserve relative names, list order, repeats, and unresolved sources using the named-resource model.
Signal scripts use a C-like language but are not C source files. A script begins with SCRIPT and a name; its statements continue until the next SCRIPT declaration or end of file. The observed files do not wrap each script in a mandatory outer brace block.
SCRIPT example_name
extern float block_state ();
extern float def_draw_state ();
extern float state;
extern float draw_state;
if (block_state() !=# 0)
{
state = 0;
}
draw_state = def_draw_state(state);
The language includes comments, extern float declarations, local float variables, assignment, arithmetic, function calls, if/else, braces, and semicolon-terminated statements. Observed boolean operators include !, &&, and ||. Observed comparison operators include ==#, !=#, <#, >#, <=#, and >=#; these spellings must not be normalized to C operators in preserved source.
The primary-era note's Signal Script File Format defines SCRIPT name as a boundary: the body continues until the next marker or end of file. REM SCRIPT name comments out that script, and text preceding the first marker is ignored under the documented loader contract. Script names use alphanumeric characters and underscores.
That note explicitly describes its script loader as ASCII, not Unicode. This is a historical authoring contract, not proof that every later loader rejects other encodings. Keep script-source encoding distinct from the Unicode STF configuration; do not add a SIMISA wrapper to a script merely because its extension is .dat.
The Data Types and Function and Variable Declarations sections describe:
- One declared numeric type,
float, with no pointer types. - Local variables and external variables/functions declared at the beginning of a script.
-
extern float name;for supplied variables, andextern float name();for supplied functions; argument lists are omitted in these declarations. - Input/output through external variables and supplied functions, not direct calls to another named script or user-defined functions inside the body.
-
//line comments and/* ... */block comments, semicolon-ended statements, and brace-delimited blocks.
Hoevet's Part 1, revision 5, pages 4-8 and 13-14, independently explains these language/declaration concepts. A source declaration of float does not prove that a particular reimplementation evaluates using floating-point storage.
The note's Function Calls section describes float return values, arguments passed by reference, and a loader without parameter-count checking. Treat these as historical documentation, not as safe authoring practice or a contract implemented by FTS/Open Rails. Validate known function signatures and never infer correctness solely from a successful load.
The primary-era Operators section and Hoevet Part 1, pages 7, 9-12, and 15-18, describe the following families:
| Family | Documented forms and boundary |
|---|---|
| Assignment |
=, arithmetic compound assignments, #=, and /#=. |
| Arithmetic |
+, -, *, /, %/mod, /#/div, increment/decrement, and unary #. |
| Comparison | Ordinary comparisons and rounded forms ==#, !=#, <#, >#, <=#, >=#. |
| Logic |
&&/and, ` |
| Control |
if/else, conditional ?:, loops, break, continue, and return are listed in the note's general scripting-system description. |
The note defines unary # and #= in terms of rounding to the nearest integer. Rounded comparisons round both operands before comparing. Its integer-division description rounds operands first and describes the resulting quotient as rounded down. Tie handling, negative values, overflow, and exact precision have not been experimentally established here.
The note refers readers to C precedence and associativity; it does not supply a full standalone precedence table. Do not silently apply a host language's precedence or translate these operators while claiming behavioral equivalence.
There is a material documentation/implementation boundary: the examined FTS SignalScripts.cs maps both rounded and ordinary comparison spellings onto the same comparison enum, and ParameterFromToken recognizes integer literals through int.TryParse. Its operator and logical-operation tables model a narrower set than the general authoring note describes. Those observations do not prove support for the note's complete loop, floating-point, rounding, or by-reference semantics.
Preserve valid-looking but unsupported source and report the consumer's limitations. Do not delete loops, rewrite rounded operators, or replace decimal literals with integers as an implicit compatibility repair.
The authoring note's Values and Flags supplies named domains. Configuration values generally omit the domain prefix, whereas scripts use the full constant name. These are typed symbols, not interchangeable numeric selectors:
| Domain | Documented members or purpose |
|---|---|
SIGASP_ |
STOP, STOP_AND_PROCEED, RESTRICTING, APPROACH_1, APPROACH_2, APPROACH_3, CLEAR_1, CLEAR_2, listed in order from most to least restrictive. |
SIGFN_ |
NORMAL, DISTANCE, REPEATER, SHUNTING, INFO; selects the functional category queried by signal functions. |
BLOCK_ |
CLEAR, OCCUPIED, JN_OBSTRUCTED; describes block/route obstruction, not the displayed indication. |
SIGFEAT_ |
NUMBER_PLATE, GRADIENT_PLATE, USER1 through USER4; queries enabled same-facing shape features. |
This list documents names and meanings, not a universal numeric encoding table. In particular, the integer representation of a function category is not a lamp ID, shape-subobject index, draw-state ID, or indication code merely because the numbers coincide.
The note says only SIGFN_NORMAL heads impose train actions; other categories support signaling logic. This is the documented original model, not a restriction automatically applicable to enhanced implementations. FTS's registry and external-function enum include later facilities; their presence alone does not establish original MSTS support.
Scripts commonly assign two externally supplied variables:
-
stateis the operational aspect state exposed to signaling logic; -
draw_stateselects a visual state declared by the correspondingSignalType.
They are related but not interchangeable. One script can select a special draw_state for the same operational state, for example when optional shape features alter the displayed indication. def_draw_state(state) is commonly used to obtain the configured default mapping.
The type-dependent default mapping is from operational indication to draw state. This is distinct from the implementation's encoding of SIGASP_ constants. Do not infer either encoding or a universal visual meaning solely from one route's numeric literals.
The note's Signal Logic I/O and Functions marks state and draw_state as both input and output, but enabled as input-only. enabled means the head is enabled to show its natural state, not simply that its world subobject is visible. Preserve that distinction when interpreting decorative features or multi-head masts.
The following contracts come from the primary-era Signal Logic I/O and Functions entries. Hoevet Part 2, revision 4, pages 10-19 and Appendix B (pages 23-25), provides independent community discussion of occupancy, next signals, enablement, features, and additional queries. These are not newly measured runtime results.
| Function | Parameters and documented result |
|---|---|
block_state() |
Returns a BLOCK_ value for the block ahead; clear if unoccupied, otherwise the encountered non-clear condition. |
route_set() |
Tests whether the route follows this head's junction link; the note specifies true when the head has no junction link. |
next_sig_lr(fn) / next_sig_mr(fn)
|
Least/most restrictive indication among matching function-category heads in the next signal set; documented missing-match result SIGASP_STOP. |
opp_sig_lr(fn) / opp_sig_mr(fn)
|
Queries the next opposing signal for the category; documented missing-match result SIGASP_STOP. |
this_sig_lr(fn) / this_sig_mr(fn)
|
Queries matching same-position, same-facing heads; documented missing-match result -1, not SIGASP_STOP. |
dist_multi_sig_mr(fn, end_fn) |
Searches ahead to a terminating function category, accumulating the most restrictive matching indication; the note includes matching start/end heads and checks junction links. Missing terminator yields SIGASP_STOP. |
sig_feature(feature) |
Tests a SIGFEAT_ feature among same-facing shape subobjects. |
def_draw_state(indication) |
Returns the configured default draw-state index for the supplied operational indication. |
Here lr and mr denote least and most restrictive, not left/right. A documented signal instance set groups heads at the same track position and facing in the same direction; it is not every subobject on the physical mast.
The note cautions that same-position queries depend on update ordering: it recommends querying SIGFN_NORMAL from a non-normal head rather than assuming every other head has already updated. Preserve this as a documented scheduling constraint; modern runtimes may differ.
Return domains and missing-match outcomes matter. A tool must not coerce -1 into a stop indication or false merely because all are represented numerically. Keep later functions, constants, and alternative search behavior in an implementation-specific profile.
The following functions occur in the observed SCE script set:
| Function | Safely documented observation |
|---|---|
block_state() |
Returns a value tested for block or junction obstruction. The complete value table is not established here. |
route_set() |
Returns a value used to decide whether a route is set for the signal. |
this_sig_lr(value) |
Queries same-position heads by function category; observed numeric arguments include 0, 3, and 4, whose raw spelling must remain preserved. |
next_sig_lr(value) |
Queries the next signal by function category; observed numeric arguments include 0, 3, and 4. |
def_draw_state(value) |
Maps an operational state to a configured draw state. |
sig_feature(value) |
Reads configured subobject features; observed selectors include 4, 6, 7, 8, and 9. |
dist_multi_sig_mr(...) |
Occurs in distance-signal logic; the documented two-category contract is described above, while exact runtime search behavior remains to be tested. |
state, draw_state, and enabled occur as external variables. BLOCK_JN_OBSTRUCTED occurs as a named constant in observed route content. Later implementations expose additional named constants and functions; their presence in Open Rails or FTS does not establish original MSTS support.
The logical association between a SignalType and a SCRIPT is name-based. Observed files contain case differences such as UK_4_Aspect and UK_4_ASPECT; preserve exact spelling and case even where Windows-era consumers appear to match names without case sensitivity.
The complete placed signal crosses three schemas:
-
sigcfg.datdefines aSignalShape, its indexed subobjects, and each head'sSigSubSType. - A world
Signalselects the shape filename, enables subobjects throughSignalSubObj, and writes oneSignalUnitfor each operational head. - Each
SignalUnitcarries a database selector and item ID. Ordinary rail heads select database 0 and a TDBSignalItem. - The TDB
SignalItemstores position, facing, rotation, signal subtype, and optionalTrSignalDirjunction links. - The signal subtype should agree with the selected shape head's
SigSubSTypeand identify the logical signal type whose script computesstateanddraw_state.
One world signal shape can therefore represent several operational heads. Enabled decorative or feature subobjects do not automatically receive TDB items. See world signal objects and TDB signal items for their complete local records.
The SCE mixed-content corpus contains one Unicode structured-text sigcfg.dat with 49 light textures, four color-table entries, 66 signal types, and 34 signal shapes. Its producer-named script file contains 68 SCRIPT declarations covering color-light, searchlight, ground, route-indicator, theatre, banner-repeater, semaphore, track-start, and home-indicator roles.
The wider preserved corpus contains both global and route-local signal configuration and script files, uppercase and lowercase filenames, conventional and producer-prefixed script basenames, and Open Rails-specific override directories. These observations establish producer diversity, not universal lookup precedence.
- Preserve the SIMISA envelope, text encoding, comments, record order, declared counts, identifier spelling, and case.
- Preserve unknown signal types, functions, aspects, flags, script functions, selectors, and numeric states.
- Keep
state,draw_state, aspect names, draw-state IDs, lamp indices, and shape-subobject indices as distinct domains. - Do not renumber shape subobjects without coordinated changes to world
SignalUnitrecords and the model hierarchy. - Do not merge global, route-local, and Open Rails override files unless the source precedence is recorded separately.
- Preserve missing script/type/shape references as diagnosable unresolved links; do not silently substitute a default.
- Keep original MSTS records separate from later implementation extensions and producer conventions.
FTS and Open Rails are one derived parser/runtime lineage for evidence purposes. Their accepted function set, constants, fallback behavior, diagnostics, and extensions describe those implementations, not automatically the original MSTS language.
TSRE5 independently corroborates the broad relationship among signal configuration, shape subobjects, world SignalUnit records, and TDB SignalItem records. Its editing defaults and repair behavior remain implementation evidence.
The SCE files are observed community content. They establish that the documented structures and producer variants occur, but do not by themselves prove which fields are mandatory or how every MSTS release handles malformed data.
This profile records behavior in the examined FTS legacy signal-script interpreter and signal update path. Open Rails shares ancestry with FTS for this evidence and is not independent confirmation. These observations are not controlled MSTS tests.
| Area | Examined FTS behavior | Boundary against documented MSTS contract |
|---|---|---|
| Numeric storage | Script parameters, locals, expression results, state, draw_state, and enabled are evaluated through integer values and integer arrays, despite the source language's float declarations. Decimal literals are not accepted by the parameter path's int.TryParse branch as numeric constants. |
This does not establish MSTS numeric precision, rounding, or decimal-literal behavior. |
| Rounded operators | The parser maps <#, <=#, >#, >=#, ==#, and !=# to the same condition enum as their unrounded forms. |
The authoring note defines rounded comparisons by rounding both operands; the examined interpreter does not implement that distinction at this dispatch point. |
| Expression operators | The interpreter evaluates +, -, *, /, and % over integers. Division by zero assigns zero to the current intermediate expression; integer division otherwise follows host integer arithmetic. |
The note describes a wider operator set, including rounded arithmetic, integer division, and increment/decrement. Do not assume those forms are equivalent or supported here. |
next_sig_lr / next_sig_mr
|
A missing next signal or a next signal with no matching head is returned as STOP by the limited query path. |
This matches the documented missing-match aspect result at this boundary, but does not prove all route-search or aspect aggregation details. |
this_sig_lr / this_sig_mr
|
The interpreter converts Unknown to -1. For this_sig_lr, the underlying least-restrictive aggregation returns CLEAR_2 when the requested function is NORMAL and no matching head exists; for other categories it returns Unknown, then -1. |
The historical note's general missing-match -1 therefore does not describe the FTS NORMAL special case. Preserve this as consumer-specific behavior. |
dist_multi_sig_mr |
Dispatches to a route-aware multi-signal search, considers matching heads whose routes pass the implementation's route check, and returns STOP when no valid terminating sequence is found. |
This is a derived search implementation; exact equivalence to the historical algorithm and junction-link rules is unverified. |
| Script association | The loader reads declared files in order, associates script names with signal types case-insensitively (including a type's configured script name), and warns while retaining the earlier association when a duplicate key is encountered. | Original MSTS duplicate precedence and case rules remain unknown. A successful load does not imply every script was associated. |
| Update scheduling | A full update iterates the signal list sequentially; a partial update visits a slice and advances a rolling start index. | This differs from treating the historical same-position update-order warning as a universal fixed order. The examined source does not establish a stable cross-head execution order for every update mode. |
The examined repository test tree contains no focused automated conformance suite for these signal-script query and numeric semantics. General parser/runtime tests or successful route loading should not be presented as proof of full MSTS script compatibility. A useful future test would use a minimal route fixture with controlled head categories, aspects, and junction links, then compare each query result and update order separately; that would still test FTS unless run against an original MSTS executable.
- What is the complete original
sigcfg.datgrammar, including every flag and optional record? - How are global and route-local configuration and scripts selected, combined, or replaced by MSTS?
- How does original MSTS resolve declared script filenames, duplicates, and global/route precedence? The
ScriptFilesassociation grammar itself is documented above. - What are the original timing units and state behavior of
SigFlashDuration/SemaphoreInfo, and spatial units of lampPosition/Radius? Aspect speed units are explicit, but original accepted numeric forms and repeated-record behavior remain open. - What are the complete
SignalFnType, aspect, subobject-type, and flag vocabularies? - What numeric encodings and producer-specific extensions occur for the documented function and feature domains, and how do they differ across runtimes?
- How does original MSTS implement the documented grammar, including loops, precedence, negative/tie rounding, by-reference calls, numeric precision, and malformed-source behavior?
- Which documented script functions, missing-match values, numeric semantics, duplicate associations, and per-head update ordering are actually implemented by original MSTS?
- Are signal type and script names always matched case-insensitively in original MSTS?
- What are the two values of
SigSubJnLinkIfand the unresolved fields in TDBTrSignalDir? - Which records and behaviors are original MSTS, producer conventions, or later Open Rails extensions?
- Joseph Hoevet, A Guide to Programming Signals for Microsoft Train Simulator: Part 1, revision 5 (1 August 2009), pages 4-8, 9-14, and 15-18 for language and operators; Part 2, revision 4 (1 August 2009), pages 10-19 and 23-25 for signaling interfaces and functions. Revisions are from internal title pages, not older PDF metadata. The source register records hashes and access limitations; neither PDF is redistributed here.
- Preserved How to Make Signal Config and Script Files: recovered configuration-format description, particularly
LightTex,LightsTabEntry,SignalLights,SignalDrawStates,SignalAspects, andScriptFiles, plus the worked configuration example. Identity/hash are recorded in the source register; publisher and distribution provenance remain unresolved. The separate How to Make Signals note has not been re-extracted for this increment. - FTS
SignalConfigurationFile.cs,Signal.cs,SignalScripts.cs,SignalScriptProcessing.cs,SignalHead.cs, andSignalEnvironment.cs. Derived parser/runtime evidence for operator mapping, integer expression evaluation, query results, script association, and update scheduling; shares ancestry with Open Rails. - TSRE5
SigCfg.cppandSignalType.cpp: independent but partial configuration parsing, not full language/runtime corroboration. - The authoring note's Scripting System Overview, Operators, Signal Script File Format, Values and Flags, and Signal Logic I/O and Functions support the scripting increment. FTS
SignalScripts.csprovides a derived implementation comparison, not proof of the note's full language support. - Stephen Dearne (SDTrains), A TDB Primer, v1.2, especially pages 36-45 for community observations of signal repair and TDB rebuilding.
- SCE mixed-content corpus: observed
sigcfg.datand producer-named signal script file; private source location omitted. - Track database signal items, world signal objects, and shape files: related schemas and implementation evidence.
- MSTS Content
- Research Sources
- Kuju File Format
- Coordinates and Identity
- References, Collections, and Graphs
- Units and Numeric Values
- Flags, Selectors, and Enumerations
- Names and Resource Lookup
- Track Database (.tdb)
- Track Sections (tsection.dat)
- Route Definition (.trk)
- Path Files (.pat)
- Activity Files (.act)
- Service Files (.srv)
- Traffic Files (.trf)
- Consist Files (.con)
- Vehicles and Rolling Stock
- Shape Files (.s and .sd)
- Texture Files (.ace)
- Sound Assets (.sms, .wav, .ws)
- Track Types (ttype.dat)
- Speedpost Configuration (speedpost.dat)
- Car-Spawner Configuration (carspawn.dat)
- Route Editor Reference Files (.ref)
- Route Editor Marker Files (.mkr)
- Hazard Configuration (.haz)
- Pickup Authoring and Configuration
- Gantry Configuration (gantry.dat)
- Signals and Scripting
- Validation Experiments
- World Files (.w)