This page describes the format of the v2 SimSig WTT timetable files and WTR timetable rules files used in executable simulations. The Loader can read this format but does not generate it.
The WTT and WTR files are binary files, not text.
The formats are described in terms of "units"; some types of unit are defined in terms of other types.
The word "must" indicates an absolute requirement. Any file not conforming to this requirement is not a valid SimSig file. The wording "should X but may Y" indicates that either X or Y must apply; software generating files is strongly recommended to choose option X, but software reading files needs to be aware that Y could happen instead. Option Y is more likely to be made invalid if the format changes.
Byte values are shown within boxes; sequences of boxes are read from left to right (that is, the leftmost box comes first in the file). Each box holds one byte unless it contains "..." or otherwise says so. All numbers are decimal. Three letter codes such as BRK are ConvData names for data items.
Adjacent units should be consecutive in the file, but there may be any number of bytes with value 0 between units.
The following types of unit are used throughout these format descriptions.
An I-unit holds an integer. There are three possible encodings. The shortest possible one should be used for any given value, but longer ones may be used.
| |||||
| |||||
|
In each case the value is stored in 2s-complement little-endian form. Thus the first format can be used for values between -128 and +127 inclusive, and the second format for values between -32768 and +32767 inclusive. Thus
|
represents the value -6 | |||
|
represents the value 1040. |
An S-unit holds a string. There are two possible encodings. For strings of up to 255 characters, the shorter one should be used but the longer one may be used.
|
the length is an unsigned value from 0 to 255 | ||||||
|
the four bytes form an unsigned little-endian integer giving the length |
In both cases the length gives the number of characters in the string. Thus:
|
represents the string "ABC" | ||||||||
|
also represents the string "ABC" | ||||||||
|
represents the empty string "" |
A Q-unit holds a truth value or option. There are two possible encodings:
|
represents false, no, or unticked | |
|
represents true, yes, or ticked |
A B-unit holds several truth values or options. It is encoded as an I-unit; the value must be positive. The value is broken into individual bits, with 1 meaning the option is chosen and 0 meaning it is not. The bits are numbered from 0 as the least significant bit. Thus:
|
represents the options corresponding to bits 0 (value 1) and 2 (value 4) | |||
|
represents the options corresponding to bits 1, 7, and 8 |
Unused bit values should be set to 0.
A T-unit holds a time in seconds past midnight. It has the same representation as an I-unit. Thus:
|
represents the time 00:02 | |||
|
represents the time 02:03H |
A counted-XXX-unit represents a list of XXX-units. It consists of an I-unit giving the number of XXX-units (which might be zero) followed by that number of XXX-units. For example:
the counted-S-unit |
|
represents the list of strings ("A", "BC") | |||||||||
the counted-I-unit |
|
represents the list of three numbers (1040, 67, -2) | |||||||||
the counted-XXX-unit |
|
represents an empty list |
A WTT file consists of:
A WTT-header-unit consists of:
A train-type-unit consists of:
The SCL and CSH values should be present but may both be omitted (but not only one). The BRK, PWR, and SCL values are encoded as follows:
BRK | PWR | SCL | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
A timetable-unit consists of:
The encodings of BRK and PWR are the same as above; PWS is the same as PWR. SCL should be present but may be omitted.
If ENT does not begin with "E" and the simulation does not have an entry point with that name, the Loader will prefix an "E" and try again.
A timing-point-unit consists of:
A stopping-unit should consist of:
but may consist of:
in which case TLS is false, PPD and NPD are U, STP is Default, and ADJ is 0.
STP is encoded as follows:
Encoding | Meaning |
---|---|
0 | Default |
1 | Near |
2 | Far |
3 | NearExact |
4 | FarExact |
An action-unit consists of:
The action type is encoded as follows:
Encoding | Meaning |
---|---|
0 | Next |
1 | DR |
2 | DF |
3 | Join |
4 | DER |
5 | DEF |
6 | DCR |
7 | DCF |
8 | J2 |
9 | PS |
The ACI state is encoded as follows:
Encoding | Meaning |
---|---|
0 | N (not required) |
1 | D |
2 | U |
3 | U (undetermined) |
A WTR file consists of:
A WTR-header-unit consists of:
A rule-unit consists of:
The RUL value is encoded as follows:
Encoding | Meaning |
---|---|
0 | MAAE |
1 | MAAL |
2 | MAAA |
3 | NOTIF |
4 | DAA |
5 | DAE |
6 | DAL |
7 | DAJ |
8 | DAD |
9 | DAF |
10 | MX |
11 | MAAJ |
12 | MAAD |
13 | MAAF |
14 | ALT |
Back to the SimSig index. Back to the Rail index. Back to Clive's home page.