Difference between revisions of "Track file"

From Stunts Wiki
(→‎Terrain codification: Finally transcribed the terrain codes from Baehr's page. With an adequate layout, putting the track pieces will only need slightly more work :-))
(→‎Track codification: And so it begins...)
Line 53: Line 53:
 
''(to be completed - for the moment, see the external links {{ToFoot|2}})''
 
''(to be completed - for the moment, see the external links {{ToFoot|2}})''
  
 +
''Adapted from [[Jonas Baehr]]'s page {{ToFoot|2}}''
 +
 +
Key to the table columns:
 +
 +
* '''Element''': Terrain element name.
 +
* '''Orientation reference''': for elements with multiple possible orientations, the feature of the element to which the orientation columns refer to.
 +
* '''Orientation''': Orientation of the reference feature. "Any" indicates there is just one orientation. The other columns refer to map sides as cardinal points (N, S, W, E = top, bottom, left, right). The ">" sign indicates direction, so S>N means vertical orientation, bottom to top. Compass points indicate the corners of a tile or element (NW, SW, SE, NE = top left, bottom left, bottom right, top right).
 +
 +
To find the ''hexadecimal'' value for a certain element, find its entry under the row of the element name and the column of the desired orientation. 
 +
 +
As the description of the orientation of some track pieces can be quite complex, the codes are presented in multiple tables to facilitate comprehension. We suggest you to use the "Find" command of your browser for efficiently locating the track elements.
 +
 +
=== Linear elements ===
 +
 +
{| class="wikitable"
 +
|- align="center"
 +
! rowspan=2 | Element !! rowspan=2 | Orientation<br>reference !! colspan=9 | Orientation
 +
|-
 +
! Any !! S>N !! E>W !! N>S !! W>E
 +
|-
 +
| Blank ||
 +
|| 00
 +
|-
 +
| Paved s/f line || Track direction
 +
||    || 01 || B5 || B3 || B4
 +
|-
 +
| Dirt s/f line || Track direction
 +
||    || 86|| 89 || 87 || 88
 +
|-
 +
| Icy s/f line || Track direction
 +
||    || 93 || 96 || 94 || 95
 +
|-
 +
| Paved road || Track direction
 +
||    || 04 || 05 ||    || 
 +
|-
 +
| Dirt road || Track direction
 +
||    || 0E || 0F ||    || 
 +
|-
 +
| Icy road || Track direction
 +
||    || 18 || 19 ||    || 
 +
|-
 +
| Paved crossroad ||
 +
|| 4A
 +
|-
 +
| Dirt crossroad ||
 +
|| 7D
 +
|-
 +
| Icy crossroad ||
 +
|| 8A
 +
|-
 +
| Elevated road || Track direction
 +
||    || 22 || 23 ||    || 
 +
|-
 +
| Solid el. road || Track direction
 +
||    || 63 || 64 ||    || 
 +
|-
 +
| Overpass || Bridge direction
 +
||    || 65 || 66 ||    || 
 +
|-
 +
| Elevated span || Track direction
 +
||    || 67 || 68 ||    || 
 +
|-
 +
| Regular ramp || Ascending direction
 +
||    || 26 || 25 || 27 || 24
 +
|-
 +
| Bridge ramp || Ascending direction
 +
||    || 3A || 39 || 3B || 38
 +
|-
 +
| Solid ramp || Ascending direction
 +
||    || 61 || 60 || 62 || 5F
 +
|-
 +
| Left-handed cork u/d || Ascending direction
 +
||    || 75 || 76 || 77 || 78
 +
|-
 +
| Right-handed cork u/d || Ascending direction
 +
||    || 79 || 7A || 7B || 7C
 +
|-
 +
| Loop || Track direction
 +
||    || 40 || 41 ||    ||   
 +
|-
 +
| Cork l/r || Track direction
 +
||    || 55 || 56 ||    ||   
 +
|-
 +
| Tunnel || Track direction
 +
||    || 42 || 43 ||    ||
 +
|-
 +
| Slalom road || Track direction
 +
||    || 73 || 74 ||    ||
 +
|-
 +
| Regular pipe || Track direction
 +
||    || 44 || 45 ||    ||
 +
|-
 +
| Pipe with obstacle || Track direction
 +
||    || 53 || 54 ||    ||
 +
|-
 +
| Pipe entrance || Entering pipe direction
 +
||    || 46 || 48 || 47 || 49
 +
|-
 +
| Highway || Track direction
 +
||    || 6D || 6E ||    ||
 +
|-
 +
| Highway entrance || Entering highway direction
 +
||    || 6F || 72 || 71 || 70
 +
|}
  
 
==Horizon codification==
 
==Horizon codification==

Revision as of 01:40, 28 February 2010

General infos

One of the most interesting features of Stunts is the possibility to create your own tracks, whatever the editor you choose to do so.

Each track is composed of 30x30 squares, one byte for each square. That is 900 bytes for track layout, with 1 additionnal byte for horizon. Terrain information (fills, water) is recorded the same way, that is 900 bytes for terrain information too. Last byte is a padding zero. Therefore, any track file (extension .TRK) should be 1,802 bytes long.

Track layout starts at offset 0x0000. Horizon is at offset 0x0384. Terrain information starts at offset 0x0385 and the zero byte is at offset 0x0709. Information is recorded row by row : left to right, bottom to top for the track layout block but left to right and top to bottom for the terrain block.

Terrain codification

Adapted from Jonas Baehr's page [2]

Key to the table columns:

  • Element: Terrain element name.
  • Orientation reference: for elements with multiple possible orientations, the feature of the element to which the orientation columns refer to.
  • Orientation: Orientation of the reference feature. "Any" indicates there is just one orientation. The other columns refer to map sides as cardinal points (N, S, W, E = top, bottom, left, right). The ">" sign indicates direction, so S>N means vertical orientation, bottom to top. Compass points indicate the corners of a tile or element (NW, SW, SE, NE = top left, bottom left, bottom right, top right).

To find the hexadecimal value for a certain element, find its entry under the row of the element name and the column of the desired orientation.

Element Orientation
reference
Orientation
Any NW SW SE NE S>N E>W N>S W>E
Flat ground 00
Water 01
Diagonal coast Corner inside water 05 02 03 04
Flat hill 06
Hill slope (straight) Uphill direction 07 08 09 0A
Angled slope (outer edge) Heightened corner 0B 0C 0D 0E
Angled slope (inner edge) Lowered corner 11 12 0F 10

Track codification

(to be completed - for the moment, see the external links [2])

Adapted from Jonas Baehr's page [2]

Key to the table columns:

  • Element: Terrain element name.
  • Orientation reference: for elements with multiple possible orientations, the feature of the element to which the orientation columns refer to.
  • Orientation: Orientation of the reference feature. "Any" indicates there is just one orientation. The other columns refer to map sides as cardinal points (N, S, W, E = top, bottom, left, right). The ">" sign indicates direction, so S>N means vertical orientation, bottom to top. Compass points indicate the corners of a tile or element (NW, SW, SE, NE = top left, bottom left, bottom right, top right).

To find the hexadecimal value for a certain element, find its entry under the row of the element name and the column of the desired orientation.

As the description of the orientation of some track pieces can be quite complex, the codes are presented in multiple tables to facilitate comprehension. We suggest you to use the "Find" command of your browser for efficiently locating the track elements.

Linear elements

Element Orientation
reference
Orientation
Any S>N E>W N>S W>E
Blank 00
Paved s/f line Track direction 01 B5 B3 B4
Dirt s/f line Track direction 86 89 87 88
Icy s/f line Track direction 93 96 94 95
Paved road Track direction 04 05
Dirt road Track direction 0E 0F
Icy road Track direction 18 19
Paved crossroad 4A
Dirt crossroad 7D
Icy crossroad 8A
Elevated road Track direction 22 23
Solid el. road Track direction 63 64
Overpass Bridge direction 65 66
Elevated span Track direction 67 68
Regular ramp Ascending direction 26 25 27 24
Bridge ramp Ascending direction 3A 39 3B 38
Solid ramp Ascending direction 61 60 62 5F
Left-handed cork u/d Ascending direction 75 76 77 78
Right-handed cork u/d Ascending direction 79 7A 7B 7C
Loop Track direction 40 41
Cork l/r Track direction 55 56
Tunnel Track direction 42 43
Slalom road Track direction 73 74
Regular pipe Track direction 44 45
Pipe with obstacle Track direction 53 54
Pipe entrance Entering pipe direction 46 48 47 49
Highway Track direction 6D 6E
Highway entrance Entering highway direction 6F 72 71 70

Horizon codification

  • 0x00 Desert
  • 0x01 Tropical
  • 0x02 Alpine
  • 0x03 City
  • 0x04 Country
  • 0x05 Chaotic scenery (can make the game react weird sometimes)


External links