Skip to content

Track File (.trk)

Zsolt Zitting edited this page Jan 18, 2023 · 3 revisions

Track files are the main user-facing file format of the game. They are used to store the tracks that are playable in the game, as well as user-created tracks.

All values are little endian unless stated otherwise.

File Header

The header is 32 bytes long.

Offset Length Example Bytes Data ID Description
0x00 12 bytes 4C 45 47 4F 20 4D 4F 54 4F 00 00 00 legoHeader "LEGO MOTO" null terminated string with 2 bytes of null padding
0x0C 4 bytes 05 00 00 00 trkVersion Track file version as a 32-bit int. Crashes vanilla if not set to 5.
0x10 4 bytes 28 00 01 00 trkFilesize Track filesize as a 32-bit int.
0x14 4 bytes 01 00 00 00 trkSize Track size as a 32-bit int. Also determines what mode the map is available in.
0x18 4 bytes 02 00 00 00 trkTheme Track theme as a 32-bit int.
0x1C 4 bytes 00 00 00 00 trkTime Track time of day as a 32-bit int.

Track Size

Value Mode
0 Multiplayer [small, 8x8]
1 Singleplayer [big, 16x16]

Track Theme

Value Theme
0 Jungle
1 Ice
2 Desert
3 City

Track Time

Value Time
0 Day
1 Night

Notes from Yellowberry (historical reference)

Google Docs Link

Notes from kbios (historical reference)

Fixed-length file (65576 b)
***Little-endian values***
Header example:                                                                                                                                                                            
4C 45 47 4F 20 4D 4F 54 4F 00 00 00 05 00 00 00 28 00 01 00 01 00 00 00 02 00 00 00 00 00 00 00                                                                                    
                                                                                                                                                                                   
4C 45 47 4F 20 4D 4F 54 4F (bytes 1-9) magic number (LEGO MOTO)
00 00 00 05 00 00 00 (bytes 10-16) apparently fixed
28 00 01 00 (bytes 17-20) filesize (65576)                                                                                                                         
01 00 00 00 (bytes 21-24) map type (00 multi, 01 single)                                                                                                          
02 00 00 00 (bytes 25-28) ambiance (00 jungle, 01 ice, 02 desert, 03 city)                                                                                                      
00 00 00 00 (bytes 29-32) time (00 day, 01 night)                                                                                                                                         

Track description, starting from right side going down:                                      
An empty space is                                                                                                                                        
00 00 00 00 00 00 80 BF FF FF FF FF 00 00 00 00                                                                                                                                    
16 pieces, then 48 unusued blocks like                                                                                                                        
00 00 00 00 00 00 00 00 FF FF FF FF 00 00 00 00                                                                                                                                    
Multiplayer: 8 pieces and 56 unused blocks.
This for each row. After the last row the file is filled with unused blocks up to 64K.
Last 8 bytes are like                                                                                                                                                            
00 00 00 00 01 00 00 00                                                                                                                                                            
01 00 00 00 (bytes 5-8) open/finished track (00 open, 01 finished)

A piece (departure) is eg
00 00 00 00 00 00 80 BF 30 43 00 00 01 00 00 00

00 00 00 00 (bytes 1-4) unknown (can be 00, 01, 02, 03), doesn't seem to have any effect
00 00 80 BF (bytes 5-8) height as a ***floating point number***
30 (byte 9) piece type
43 (byte 10) piece ambiance (43 city, 47 desert, 3B jungle, 3F ice)
00 00 together with the preceding two bytes forms the asset id
01 00 00 00 (bytes 13-16) clockwise rotation (00, 01, 02, 03)

Pieces occupying more than one space are marked only in one place, the one around which they rotate

Pieces (city, desert, jungle, ice):
Partenza:               30 1D 65 48
Rettilineo semplice:    31 19 61 49
Rettilineo camion:      32 1A 62 4A
Curva semplice:         33 1B 63 4B
Curva larga semplice:   34 1C 64 4C

Rettilineo parapetto:   36 1E 66 4E
Rettilineo lungo:       37 1F 67 4F
Curva parapetto:        38 20 68 50
Curva larga parapetto:  39 21 69 51

Rettilineo dosso:       3B 23 6B 53
Salita parapetto:       3C 24 6C 54

Paravalanghe:           40 28 70 58
Chicane:                41 29 71 59
Ventola:                42 2A 72 5A
Pantano:                43 2B 73 5B
Salto:                  44 2C 74 5C
Giro della morte:       45 2D 75 5D
Salita accelerazione:   46 2E 76 5E
Piastra:                47 2F 77 5F
Nastro:                 48 30 78 60
Incrocio:               49 31 79 61
Rettilineo fumo:        4A 32 7A 62
Rettilineo griglia:     4B 33 7B 63
Rettilineo casse:       4C 34 7C 64
Cannone:                4D 35 7D 65

Rettilineo semafori:    51 39 81 69

Salita semplice:        53 3B 83 6B

Pot. supersterzo:       58 40 88 70
Potenziatore turbo:     59 41 89 71
Pot. a sorpresa:        5A 42 8A 72
Pot. autoscontro:       5B 43 8B 73
Pot. oggetti insidiosi: 5C 44 8C 74
Fabbrica:               5D 45 8D 75
Edificio 1:             5E 46 8E 76
Pot. raggio paralizz.:  5F 47 8F 77
Edificio 2:             60 48 90 78
Edificio 3:             61 49 91 79
Edificio 4:             62 4A 92 7A
Edificio 5:             63 4B 93 7B
Edificio 6:             64 4C 94 7C

Aeroporto:              67 4F 97 7F

Statua:                 6C 54 9C 84
Angolo:                 6D 55 9D 85
Schermo:                6E 56 9E 86
Parcheggio 1:           6F 57 9F 87
Aiuola:                 70 58 A0 88
Laghetto:               71 59 A1 89
Pini:                   72 5A A2 8A

Cespugli:               74 5C A4 8C
Parcheggio 2:           75 5D A5 8D
Casse:                  77 5F A7 8F
Lampione:               78 60 A8 90

Lago:                   7A 62 AA 92

Salita cespugli:        7C 64 AC 94
Astronave:              7D 65 AD 95
Albero:                 7E 66 AE 96
Buca:                   7F 67 AF 97

Rettilineo luce:        8D 75 BD A5