Difference between revisions of "Modding Whiplash/Fatal Racing"

From The /ovg/ Wiki
Jump to navigation Jump to search
(44 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=TRK file structure=
+
=Track (TRK) files=
 +
The tracks.
 
==Definition==
 
==Definition==
 
{| class="wikitable" style="text-align: center;"
 
{| class="wikitable" style="text-align: center;"
 
|-
 
|-
|Geometry length<br><code>int</code>||0||0||<code>int</code>
+
||'''[[#Header|Header]]'''
 
|-
 
|-
|colspan=4|''Empty line''
+
||''Empty line''
 
|-
 
|-
|colspan=4|''Empty line''
+
||''Empty line''
 
|-
 
|-
|colspan=4|'''[[#Geometry|Geometry]]'''
+
||'''[[#Geometry|Geometry]]'''
 
|-
 
|-
|colspan=4|'''[[#Signs|Signs]]'''
+
||'''[[#Signs|Signs]]'''
 
|-
 
|-
|colspan=4|''Empty line''
+
||''Empty line''
 
|-
 
|-
|colspan=4|'''[[#Stunts|Stunts]]'''
+
||'''[[#Stunts|Stunts]]'''
 
|-
 
|-
|colspan=4|''Empty line''
+
||''Empty line''
 
|-
 
|-
|colspan=4|'''[[#Textures|Textures]]'''
+
||'''[[#Textures|Textures]]'''
 
|-
 
|-
|colspan=4|''Empty line''
+
||''Empty line''
 
|-
 
|-
|colspan=4|'''[[#Race info|Race info]]'''
+
||'''[[#Race info|Race info]]'''
 
|-
 
|-
|colspan=4|''Empty line''
+
||''Empty line''
 +
|}
 +
 
 +
* <code>//</code> denotes a single line comment
 +
* integer values are 32-bit signed integers
 +
* floating point values are double precision
 +
===Header===
 +
{| class="wikitable" style="text-align: center;"
 +
|-
 +
|Geometry length<br><code>int</code>||0||0||Floor depth<br><code>int</code>
 
|}
 
|}
 
===Geometry===
 
===Geometry===
 
Track geometry.
 
Track geometry.
 
{| class="wikitable" style="text-align: center;"
 
{| class="wikitable" style="text-align: center;"
 +
!0!!1!!2!!3!!4!!5!!6!!7!!8!!9!!10!!11!!12!!13!!14!!15!!16!!17!!18!!19!!20!!21!!22!!23!!24!!25!!26!!27!!28!!29
 
|-
 
|-
 
|Left shoulder width<br><code>int</code>
 
|Left shoulder width<br><code>int</code>
Line 35: Line 46:
 
|Right lane width<br><code>int</code>
 
|Right lane width<br><code>int</code>
 
|Right shoulder width<br><code>int</code>
 
|Right shoulder width<br><code>int</code>
|<br><code>int</code>
+
|Left shoulder height<br><code>int</code>
|<br><code>int</code>
+
|Right shoulder height<br><code>int</code>
|<br><code>int</code>
+
|Length<br><code>int</code>
|Yaw rotation, clockwise (°)<br><code>float</code>
+
|Yaw rotation, counter-clockwise (°)<br><code>float</code>
 
|Pitch rotation, upwards (°)<br><code>float</code>
 
|Pitch rotation, upwards (°)<br><code>float</code>
|Roll rotation, clockwise (°)<br><code>float</code>
+
|Roll rotation, counter-clockwise (°)<br><code>float</code>
 
|AI line<br><code>int</code>
 
|AI line<br><code>int</code>
 
|AI line<br><code>int</code>
 
|AI line<br><code>int</code>
Line 46: Line 57:
 
|AI line<br><code>int</code>
 
|AI line<br><code>int</code>
 
|Track grip<br><code>int</code>
 
|Track grip<br><code>int</code>
|<br><code>int</code>
+
|Left shoulder grip<br><code>int</code>
|Right shoulder? grip<br><code>int</code>
+
|Right shoulder grip<br><code>int</code>
|<br><code>int</code>
+
|AI max speed<br><code>int</code>
|<br><code>int</code>
+
|AI accuracy<br><code>int</code>
|<br><code>int</code>
+
|Audio (above trigger)<br><code>int</code>
|<br><code>int</code>
+
|Audio trigger speed<br><code>int</code>
|<br><code>int</code>
+
|Audio (below trigger)<br><code>int</code>
 
|-
 
|-
 
|Left surface type<br><code>int</code>
 
|Left surface type<br><code>int</code>
 
|Center surface type<br><code>int</code>
 
|Center surface type<br><code>int</code>
 
|Right surface type<br><code>int</code>
 
|Right surface type<br><code>int</code>
|<br><code>int</code>
+
|Left wall type<br><code>int</code>
|<br><code>int</code>
+
|Right wall type<br><code>int</code>
|<br><code>int</code>
+
|Roof type<br><code>int</code>
|<br><code>int</code>
+
|Left upper outer wall type<br><code>int</code>
|<br><code>int</code>
+
|Left lower outer wall type<br><code>int</code>
|<br><code>int</code>
+
|Outer floor type<br><code>int</code>
|<br><code>int</code>
+
|Right lower outer wall type<br><code>int</code>
|<br><code>int</code>
+
|Right upper outer wall type<br><code>int</code>
|<br><code>int</code>
+
|Environment floor type<br><code>int</code>
|<br><code>int</code>
+
|Building/Sign type<br><code>int</code>
|<br><code>int</code>
+
|Building/Sign horizontal offset<br><code>int</code>
|<br><code>int</code>
+
|Building/Sign vertical offset<br><code>int</code>
|<br><code>float</code>
+
|Building/Sign yaw, counter-clockwise (°)<br><code>float</code>
|<br><code>float</code>
+
|Building/Sign pitch, upwards (°)<br><code>float</code>
|<br><code>float</code>
+
|Building/Sign roll, counter-clockwise (°)<br><code>float</code>
 
|-
 
|-
|<br><code>int</code>
+
|Left upper outer wall horizontal offset<br><code>int</code>
|<br><code>int</code>
+
|Left lower outer wall horizontal offset<br><code>int</code>
|<br><code>int</code>
+
|Left outer floor horizontal offset<br><code>int</code>
|<br><code>int</code>
+
|Right outer floor horizontal offset<br><code>int</code>
|<br><code>int</code>
+
|Right lower outer wall horizontal offset<br><code>int</code>
|<br><code>int</code>
+
|Right upper outer wall horizontal offset<br><code>int</code>
|<br><code>int</code>
+
|Left upper outer wall height<br><code>int</code>
|<br><code>int</code>
+
|Left lower outer wall height<br><code>int</code>
|<br><code>int</code>
+
|Left outer floor height<br><code>int</code>
|<br><code>int</code>
+
|Right outer floor height<br><code>int</code>
|<br><code>int</code>
+
|Right lower outer wall height<br><code>int</code>
|<br><code>int</code>
+
|Right upper outer wall height<br><code>int</code>
|<br><code>int</code>
+
|Wall/roof height<br><code>int</code>
|<br><code>int</code>
+
|Draw order?<br><code>int</code>
|<br><code>int</code>
+
|Draw order?<br><code>int</code>
|<br><code>int</code>
+
|Draw order<br><code>int</code>
 
|<br><code>int</code>
 
|<br><code>int</code>
 
|<br><code>int</code>
 
|<br><code>int</code>
Line 111: Line 122:
 
{| class="wikitable" style="text-align: center;"
 
{| class="wikitable" style="text-align: center;"
 
|-
 
|-
|Least significant bit||31||30||29||28||27||26||25||24||23||22||21||20||19||18||17||16|15||14||13||12||11||10||9||8||7||6||5||4||3||2||1||0
+
|'''Least significant bit'''||31||30||29||28||27||26||25||24||23||22||21||20||19||18||17||16||15||14||13||12||11||10||9||8||7||6||5||4||3||2||1||0
 
|-
 
|-
|Surface type||||||||||||||Pit||||||
+
|'''Surface type'''
||Transparent<br>Requires no texture||||||||||
+
||Wall<br>(cannot be<br>driven on)
||||||Flip horizontally||||||||Apply texture
+
||Bounce off walls
 +
||Echo||||||
 +
||Pit
 +
||Yellow on<br>track map||
 +
||Wall<br>(cannot be<br>driven on)
 +
||Transparent<br>Requires no texture
 +
||Bounce off walls
 +
||Non-magnetic
 +
||Flip vertically
 +
||Non-solid
 +
||Texture pair
 +
||(cars only)<br>Change livery?
 +
||||(cars only)<br>Animate motion?
 +
||Flip horizontally
 +
||Back
 +
||Partial transparency
 +
||(cars only)<br>Look up texture<br>in anms array
 +
||Apply texture
 
|colspan=8|Texture
 
|colspan=8|Texture
 
|}
 
|}
 +
* Bit 31
 +
** Track surface: appears to be same effect as bit 22: solid block that can't be driven on
 +
** Wall: when unset, walls are outside of the shoulder, when set walls are between shoulder and center
 +
** Roof: Turns roof vertical and tied to upper outer walls
 +
* Transparent
 +
** Slightly darker than complete transparency (not the same as a full palette texture index 0 texture would be with the partial transparency bit set)
 +
** Only works when a texture is not applied
 +
* Back
 +
** Toggles application of a different texture on the outside face of walls
 +
** When a BACK is set, texture will be the BACK texture
 +
** Otherwise, no clue how this texture is determined, changes when wall type changes and not in any consistent way, sometimes is broken
 +
* Partial transparency
 +
** Toggles transparency on textures that contain transparent sections, e.g. guardrail
 +
** Turns palette texture index 0 transparent (<code>#000000</code>) (not to be confused with the same color at another index)
 +
** Only works when a texture is applied
 
* Texture
 
* Texture
** Bit 0: some sort of offset?
+
** Transparent
*** For normal textures, left index+1 right index-3
+
*** Bits correspond to the index within <code>PALETTE.PAL</code>
*** For transparent, makes it darker?
+
**** Palette texture index 0 is "normal" transparency
** Bits 1-7: pair index, first texture on left, second on right
+
**** Others have some kind of weird inversion effect
*** <code>00000010</code> is first pair, <code>00000100</code> is second pair, etc
+
** Single
====Values====
+
*** Bits are just texture index
* AI line
+
** Pair
** >0: left
+
*** Bits are texture index of left, index+1 on right
** 0: center
+
** When apply texture not set
** <0: right
+
*** Bits indicate a solid color corresponding to the index within <code>PALETTE.PAL</code>
* Grip
+
These apply for road surface, wall/roof, and outer wall/floor.
** 0: full grip
+
====Building/Sign type====
** 12: ice
+
{| class="wikitable" style="text-align: center;"
* Surface type
+
!Value!!Name!!Description!!Requires apply bit?!!Texturing
** 524703 590082 590082 appears to define a moving ramp or at least a surface the car can fly off of vertically
+
|-
 +
|0||TOWER||tall box||Yes||Index
 +
|-
 +
|1||TOWER 2||tall box, different texture||No||Fixed (22)
 +
|-
 +
|2||SIGN 1||small, back upside down, on one leg||Yes, but not for legs||Index, legs fixed (20)
 +
|-
 +
|3||SIGN 2||small, back upside down, on two legs||Yes, but not for legs||Index, legs fixed (21)
 +
|-
 +
|4||BUILD||complex building, drawn differently, different texture||No||Fixed (20, 21)
 +
|-
 +
|5||BUILD 1||giant tall folded boxes, different texture||No||Fixed (0)
 +
|-
 +
|6||BUILD 2||more giant tall folded box, different texture||No||Fixed (20)
 +
|-
 +
|7||BUILD 3||WIDE short box||Yes||Index
 +
|-
 +
|8||HEELBAR||cube, different texture||No||Fixed (8)
 +
|-
 +
|9||BALLOON||flat square, always face camera||Yes||Index
 +
|-
 +
|10||TREE||flat skinny rectangle, always face camera||No||Fixed (1)
 +
|-
 +
|11||ADVERT||flat small square, fixed, same back||Yes||Index
 +
|-
 +
|12||ADVERT 2||fixed flat square, back upside down||Yes||Index
 +
|-
 +
|13||QUAD BLD||4 tall skinny boxes||No||Fixed (23, 24, 25, 26)
 +
|-
 +
|14||BLD 0||tall box with pyramid top, different texture||No||Fixed (20, 21)
 +
|-
 +
|15||BIG BALL||flat square, always face camera, larger than BALLOON||Yes||Index
 +
|-
 +
|16||BIG AD||fixed flat square, back upside down, smaller than ADVERT 2||Yes||Index
 +
|-
 +
|>=256||no idea
 +
|}
 +
Textures are determined by BLD file.
 +
* Index: first 9 bits work just like road textures
 +
* Fixed: Same texture is always applied (index in parentheses)
 +
====Shoulder height====
 +
* >0: up
 +
* 0: flat
 +
* <0: down
 +
====AI line====
 +
* >0: left
 +
* 0: center
 +
* <0: right
 +
====Grip====
 +
* 0: full grip
 +
* 12: ice
 +
====Audio====
 +
* Index of audio to play when driven over (order in <code>SOUND.INI</code>)
 +
* 0: no audio
 +
* Above plays when over trigger speed
 +
* Below plays when between ~26 mph and trigger speed
 +
====Audio trigger speed====
 +
* 200 is about 67 mph
 +
====Wall type====
 +
* Left and right must exist to draw roof
 +
* -1: not present
 +
====Roof type====
 +
* -1: not present
 +
====Outer floor type====
 +
* -2: outer walls even with shoulder, normal solid wall
 +
* -1: no outer walls, can fall off
 +
* >=0: texture indexing with 9 bits as usual
 +
** floor height is based on environment depth
 +
** floor width is based on main track width
 +
** outer walls are attached to edges of floor
 +
** can drive partially off shoulder and bounce off
 +
====Environment floor type====
 +
* Controls color of the bottom of the void
 +
** Value of geometry currently being driven on determines entire color below the horizon
 +
* First 8 bits are palette color index
 +
* Higher bits are used but none seem to have any effect
 +
====Building/Sign offset====
 +
* >0: left/up
 +
* 0: center
 +
* <0: right/down
 +
====Outer lower/upper wall horizontal offset====
 +
* >0: outward
 +
* 0: vertical
 +
* <0: inward
 +
====Draw order?====
 +
These three values seem to combine to determine whether track is visible through other track. For example, given Bonus 4 with a bunch of buildings/signs over transparent track with transparent track on the other side, when the third value is 0, no buildings/signs are visible. When said value is greater than 0, some buildings/signs are visible. Changing the value or the values of the other two may change which buildings/signs are visible.
 +
====Third row====
 +
These properties only ever have these values over all 11018 geometry segments of the retail tracks.
 +
{| class="wikitable" style="text-align: center;"
 +
!Property index!!Values
 +
|-
 +
|16||20,40,60
 +
|-
 +
|17||20,40,60,80
 +
|-
 +
|18||20,40
 +
|-
 +
|19||20
 +
|-
 +
|20||20
 +
|-
 +
|21||20,40,60,80
 +
|-
 +
|22||1
 +
|-
 +
|23||20
 +
|-
 +
|24||1,20,40
 +
|-
 +
|25||20
 +
|-
 +
|26||1
 +
|}
 
===Signs===
 
===Signs===
 
Empty on some tracks.
 
Empty on some tracks.
 
{| class="wikitable" style="text-align: center;"
 
{| class="wikitable" style="text-align: center;"
 
|-
 
|-
|Signable geometry index?<br><code>int</code>||Texture<br><code>int</code>
+
|Signable geometry index<br><code>int</code>||Texture<br><code>int</code>
 
|-
 
|-
 
|colspan=2|''...''
 
|colspan=2|''...''
Line 144: Line 299:
 
||-1||-1
 
||-1||-1
 
|}
 
|}
 +
* Signable geometry index
 +
** 0: first geometry section with <code>0 <= sign type < 256</code>
 +
** 1: second, etc
 +
* Texture
 +
** Bits 0-7: index in BLD texture file
 +
** Bit 8: apply texture
 +
** Bit 15: invisible
 +
** No other bits seem to have an effect
 
===Stunts===
 
===Stunts===
 
Controls geometry that moves and potrudes. Empty on some tracks.
 
Controls geometry that moves and potrudes. Empty on some tracks.
Line 177: Line 340:
 
|colspan=2|Texture file<br><code>TEX:<DRH file></code>
 
|colspan=2|Texture file<br><code>TEX:<DRH file></code>
 
|-
 
|-
|colspan=2|Building texture file<br><code>BLD:<DRH file></code>
+
|colspan=2|Building/Sign texture file<br><code>BLD:<DRH file></code>
 
|-
 
|-
 
|colspan=2|<code>BACKS:</code>
 
|colspan=2|<code>BACKS:</code>
 
|-
 
|-
|<br><code>int</code>||<br><code>int</code>
+
|Geometry index<br><code>int</code>||Texture<br><code>int</code>
 
|-
 
|-
 
|colspan=2|''...''
 
|colspan=2|''...''
Line 187: Line 350:
 
||||-1
 
||||-1
 
|}
 
|}
 +
====Backs====
 +
The outside texture of walls when there is a wall between the track and the shoulder. Transparent when texture index does not correspond to an actual texture.
 
===Race info===
 
===Race info===
 
Not present on some tracks.
 
Not present on some tracks.
Line 195: Line 360:
 
|Impossible laps<br><code>int</code>||Hard laps<br><code>int</code>||Tricky laps<br><code>int</code>||Medium laps<br><code>int</code>||Easy laps<br><code>int</code>||Girlie laps<br><code>int</code>
 
|Impossible laps<br><code>int</code>||Hard laps<br><code>int</code>||Tricky laps<br><code>int</code>||Medium laps<br><code>int</code>||Easy laps<br><code>int</code>||Girlie laps<br><code>int</code>
 
|-
 
|-
|Track map size, smaller is larger<br><code>float</code>||Track map fidelity, smaller is more accurate<br><code>int</code>||<br><code>float</code>
+
|Track map size, smaller is larger<br><code>float</code>||Track map fidelity, smaller is more accurate<br><code>int</code>||Track preview size, smaller is larger<br><code>float</code>
 
|}
 
|}
 
