This is everything I know about replay files

Indycar2 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 Left front wheel
                  bits 2-3 Right front wheel
                  bits 4-5 Left rear wheel
                  bits 6-7 Right rear wheel

       A    1   Body/Chassis components
                  bits 0-1 Left front wing
                  bits 2-3 Right front wing
                  bits 4-5 Nose Cone
                  bits 6-7 Left front side pod

       B    1   Body/Chassis components
                  bits 0-1 Right front side pod
                  bits 2-3 Left rear side pod
                  bits 4-5 Right rear side pod
                  bits 6-7 Tail cone

       C    1   Body/Chassis components
                  bits 0-1 Rear wing
                  bits 2-3 Engine cover
                  bits 4-5 Engine
                  bits 6-7 Transmission


 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


       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-32 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, Indycar2
   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.3 cm.

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 Indycar2.  It has
been sufficient to produce various replay file editors.
