The online racing simulator
mprEdit
(91 posts, started )
#51 - troy
great progress i didn't have much use for it so far but its nice to finally have something available to split the replays
I've only done one test so far with a car that started the race from pits and it worked fine

The only thing that bugs me is that positions are totally distorted when loading replays until the cars pass checkpoints or the start line. I don't know if this can be fixed somehow though.

Great job so far!
Awesome, Mike
Version 0.3.1 beta now released! Check the first post for details.
Awesome work, Mike!
Nice work!
Saved me a lot of time

Suggestion: automatic split of replay by laps. If race has 24 laps, mprEdit splits replay into 24 replays. Could be very interesting for movie making.
Quote from s1m0n :Nice work!
Saved me a lot of time

Suggestion: automatic split of replay by laps. If race has 24 laps, mprEdit splits replay into 24 replays. Could be very interesting for movie making.

Somebody already suggested slicing to parts based on the time, which is not possible since as Mike said, he doesn't see any time stamp info inside the MPR data. Dividing by laps (of the leader?) would help.
+1

Mike, eventhough there is no chance to tell the time within a replay, would it be possible to load a replay, and get just last 5 minutes for example? So the MPRedit would "rewind" 5 minutes back from the point I saved the replay, cut it, and saved only the last 5 minutes of the original replay?
It would be awesome for any accidents or crash reports. Admin saves a replay, MPRedit cut last few minutes, saves short replay with a crash, admin can review it immediately in another LFS instance.
Well and, to be able to save another replay later (should another crash happen), he has to quit/rejoin the server to activate MPR recording...
Dont worry, I am just about to implement support for time-based splitting Last week I had a business trip to US so i had plenty of time during the flight... So the next release will support splitting based on race time
Quote from MikeB :Dont worry, I am just about to implement support for time-based splitting Last week I had a business trip to US so i had plenty of time during the flight... So the next release will support splitting based on race time

Amazing
Truely Amazing.

Um dude, this just saved me like 2 hours work, cutting a 14MB replay into the exact moment we needed..... up to a point at start of some random guy's lap 12 from the 15MB marker.

Our server is down for a few hours for maintenance, but when it's back online I'm delivering 3 brand new top GTR's into your CLC garage and 100,000 Euros spending money on our server. (Thats about 4-6 weeks worth of work on our server)

I see you haven't used our server before, but you are of course most welcome sir.

Thanks Grand Master MikeB.
Suggestion: To be able to set the start and ending points at events of different drivers. I mean, like the resulting mpr starts when driver A begins lap 10 and ends when driver B enters the pits. This may be a little troublesome, but I've had times when I'd liked to be able to do this.

This little app has saved me a lot of time for when reviewing accidents and for making video captures.

I get the most out of it when using it with lfs-stats. In our league we generate stats for every race and division with lfs-stats which are put online. The graphs generated at the end of the stats file give you quite an accurate view of when you come across a certain someone during the race, be it an overtake or an accident. Then I just cut the mpr file using mpredit and I got it

If you are interested in understanding that better. Here's an example:
http://www.q3team.es/estadisticas/20080317/1/indexR.html

That's last week's race, in which I happenned to win but was given a penalty. In the last graph you can see that I ([Q3] makakazo) had an incident with a car at the beginning of lap 14, as a line touches mine and suddenly drops.

I didn't remember which lap that was at all after 40 laps, but using the stats you can easily find incidents involving any car, and then using mpredit you can cut the exact point you need, be it a 50 or 100 laps race or whatever
Hello,

I have some question for you MikeB

