Thanks for clarifying
Well' I don't have any .h file, but here's what I know so far
File starts with this:
std::string comment; // string varies in length. It's terminated with 0x0A character in file
char unknown1[8];
unsigned long rfmFileNameLength;
char* rfmFileName; //varies in length (given above)
unsigned long unknownStringLength1;
char* unknownString1; //not sure if' there is any string at all here. I got unknownString = 0 in replays I've tested so far
unsigned long scnFileNameLength;
char* scnFileName;
unsigned long aiwFileNameLength;
char* aiwFileName;
unsigned long unknown2;
unsigned long playerCount;
Now comes player list, each player described by
unsigned char slotID;
unsigned char driverNameLength;
char* driverName;
unsigned char coDriverNameLength;
char* coDriverName;
char vehicleName[32];
char skinFile[32];
unsigned char upgradePack[8];
float entryTime;
float exitTime;
Now there are 36 bytes I Ignore. I gess there is some kind of event count here and other stuff. I just read events until I hit the end of file
After these 36 bytes comes the event list. They're packed in groups. Each group has a timestamp and a list of events that occured at that time.
float timestamp;
unsigned char eventCount;
unsigned char unknown1; //or is eventCount a 16-bit value?
Now events in this group:
unsigned long eventHeader;
unsigned char eventTimeAdjustment;
Now you can use GetClass, GetFlag, GetType and GetSize functions from header given by ISI.
If your application recognizes the event, it can read it, if not it can skip next GetSize() bytes and read next event in group.
Here's partial info on one of events (class = ECLASS_LOC, type = ETYPE_ZIPLOC_1 ... ETYPE_ZIPLOC_7)
unsigned long mInfo1;
unsigned long mInfo2;
unsigned char unk1[18];
float posX; // position of the car
float posY;
float posZ;
float angX; // orientation of the car
float angY;
float angZ;
Now, from mInfo1 you can extract some things:
int rps = mInfo1 >> 18; // engine rpm?
int thr = (mInfo1 >> 12) & 0x01f; // throttle pedal 0...31
int brk = (mInfo1 & 0x0800) ? 1 : 0; // brake lights
int ste = (mInfo1 & 0x07f) - 64; //steering wheel position -64...+63
int acc = mInfo2 >> 24; // sorry, can't remember what it was
There's more stuff in mInfo2 and in these 18 bytes I marked as unknown. Probably suspension positions, angular and linear velocity of the car, maybe brake glow. If someone has time to figure it out, and perhas info on format of other events, he can post it here.
Of course remember to unzip .vcr file first if it's compressed
