This is everything I know about replay files

IndyCar 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

Records (Variable)
    Each record represents 1/15 second.
    In each record there are 10 bytes per car, a graphic
    objects section (one byte identifying the number of
    graphic objects followed by the 12-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 ( 10 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
       9    1   Tire flags (flat/missing tires)
                  bit 0 - Right Front flat
                  bit 1 - Right Front missing
                  bit 2 - Right Rear flat
                  bit 3 - Right Rear missing
                  bit 4 - Left Rear flat
                  bit 5 - Left Rear missing
                  bit 6 - Left front flat
                  bit 7 - Left front missing


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