I plain to rewrite LFSStat without using Replay with LFS. I download your source, look in IT and i write a little application for now read MPR and Frame. For convenience i use PLID as CarId ( like insim ) and UCID as connectionID. For PlayerID there is not an equivalence in insim ( in the old insim version, it's present )

Along the replay UCID change permanently, there is a packet where i can find this modification?
For now, i update UCID when it's change in Frame. I Need this info for message parsing. Unfortunately, message send only UCID. Retrieving message parsing work with this method perfectly.

Now and this is my big problem, some STARTFINISHLINE packet are missing in replay. It's normal or there are an other packet sending this info or i make a mistake? I try to find if lap time are assigned to another player, but this laptime don't appear in any place in the replay.

If i get ENTERPIT frame, there are not UCID or PLID? so strange, but LEAVEPIT yes!

And the last, what is the Frame 0xFD? I think it's possitionning or MCI ( insim ) packet like? i'am right?


Thank's for your job

Gai-Luron
Quote from MaKaKaZo :Suggestion: To be able to set the start and ending points at events of different drivers. I mean, like the resulting mpr starts when driver A begins lap 10 and ends when driver B enters the pits. This may be a little troublesome, but I've had times when I'd liked to be able to do this.

This little app has saved me a lot of time for when reviewing accidents and for making video captures.

I get the most out of it when using it with lfs-stats. In our league we generate stats for every race and division with lfs-stats which are put online. The graphs generated at the end of the stats file give you quite an accurate view of when you come across a certain someone during the race, be it an overtake or an accident. Then I just cut the mpr file using mpredit and I got it

If you are interested in understanding that better. Here's an example:
http://www.q3team.es/estadisticas/20080317/1/indexR.html

That's last week's race, in which I happenned to win but was given a penalty. In the last graph you can see that I ([Q3] makakazo) had an incident with a car at the beginning of lap 14, as a line touches mine and suddenly drops.

I didn't remember which lap that was at all after 40 laps, but using the stats you can easily find incidents involving any car, and then using mpredit you can cut the exact point you need, be it a 50 or 100 laps race or whatever

Hi Makakazo,
I also thought about making start and end events from different drivers possible. I hesitated because i think it might make the GUI too complicated. But i think you are right, it might be really usefull.
=> Suggestion noted for future release
Quote from Gai-Luron :Hello,

I have some question for you MikeB

Funny that you are getting to the same difficulties i had before But i think can help you now

Quote from Gai-Luron :Along the replay UCID change permanently, there is a packet where i can find this modification?
For now, i update UCID when it's change in Frame. I Need this info for message parsing. Unfortunately, message send only UCID. Retrieving message parsing work with this method perfectly.

If you know how it is working the answer is easy But it took quite some time to figure this out: There is no package notifying you of changed UCID. Instead the UCIDs are changed by LFS automatically everytime a driver leaves the server. The driver with the highest UCID is moved to the UCID of the driver that has left the server.
You can find this in my code in method
CReplay::compactConnectionTable

This way it is always assured that there are no "holes" in the list of connections.

Quote from Gai-Luron :Now and this is my big problem, some STARTFINISHLINE packet are missing in replay. It's normal or there are an other packet sending this info or i make a mistake? I try to find if lap time are assigned to another player, but this laptime don't appear in any place in the replay.

The packages are not missing, but they are kind of delayed. Sometimes a packet does contain additional data after the first part. Have a look at method
CTimePacket::checkEvent

There I read the data size and packettype (Bytes 7 and 8). If the packettype is unknown i jump forward by the size of data and interpret the following data again with the checkEvent() method (see default-handler of switch statement). This is repeated until the end of the package is reached.
You definitely need this handling, because not only STARTFINISH events are sometimes located in this "delayed" data, but also other events sometimes are contained in the later data.

Quote from Gai-Luron :If i get ENTERPIT frame, there are not UCID or PLID? so strange, but LEAVEPIT yes!

Yes, thats true. For ENTERPITS there is only the carID available. For leaving pits there is also the connectionID.

Quote :And the last, what is the Frame 0xFD? I think it's possitionning or MCI ( insim ) packet like? i'am right?

I am not sure - I think it just contains the "normal" race data like car position etc.

Hope I could help you

Mike
Thank you very much for your response.

Quote :There I read the data size and packettype (Bytes 7 and 8). If the packettype is unknown i jump forward by the size of data and interpret the following data again with the checkEvent() method (see default-handler of switch statement). This is repeated until the end of the package is reached.
You definitely need this handling, because not only STARTFINISH events are sometimes located in this "delayed" data, but also other events sometimes are contained in the later data.

I don't understand sorry . Next first time stamp for my replay. In Red events. You can find all file http://ks37764.kimsufi.com/tmp/readMpr.htm. If you can do an example, i will be very happy .

Thank's

Gai-Luron

07, 00, fc, 15, 05, 00, 04, [COLOR=red]1e[/COLOR], 05, 00, 00

0d, 00, fc, 00, 0d, 00, 0c, [COLOR=red]28[/COLOR], 00, 4b, 0e, 00, 5c, 55, 41, d9, 32, 85, bf

0f, 00, fc, 15, 05, 00, 04, [COLOR=red]1e[/COLOR], 00, 00, 00

1b, 00, fc, 15, 05, 00, 04, [COLOR=red]1e[/COLOR], 05, 00, 00

24, 00, fc, 15, 05, 00, 04, [COLOR=red]1e[/COLOR], 00, 00, 00

38, 00, fc, 0c, 39, 00, 38, [COLOR=red]02[/COLOR], 31, ff, 00, c2, 00, 00, 00, 00, 00, 00, 00, c7, 71, 1c, 00, c7, 71, fc, 07, 00, 00, 00, 00, c7, 71, 1c, 00, c7, 71, fc, 07, 00, 00, 00, 00, c7, 71, 1c, 00, c7, 71, fc, 07, 00, 00, 00, 00, c7, 71, 1c, 00, c7, 71, fc, 07

60, 00, fc, 0b, 39, 00, 38, [COLOR=red]02[/COLOR], 18, ff, 00, c4, 00, 00, 00, 00, 00, 00, 00, c7, 71, 1c, 00, c7, 71, fc, 07, 00, 00, 00, 00, c7, 71, 1c, 00, c7, 71, fc, 07, 00, 00, 00, 00, c7, 71, 1c, 00, c7, 71, fc, 07, 00, 00, 00, 00, c7, 71, 1c, 00, c7, 71, fc, 07

62, 00, fc, 12, 05, 00, 04, [COLOR=red]0d[/COLOR], 2b, 00, 00

73, 00, fc, 00, 05, 00, 04, [COLOR=red]0c[/COLOR], 08, 00, 00

8e, 00, fc, 14, 3e, 00, 38, [COLOR=red]02[/COLOR], 42, ff, 00, c4, 00, 00, 00, 00, 00, 00, 00, c7, 71, 1c, 00, c7, 71, fc, 07, 00, 00, 00, 00, c7, 71, 1c, 00, c7, 71, fc, 07, 00, 00, 00, 00, c7, 71, 1c, 00, c7, 71, fc, 07, 00, 00, 00, 00, c7, 71, 1c, 00, c7, 71, fc, 07, 04, 0d, 1a, 00, 00

-
(Gai-Luron) DELETED by Gai-Luron
Ok, i find infos alone

this is the result

Timeframe details

----------------------+-----------------------+ ... +--------------------+
LSB MSB LSB MSB| |
00 00 00 00 00 00 04 00 00 00 00 00 ... 00 00 ....
--+-- -- -- ---+--- -- -- -- --
| | | | | | | | Event
| | | | | Event |
| | | | | Subframe Number
| | | | Subframe Number subsequent bytes
| | | | subsequent bytes
| | | |
| | | frame subsequent bytes
| | UCID
| |
| FrameMarker
|
TimeStamp ( unsigned short )

TimeStamp:
2 bytes timestamp, return to 0 when = #FFFFF

Framemarker:
#FC -> Event frame
#FD -> Messages frame
#FE -> Car positionning, maybe like MCI in insim packet

UCID:
Unique connection ID. When a player leave a connection ( slot ), the player who have upper UCID
get this leaved connection

frame subsequent bytes:
Number of bytes to read after this to completely read a frame

Subframe Number:
Number of bytes to read after this byte to get a subframe. There is one or more subframe.
Each subframe aquire TimeStamp, framemarker and UCID for the main frame

You got it :-) Sorry i did not answer before, but i am currently short of spare time due to additional workload at my job :-(
Version 0.3.2 beta now released! Check the first post for details.
Thanks for the new update

I remembered why I wanted to be able to select another pilot for the ending. There are some times when there's an accident and the pilot disconnects after getting upside down, but I don't want the replay to end either when he disconnects or at the end of the actual replay, so I'd rather pick another driver for the ending point.

Btw, thank you for fixing the colour tags in the driver selection, now it's much clearer
Quote from MaKaKaZo :Thanks for the new update

I remembered why I wanted to be able to select another pilot for the ending. There are some times when there's an accident and the pilot disconnects after getting upside down, but I don't want the replay to end either when he disconnects or at the end of the actual replay, so I'd rather pick another driver for the ending point.

Yeah, that's still on my TODO-List
Wonderful work, Mike.
I have a couple of suggestions. I think I (or somebody else) already made them but now that the basic stuff is working reliably I guess you could start thinking about a workraound for this:

1) Fixing race positions/number of laps.

