Difference between revisions of "Modding Whiplash/Fatal Racing"

From The /ovg/ Wiki
Jump to navigation Jump to search
(12 intermediate revisions by the same user not shown)
Line 59: Line 59:
 
|Left shoulder grip<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>
|AI max acceleration<br><code>int</code>
+
|AI max speed<br><code>int</code>
|<br><code>int</code>
+
|AI accuracy<br><code>int</code>
 
|Audio (above trigger)<br><code>int</code>
 
|Audio (above trigger)<br><code>int</code>
 
|Audio trigger speed<br><code>int</code>
 
|Audio trigger speed<br><code>int</code>
Line 312: Line 312:
 
|-
 
|-
 
|Geometry index<br><code>int</code>
 
|Geometry index<br><code>int</code>
|Scale factor?<br><code>int</code>
+
|Ramp chunk count<br><code>int</code>
|Angle?<br><code>int</code>
+
|Number of ticks<br><code>int</code>
|?<br><code>int</code>
+
|Tick start index<br><code>int</code>
 
|Timing group<br><code>int</code>
 
|Timing group<br><code>int</code>
|Height<br><code>int</code>
+
|Height change per tick<br><code>int</code>
 
|Time bulging<br><code>int</code>
 
|Time bulging<br><code>int</code>
 
|Time flat<br><code>int</code>
 
|Time flat<br><code>int</code>
|Smaller expands/larger contracts?<br><code>int</code>
+
|Ramp side length<br><code>int</code>
|Bulge?<br><code>int</code>
+
|Bulge Section<br><code>int</code>
 
|-
 
|-
 
|colspan=10|''...''
 
|colspan=10|''...''
Line 326: Line 326:
 
||-1
 
||-1
 
|}
 
|}
* Scale factor?
+
* Ramp chunk count
** Increases the length and height of the "ramp"
+
** Increases the length and height of the "ramp" by increasing the number of chunks before and after the stunt chunk included in the ramp
** 1 is a bump, 4 starts breaking textures, 6 is huge vertical wall
+
* Number of ticks
* Angle?
+
** Number of game ticks the stunt expansion process takes
** Lower is flatter, higher becomes trapezoid with longer top
+
** 0 breaks the track
* ?
+
* Tick start index
** No clue
+
** Index within the animation of the stunt that it will be in when the track loads
 +
** If it's higher than or equal to the number of ticks the stunt glitches out
 
* Timing group
 
* Timing group
** With otherwise identical config, two bumps with same number move together, with 1 and 2 move oppositely
+
** With otherwise identical config, two bumps with same number move together
 +
** Appears to be a boolean, 1 is group 1, any other value is group 2
 +
* Height change per tick
 +
** Negative values break the track
 +
* Ramp side length
 +
** The length that the chunks before and after the stunted chunk change to when the stunt is active
 +
** Value is percentage, 1024 = 100%
 +
** Value appears to be the hypotenuse or actual surface length rather than the flat length beneath
 +
** If this value is incompatible with height change per tick * num ticks, it will take priority limiting the max height of the stunt, otherwise the chunk indicated as the "stunt" is stretched in length to make this fit
 +
* Bulge section
 +
** Bit flags to specify which section of the track moves
 +
*** Bit 0: left shoulder
 +
*** Bit 1: left wall
 +
*** Bit 2: left lane
 +
*** Bit 3: right lane
 +
*** Bit 4: right shoulder
 +
*** Bit 5: right wall
 +
*** Higher bits move nothing
 
===Textures===
 
===Textures===
 
{| class="wikitable" style="text-align: center;"
 
{| class="wikitable" style="text-align: center;"

Revision as of 18:58, 15 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
Ramp chunk count
int
Number of ticks
int
Tick start index
int
Timing group
int
Height change per tick
int
Time bulging
int
Time flat
int
Ramp side length
int
Bulge Section
int
...
-1
  • Ramp chunk count
    • Increases the length and height of the "ramp" by increasing the number of chunks before and after the stunt chunk included in the ramp
  • Number of ticks
    • Number of game ticks the stunt expansion process takes
    • 0 breaks the track
  • Tick start index
    • Index within the animation of the stunt that it will be in when the track loads
    • If it's higher than or equal to the number of ticks the stunt glitches out
  • Timing group
    • With otherwise identical config, two bumps with same number move together
    • Appears to be a boolean, 1 is group 1, any other value is group 2
  • Height change per tick
    • Negative values break the track
  • Ramp side length
    • The length that the chunks before and after the stunted chunk change to when the stunt is active
    • Value is percentage, 1024 = 100%
    • Value appears to be the hypotenuse or actual surface length rather than the flat length beneath
    • If this value is incompatible with height change per tick * num ticks, it will take priority limiting the max height of the stunt, otherwise the chunk indicated as the "stunt" is stretched in length to make this fit
  • Bulge section
    • Bit flags to specify which section of the track moves
      • Bit 0: left shoulder
      • Bit 1: left wall
      • Bit 2: left lane
      • Bit 3: right lane
      • Bit 4: right shoulder
      • Bit 5: right wall
      • Higher bits move nothing

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