==Effects==
 
==Effects==
Line 203: Line 368:
 
* Swapping yaw and pitch, roll 90.00000: vertical ring to the left
 
* Swapping yaw and pitch, roll 90.00000: vertical ring to the left
 
* Negative yaw: turnright
 
* Negative yaw: turnright
 +
===Length===
 +
Given Pulse at its maximum 193 mph on a modified Bonus 4 where all 494 sectors are 1200 long can complete at lap in 28.36 seconds
 +
and on the same track but with 50 flat sectors on each side shortened to 100 can complete a lap in 27.41 seconds,
 +
1000 length units is equivalent to 13.45 ft or 4.10 m. Additionally, the rotated portions of the track contribute approximately 0.20 seconds extra compared to flat.
 +
 +
=Palette (PAL) files=
 +
Texture color palettes.
 +
===PALETTE.PAL===
 +
Index <code>0x00</code> may be treated as having a fully transparent alpha (RBGA <code>#00000000</code>). All other colors are fully opaque, including the other black at index <code>0x70</code> (RBGA <code>#000000FF</code>).
 +
{| class="wikitable" style="text-align: center;"
 +
|-
 +
|||0||1||2||3||4||5||6||7||8||9||A||B||C||D||E||F
 +
|-
 +
|0x
 +
|style="background:#000000;"| ||style="background:#8c9c6c;"| ||style="background:#849464;"| ||style="background:#7c8c5c;"| ||style="background:#748454;"| ||style="background:#6c7c4c;"| ||style="background:#647444;"| ||style="background:#5c6c3c;"|
 +
|style="background:#546838;"| ||style="background:#4c6030;"| ||style="background:#44582c;"| ||style="background:#3c5028;"| ||style="background:#344820;"| ||style="background:#30401c;"| ||style="background:#283818;"| ||style="background:#243414;"|
 +
|-
 +
|1x
 +
|style="background:#d0b0a0;"| ||style="background:#c4a494;"| ||style="background:#b89c88;"| ||style="background:#ac947c;"| ||style="background:#a08870;"| ||style="background:#948068;"| ||style="background:#88785c;"| ||style="background:#7c6c54;"|
 +
|style="background:#706448;"| ||style="background:#645c40;"| ||style="background:#585038;"| ||style="background:#4c482c;"| ||style="background:#403c24;"| ||style="background:#34341c;"| ||style="background:#2c2818;"| ||style="background:#202010;"|
 +
|-
 +
|2x
 +
|style="background:#f0e0a0;"| ||style="background:#e0d094;"| ||style="background:#d4c084;"| ||style="background:#c8b478;"| ||style="background:#bca46c;"| ||style="background:#b09864;"| ||style="background:#a08858;"| ||style="background:#947c4c;"|
 +
|style="background:#887044;"| ||style="background:#7c643c;"| ||style="background:#705834;"| ||style="background:#604c2c;"| ||style="background:#544024;"| ||style="background:#48341c;"| ||style="background:#3c2814;"| ||style="background:#302010;"|
 +
|-
 +
|3x
 +
|style="background:#f0b070;"| ||style="background:#e4a86c;"| ||style="background:#dca06c;"| ||style="background:#d49c68;"| ||style="background:#cc9464;"| ||style="background:#c48c64;"| ||style="background:#bc8860;"| ||style="background:#b4805c;"|
 +
|style="background:#ac7c58;"| ||style="background:#a07454;"| ||style="background:#986c54;"| ||style="background:#906850;"| ||style="background:#88604c;"| ||style="background:#805c48;"| ||style="background:#785444;"| ||style="background:#705040;"|
 +
|-
 +
|4x
 +
|style="background:#f0c8b0;"| ||style="background:#e8bca8;"| ||style="background:#e0b49c;"| ||style="background:#dcac98;"| ||style="background:#d4a490;"| ||style="background:#d09c88;"| ||style="background:#c89480;"| ||style="background:#c08c78;"|
 +
|style="background:#bc8474;"| ||style="background:#b47c6c;"| ||style="background:#b07464;"| ||style="background:#a86c60;"| ||style="background:#a06458;"| ||style="background:#9c5c54;"| ||style="background:#94544c;"| ||style="background:#905048;"|
 +
|-
 +
|5x
 +
|style="background:#907c50;"| ||style="background:#8c744c;"| ||style="background:#846c48;"| ||style="background:#806844;"| ||style="background:#7c6044;"| ||style="background:#785840;"| ||style="background:#74543c;"| ||style="background:#704c38;"|
 +
|style="background:#6c4834;"| ||style="background:#684034;"| ||style="background:#643c30;"| ||style="background:#60382c;"| ||style="background:#5c302c;"| ||style="background:#582c28;"| ||style="background:#542824;"| ||style="background:#502424;"|
 +
|-
 +
|6x
 +
|style="background:#a8a8c0;"| ||style="background:#9c9cb4;"| ||style="background:#9090ac;"| ||style="background:#8888a4;"| ||style="background:#808098;"| ||style="background:#747490;"| ||style="background:#6c6c88;"| ||style="background:#64647c;"|
 +
|style="background:#5c5c74;"| ||style="background:#54546c;"| ||style="background:#484860;"| ||style="background:#404058;"| ||style="background:#383850;"| ||style="background:#303044;"| ||style="background:#28283c;"| ||style="background:#242434;"|
 +
|-
 +
|7x
 +
|style="background:#000000;"| ||style="background:#040404;"| ||style="background:#0c0c0c;"| ||style="background:#141414;"| ||style="background:#1c1c1c;"| ||style="background:#242424;"| ||style="background:#2c2c2c;"| ||style="background:#343434;"|
 +
|style="background:#3c3c3c;"| ||style="background:#444444;"| ||style="background:#4c4c4c;"| ||style="background:#545454;"| ||style="background:#606060;"| ||style="background:#686868;"| ||style="background:#707070;"| ||style="background:#787878;"|
 +
|-
 +
|8x
 +
|style="background:#808080;"| ||style="background:#888888;"| ||style="background:#909090;"| ||style="background:#989898;"| ||style="background:#a0a0a0;"| ||style="background:#a8a8a8;"| ||style="background:#b0b0b0;"| ||style="background:#b8b8b8;"|
 +
|style="background:#c0c0c0;"| ||style="background:#c8c8c8;"| ||style="background:#d0d0d0;"| ||style="background:#d8d8d8;"| ||style="background:#e0e0e0;"| ||style="background:#ececec;"| ||style="background:#f4f4f4;"| ||style="background:#fcfcfc;"|
 +
|-
 +
|9x
 +
|style="background:#0040fc;"| ||style="background:#084cfc;"| ||style="background:#145cfc;"| ||style="background:#2068fc;"| ||style="background:#2c74fc;"| ||style="background:#3c80fc;"| ||style="background:#488cfc;"| ||style="background:#5498fc;"|
 +
|style="background:#60a4fc;"| ||style="background:#6cacfc;"| ||style="background:#7cb8fc;"| ||style="background:#88c0fc;"| ||style="background:#94c8fc;"| ||style="background:#a0d0fc;"| ||style="background:#acd8fc;"| ||style="background:#bce0fc;"|
 +
|-
 +
|Ax
 +
|style="background:#1c0c00;"| ||style="background:#301400;"| ||style="background:#442000;"| ||style="background:#582800;"| ||style="background:#6c3400;"| ||style="background:#803c00;"| ||style="background:#944800;"| ||style="background:#a85400;"|
 +
|style="background:#bc5c00;"| ||style="background:#d06800;"| ||style="background:#e87000;"| ||style="background:#fc7c00;"| ||style="background:#2c0010;"| ||style="background:#3c0018;"| ||style="background:#500020;"| ||style="background:#640028;"|
 +
|-
 +
|Bx
 +
|style="background:#780030;"| ||style="background:#880038;"| ||style="background:#9c0040;"| ||style="background:#b00048;"| ||style="background:#c00054;"| ||style="background:#d4005c;"| ||style="background:#e80064;"| ||style="background:#fc0070;"|
 +
|style="background:#2c002c;"| ||style="background:#3c003c;"| ||style="background:#500050;"| ||style="background:#640064;"| ||style="background:#780078;"| ||style="background:#880088;"| ||style="background:#9c009c;"| ||style="background:#b000b0;"|
 +
|-
 +
|Cx
 +
|style="background:#c000c0;"| ||style="background:#d400d4;"| ||style="background:#e800e8;"| ||style="background:#fc00fc;"| ||style="background:#2c2c00;"| ||style="background:#3c3c00;"| ||style="background:#505000;"| ||style="background:#646400;"|
 +
|style="background:#787800;"| ||style="background:#888800;"| ||style="background:#9c9c00;"| ||style="background:#b0b000;"| ||style="background:#c0c000;"| ||style="background:#d4d400;"| ||style="background:#e8e800;"| ||style="background:#fcfc00;"|
 +
|-
 +
|Dx
 +
|style="background:#002c2c;"| ||style="background:#003c3c;"| ||style="background:#005050;"| ||style="background:#006464;"| ||style="background:#007878;"| ||style="background:#008888;"| ||style="background:#009c9c;"| ||style="background:#00b0b0;"|
 +
|style="background:#00c0c0;"| ||style="background:#00d4d4;"| ||style="background:#00e8e8;"| ||style="background:#00fcfc;"| ||style="background:#2c0000;"| ||style="background:#3c0000;"| ||style="background:#500000;"| ||style="background:#640000;"|
 +
|-
 +
|Ex
 +
|style="background:#780000;"| ||style="background:#880000;"| ||style="background:#9c0000;"| ||style="background:#b00000;"| ||style="background:#c00000;"| ||style="background:#d40000;"| ||style="background:#e80000;"| ||style="background:#fc0000;"|
 +
|style="background:#00002c;"| ||style="background:#00003c;"| ||style="background:#000050;"| ||style="background:#000064;"| ||style="background:#000078;"| ||style="background:#000088;"| ||style="background:#00009c;"| ||style="background:#0000b0;"|
 +
|-
 +
|Fx
 +
|style="background:#0000c0;"| ||style="background:#0000d4;"| ||style="background:#0000e8;"| ||style="background:#0000fc;"| ||style="background:#002c00;"| ||style="background:#003c00;"| ||style="background:#005000;"| ||style="background:#006400;"|
 +
|style="background:#007800;"| ||style="background:#008800;"| ||style="background:#009c00;"| ||style="background:#00b000;"| ||style="background:#00c000;"| ||style="background:#00d400;"| ||style="background:#00e800;"| ||style="background:#00fc00;"|
 +
|}

Revision as of 04:03, 2 May 2024

Track (TRK) files

The tracks.

Definition

Header
Empty line
Empty line
Geometry
Signs
Empty line
Stunts
Empty line
Textures
Empty line
Race info
Empty line
  • // denotes a single line comment
  • integer values are 32-bit signed integers
  • floating point values are double precision

Header

Geometry length
int
0 0 Floor depth
int

Geometry

Track geometry.

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
Left shoulder width
int
Left lane width
int
Right lane width
int
Right shoulder width
int
Left shoulder height
int
Right shoulder height
int
Length
int
Yaw rotation, counter-clockwise (°)
float
Pitch rotation, upwards (°)
float
Roll rotation, counter-clockwise (°)
float
AI line
int
AI line
int
AI line
int
AI line
int
Track grip
int
Left shoulder grip
int
Right shoulder grip
int
AI max speed
int
AI accuracy
int
Audio (above trigger)
int
Audio trigger speed
int
Audio (below trigger)
int
Left surface type
int
Center surface type
int
Right surface type
int
Left wall type
int
Right wall type
int
Roof type
int
Left upper outer wall type
int
Left lower outer wall type
int
Outer floor type
int
Right lower outer wall type
int
Right upper outer wall type
int
Environment floor type
int
Building/Sign type
int
Building/Sign horizontal offset
int
Building/Sign vertical offset
int
Building/Sign yaw, counter-clockwise (°)
float
Building/Sign pitch, upwards (°)
float
Building/Sign roll, counter-clockwise (°)
float
Left upper outer wall horizontal offset
int
Left lower outer wall horizontal offset
int
Left outer floor horizontal offset
int
Right outer floor horizontal offset
int
Right lower outer wall horizontal offset
int
Right upper outer wall horizontal offset
int
Left upper outer wall height
int
Left lower outer wall height
int
Left outer floor height
int
Right outer floor height
int
Right lower outer wall height
int
Right upper outer wall height
int
Wall/roof height
int
Draw order?
int
Draw order?
int
Draw order
int

int

int

int

int

int

int

int

int

int

int

int

int

int

int
Empty line
...

Surface type bit flags

Least significant bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Surface type Wall
(cannot be
driven on)
Bounce off walls Echo Pit Yellow on
track map
Wall
(cannot be
driven on)
Transparent
Requires no texture
Bounce off walls Non-magnetic Flip vertically Non-solid Texture pair (cars only)
Change livery?
(cars only)
Animate motion?
Flip horizontally Back Partial transparency (cars only)
Look up texture
in anms array
Apply texture Texture
  • Bit 31
    • Track surface: appears to be same effect as bit 22: solid block that can't be driven on
    • Wall: when unset, walls are outside of the shoulder, when set walls are between shoulder and center
    • Roof: Turns roof vertical and tied to upper outer walls
  • Transparent
    • Slightly darker than complete transparency (not the same as a full palette texture index 0 texture would be with the partial transparency bit set)
    • Only works when a texture is not applied
  • Back
    • Toggles application of a different texture on the outside face of walls
    • When a BACK is set, texture will be the BACK texture
    • Otherwise, no clue how this texture is determined, changes when wall type changes and not in any consistent way, sometimes is broken
  • Partial transparency
    • Toggles transparency on textures that contain transparent sections, e.g. guardrail
    • Turns palette texture index 0 transparent (#000000) (not to be confused with the same color at another index)
    • Only works when a texture is applied
  • Texture
    • Transparent
      • Bits correspond to the index within PALETTE.PAL
        • Palette texture index 0 is "normal" transparency
        • Others have some kind of weird inversion effect
    • Single
      • Bits are just texture index
    • Pair
      • Bits are texture index of left, index+1 on right
    • When apply texture not set
      • Bits indicate a solid color corresponding to the index within PALETTE.PAL

These apply for road surface, wall/roof, and outer wall/floor.

Building/Sign type

Value Name Description Requires apply bit? Texturing
0 TOWER tall box Yes Index
1 TOWER 2 tall box, different texture No Fixed (22)
2 SIGN 1 small, back upside down, on one leg Yes, but not for legs Index, legs fixed (20)
3 SIGN 2 small, back upside down, on two legs Yes, but not for legs Index, legs fixed (21)
4 BUILD complex building, drawn differently, different texture No Fixed (20, 21)
5 BUILD 1 giant tall folded boxes, different texture No Fixed (0)
6 BUILD 2 more giant tall folded box, different texture No Fixed (20)
7 BUILD 3 WIDE short box Yes Index
8 HEELBAR cube, different texture No Fixed (8)
9 BALLOON flat square, always face camera Yes Index
10 TREE flat skinny rectangle, always face camera No Fixed (1)
11 ADVERT flat small square, fixed, same back Yes Index
12 ADVERT 2 fixed flat square, back upside down Yes Index
13 QUAD BLD 4 tall skinny boxes No Fixed (23, 24, 25, 26)
14 BLD 0 tall box with pyramid top, different texture No Fixed (20, 21)
15 BIG BALL flat square, always face camera, larger than BALLOON Yes Index
16 BIG AD fixed flat square, back upside down, smaller than ADVERT 2 Yes Index
>=256 no idea

Textures are determined by BLD file.

  • Index: first 9 bits work just like road textures
  • Fixed: Same texture is always applied (index in parentheses)

Shoulder height

  • >0: up
  • 0: flat
  • <0: down

AI line

  • >0: left
  • 0: center
  • <0: right

Grip

  • 0: full grip
  • 12: ice

Audio

  • Index of audio to play when driven over (order in SOUND.INI)
  • 0: no audio
  • Above plays when over trigger speed
  • Below plays when between ~26 mph and trigger speed

Audio trigger speed

  • 200 is about 67 mph

Wall type

  • Left and right must exist to draw roof
  • -1: not present

Roof type

  • -1: not present

Outer floor type

  • -2: outer walls even with shoulder, normal solid wall
  • -1: no outer walls, can fall off
  • >=0: texture indexing with 9 bits as usual
    • floor height is based on environment depth
    • floor width is based on main track width
    • outer walls are attached to edges of floor
    • can drive partially off shoulder and bounce off

Environment floor type

  • Controls color of the bottom of the void
    • Value of geometry currently being driven on determines entire color below the horizon
  • First 8 bits are palette color index
  • Higher bits are used but none seem to have any effect

Building/Sign offset

  • >0: left/up
  • 0: center
  • <0: right/down

Outer lower/upper wall horizontal offset

  • >0: outward
  • 0: vertical
  • <0: inward

Draw order?

These three values seem to combine to determine whether track is visible through other track. For example, given Bonus 4 with a bunch of buildings/signs over transparent track with transparent track on the other side, when the third value is 0, no buildings/signs are visible. When said value is greater than 0, some buildings/signs are visible. Changing the value or the values of the other two may change which buildings/signs are visible.

Third row

These properties only ever have these values over all 11018 geometry segments of the retail tracks.

Property index Values
16 20,40,60
17 20,40,60,80
18 20,40
19 20
20 20
21 20,40,60,80
22 1
23 20
24 1,20,40
25 20
26 1

Signs

Empty on some tracks.

Signable geometry index
int
Texture
int
...
-1 -1
  • Signable geometry index
    • 0: first geometry section with 0 <= sign type < 256
    • 1: second, etc
  • Texture
    • Bits 0-7: index in BLD texture file
    • Bit 8: apply texture
    • Bit 15: invisible
    • No other bits seem to have an effect

Stunts

Controls geometry that moves and potrudes. Empty on some tracks.

Geometry index
int
Scale factor?
int
Angle?
int
?
int
Timing group
int
Height
int
Time bulging
int
Time flat
int
Smaller expands/larger contracts?
int
Bulge?
int
...
-1
  • Scale factor?
    • Increases the length and height of the "ramp"
    • 1 is a bump, 4 starts breaking textures, 6 is huge vertical wall
  • Angle?
    • Lower is flatter, higher becomes trapezoid with longer top
  •  ?
    • No clue
  • Timing group
    • With otherwise identical config, two bumps with same number move together, with 1 and 2 move oppositely

Textures

Texture file
TEX:<DRH file>
Building/Sign texture file
BLD:<DRH file>
BACKS:
Geometry index
int
Texture
int
...
-1

Backs

The outside texture of walls when there is a wall between the track and the shoulder. Transparent when texture index does not correspond to an actual texture.

Race info

Not present on some tracks.

Track number
int
Impossible laps
int
Hard laps
int
Tricky laps
int
Medium laps
int
Easy laps
int
Girlie laps
int
Track map size, smaller is larger
float
Track map fidelity, smaller is more accurate
int
Track preview size, smaller is larger
float

Effects

Bonus 7

  • Swapping yaw and pitch: loop
  • Swapping yaw and roll: twisting line
  • Swapping yaw and pitch, roll 90.00000: vertical ring to the left
  • Negative yaw: turnright

Length

Given Pulse at its maximum 193 mph on a modified Bonus 4 where all 494 sectors are 1200 long can complete at lap in 28.36 seconds and on the same track but with 50 flat sectors on each side shortened to 100 can complete a lap in 27.41 seconds, 1000 length units is equivalent to 13.45 ft or 4.10 m. Additionally, the rotated portions of the track contribute approximately 0.20 seconds extra compared to flat.

Palette (PAL) files

Texture color palettes.

PALETTE.PAL

Index 0x00 may be treated as having a fully transparent alpha (RBGA #00000000). All other colors are fully opaque, including the other black at index 0x70 (RBGA #000000FF).

0 1 2 3 4 5 6 7 8 9 A B C D E F
0x
1x
2x
3x
4x
5x
6x
7x
8x
9x
Ax
Bx
Cx
Dx
Ex
Fx