When the replay starts everybody's position and lap are messed up. Everybody's lap is 1 until they cross the start line and then their lap number gets fixed. With race positions I'm not sure how they are generated but they are incorrect and they don't get fixed when racers cross the start line.

It would be nice that mpredit could automatically fix these two things so that at the moment that the replay starts everybody's position and lap are correct and you know tha actual situation of the race.


2) Possibility to choose what driver is the focus (camera) on when the replay starts. I don't know if this is even possible, but would be nice.


Thanks again for your hard work Mike
Hi Mike,

Had some issues today and yesterday working with the 4hr replay from the IGTC race.

If I tried to cut a small replay of the last few laps of the race, it appeared to work correctly but when I'd go in-game to view it, it would only show one car on-track (where there should have been 21 or so).

The full replay is here: http://www.spdoracing.com/events/replays/2454.mpr

Cut replay is attached.
Attached files
IGTC R3 End.mpr - 1.7 MB - 356 views
Quote from MaKaKaZo :I have a couple of suggestions. I think I (or somebody else) already made them but now that the basic stuff is working reliably I guess you could start thinking about a workraound for this:

1) Fixing race positions/number of laps.

When the replay starts everybody's position and lap are messed up. Everybody's lap is 1 until they cross the start line and then their lap number gets fixed. With race positions I'm not sure how they are generated but they are incorrect and they don't get fixed when racers cross the start line.

