The online racing simulator
MPR data
(13 posts, started )
#1 - Aid
MPR data
Hi
I wonder if somebody has some experience with MPR file. What i need is location of currenty used tire type of user. What i would like to do is to check how many laps driver did on certain tire compound. In game we can check what tire driver uses so this info is in MPR but i can't find it. Does somebody know where such data is kept?
if he isnt in the pits, he cant change the tires
#3 - Aid
?
I think what he means is, if you watch a replay from the beginning of a race, and the driver does not pit, then he obviously has not changed his tyres, so just count the laps up, and you have the answer!
#5 - Aid
no
the idea is to have a race where is required to use 2 different compounds.. lets say for 33% procent or the race has to be driven on different compound so i need to check if drivers respected that rule. i can't spend watching 2h checking if they actually used another compound for such distance. i need a program that will parse mpr and make stats with info how many laps driver did on certain tire. basically it would be something like LFSStats does but LFSStats doesn't return any tires info.. sadly..
Oh right, in that case i dont know. I guess you mean the driver has to switch between slick R1 and R2 for example?
#7 - Aid
yes. so he can spend 66% distance on r1 but then he has to switch to r2, that would makes races more interesting also setups would have to be done the way that we wouldn't spin every 5 corners
You can do this with InSim, when a player joins or pits information is sent detailing which tyre compounds they are using, so you can figure out how many laps were driven on which tyres. The packets you are interested in are:

struct IS_NPL // New PLayer joining race (if PLID already exists, then leaving pits)
{
byte Size; // 76
byte Type; // ISP_NPL
byte ReqI; // 0 unless this is a reply to an TINY_NPL request
byte PLID; // player's newly assigned unique id

byte UCID; // connection's unique id
byte PType; // bit 0 : female / bit 1 : AI / bit 2 : remote
word Flags; // player flags

char PName[24]; // nickname
char Plate[8]; // number plate - NO ZERO AT END!

char CName[4]; // car name
char SName[16]; // skin name - MAX_CAR_TEX_NAME
[b]byte Tyres[4]; // compounds[/b]

byte H_Mass; // added mass (kg)
byte H_TRes; // intake restriction
byte Model; // driver model
byte Pass; // passengers byte

int Spare;

byte SetF; // setup flags (see below)
byte NumP; // number in race (same when leaving pits, 1 more if new)
byte Sp2;
byte Sp3;
};

struct IS_PIT // PIT stop (stop at pit garage)
{
byte Size; // 24
byte Type; // ISP_PIT
byte ReqI; // 0
byte PLID; // player's unique id

word LapsDone; // laps completed
word Flags; // player flags

byte Sp0;
byte Penalty; // current penalty value (see below)
byte NumStops; // number of pit stops
byte Sp3;

[b]byte Tyres[4]; // tyres changed[/b]

unsigned Work; // pit work
unsigned Spare;
};

#9 - Aid
yes thanks! i just need to find the way to take it from here
Quote from Aid :Hi
I wonder if somebody has some experience with MPR file. What i need is location of currenty used tire type of user. What i would like to do is to check how many laps driver did on certain tire compound. In game we can check what tire driver uses so this info is in MPR but i can't find it. Does somebody know where such data is kept?

You cannot get the info, which type a car began racing, so the aproach from reading a mpr-file will not succeed, thus you'll have to do it via insim, I'm afraid.
But there is info as of which tyre-type was changed to (if changed) during a pitstop ... if that's of any use to you ... you find that info inside the pitstop-event (where the work which is done is given) ... tyretypes are the same as stated in INSIM.txt there ...
#11 - Aid
thanks avetere i'm trying to refresh my programing skills and i will try to write simple program that will connect to lfs via insim and store that data.
The tyre info must be in the MPR. Physics change depending on the tyre compound used, so it must be stored somewhere...Also if you press F12 while in a replay, it shows the user's tyre compounds. How to find it is another matter, I've never touched MPRs before
The information is obviously in the MPR files, but really there is no reason to spend time decrypting an esoteric, undocumented file format, when LFS already provides a public interface for accessing the data. Scawen went to a lot of trouble to make and support InSim, so there is no reason not to use it.

MPR data
(13 posts, started )
FGED GREDG RDFGDR GSFDG