This is everything I know about replay files

NasCar replay file format:

Header (16 bytes):

  offset size
     0    4   Reserved
     4    4   Size of data ( length of file - 16 )
     8    4   Time (in 15ths of second) of start of replay ??
     C    4   Number of cars (includes pace car ...always present)

Records (Variable)
    Each record represents 1/15 second.
    In each record there are 13 bytes per car, a graphic
    objects section (one byte identifying the number of
    graphic objects followed by the 14-byte graphic
    objects), a sound objects section (one byte identifying
    the number of sound objects followed by the 7-byte
    sound objects), a "flags" section which is one byte
    and finally a four byte record length field.

 For each car ( 13 bytes per car)
    offset size
       0    1   bits 1-7 ==> car ID            (Note 1,6)
                bit    0 ==> Car out of race?
       1    3   Track linear coordinate        (Note 2)
       4    2   Track lateral coordinate       (Note 3)
       6    2   Car Orientation
       8    1   Wheel orientation

                There are sixteen 2-bit damage
                indicators.  The two bits are encoded
                as follows:

                  00 - no damage
                  01 - slight damage to part
                  10 - major damage to part
                  11 - part is gone

       9    1   Wheel indicators
                  bits 0-1 Right rear wheel
                  bits 2-3 Left rear wheel
                  bits 4-5 Right front wheel
                  bits 6-7 Left front wheel

       A    1   Body panels
                  bits 0-1 Hood
                  bits 2-3 Grill
                  bits 4-5 Right front fender
                  bits 6-7 Left front fender

       B    1   Body Panels
                  bits 0-1 Right rear fender
                  bits 2-3 Left rear fender
                  bits 4-5 Right front bumper
                  bits 6-7 Left front bumper

       C    1   Body Panels
                  bits 0-1 Engine
                           A value of 10 indicates the
                           engine is dead.
                  bits 2-3 Rear bumper
                  bits 4-5 Rear panel
                  bits 6-7 Spoiler and trunk


 Graphic Objects
  offset size
     0    1   Number of graphic objects (if 0, no fields follow)

   Object field
    offset size
       0    1   Object type, known types:
                   01 - smoke
                   02 - dirt
                   03 - sparks
                   04 - sparks
                   05 - flying tire

                   0A - All of these have shown up and
                   0B   represent various body panels
                   0C
                   0D
                   0E
                   0F

       1    1   ? (type? altitude?)
       2    3   Track linear coordinate
       5    2   Track lateral coordinate
       7    4   ?
       B    1   ? (altitude?)

 Sound Objects
  offset size
     0    1   Number of Sound fields (if 0, no fields follow)

    Sound field
     offset size
       0    1   ? (always zero?)
       1    3   Track linear coordinate
       4    2   Track lateral coordinate
       6    1   ? (sound type?)

 Flags
  offset size
     0    1   Flags
                01 - Yellow flag
                02 - Green flag
                04 - White flag
                08 - Checkered flag

 Record Length
  offset size
     0    4   Record length in bytes
              (used when reading file backwards)



Notes:
1. Car ID is a number 0-39 which is the index into the array
   of cars in the drivers.txt file.

2. Track Linear Position is the distance along the center line
   of the race track.  Rather than use X,Y coordinates, Nascar
   uses a coordinate system which is distance down the track
   and distance left or right of the center line.  I don't truly
   understand the units, but it is on the order of 1/2 inch.

3. Track Lateral Position is the distance left/right of the
   center line.

4. Offsets are in hexadecimal and sizes are in bytes

5. All of the multi-byte fields are in Intel little-endian
   format.  i.e. least significant byte is stored in the
   lowest addressed byte.

6. When refering to bits within a byte, the bits are numbered
   with the least significant bit of the byte numbered as
   bit 0, and the most significant bit of the byte numbered
   as bit 7.

7. Any field descriptions with question marks (?) represent
   speculation, best guesses and outright ignorance.


This information has been derived from observation of replay
files.  It may be incorrect and incomplete and is certainly
subject to change with different versions of NasCar.  It has
been sufficient to produce various replay file editors.