It would be nice that mpredit could automatically fix these two things so that at the moment that the replay starts everybody's position and lap are correct and you know tha actual situation of the race.

Yeah, I know that this is very annoying. But there are some things that need to be changed in the way mprEdit works before i can really fix these issues. I need to implement proper setting of initial car & driver status, instead of just putting all "important" events to the beginning of the replay. This still needs some research and will definitely take few more weeks. But when that is done a cutted replay should be exactly the same like a replay saved by lfs

Quote from MaKaKaZo :2) Possibility to choose what driver is the focus (camera) on when the replay starts. I don't know if this is even possible, but would be nice.

I THINK that at a replay start always the first position is in the focus. (Can you confirm?) If that is the case this will "automatically" fix with the change for the correct lap and position info described above. But this also means it will not be possible to freely select any player for the initial focus.

Quote from DeadWolfBones :If I tried to cut a small replay of the last few laps of the race, it appeared to work correctly but when I'd go in-game to view it, it would only show one car on-track (where there should have been 21 or so).

The full replay is here: http://www.spdoracing.com/events/replays/2454.mpr

Cut replay is attached.

Thanks for the report, i will have a look at it ASAP. Is the problem always appearing or only with certain split parameters? If not always, please provide the split parameters you used. Thanks
Quote from DeadWolfBones :Hi Mike,

Had some issues today and yesterday working with the 4hr replay from the IGTC race.

If I tried to cut a small replay of the last few laps of the race, it appeared to work correctly but when I'd go in-game to view it, it would only show one car on-track (where there should have been 21 or so).

The full replay is here: http://www.spdoracing.com/events/replays/2454.mpr

Cut replay is attached.

Same problem here, tried lap 49 sector 1 to lap 51 sector 1 and sevel cars are missing

When mprEdit reads the replay its says " xxxx Disconnected" for severl players.

I have tried it with different start and end times but its always the same

mprEdit
(91 posts, started )
FGED GREDG RDFGDR GSFDG