The online racing simulator
mprEdit
(91 posts, started )
#1 - MikeB
mprEdit version 0.4.0 beta
UPDATE - Version 0.4.0 beta available

Finally there is another release of mprEdit!

Download: http://mpredit.origo.ethz.ch/download

Changes since 0.3.3 beta:
=========================

GUI changes:
  • Change semantics of time display to match patch Z replay controls: The times are now always relative to the replay start, not to the race start. => A replay always starts at time 0:00.0, even if the actual race is already running before the replay started.
  • Added event "Body damage" (NOT suspension/engine damage!)
  • You can select different cars for start and end events
  • Selecting events now updates the start and end time controls
  • Splitting is now only happening based on time, not on event index anymore.
  • disable GUI elements when no replay is loaded.
  • add icon.
  • dont add "replay start" and "replay end" event to players
  • Add checkboxes to indicate if splitting should start with replay beginning / end with replay end.
  • show also drivers that dont have any split time recorded
  • add events SPECTATE and FORCED_SPECTATE to selectable events list.
  • fix tab order
  • enable/disable save button depending on the times set - if startTime < saving is allowed.
Bugfixes:
  • Add support for "Vote" Event. This fixes issue #7 - "Unhandled spectate Event" (http://mpredit.origo.ethz.ch/node/33). Not handling votes resulted in completely corrupt connection tables - I wonder why this has not been detected earlier ;-)
  • Allow multiple events for one timeframe - This fixes some bugs when within one timeframe more than one driver got a "FORCED_SPECTATE" from the server/admin. Happens e.g. on CTRA servers where people are sent to spectate when joining mid-race.
  • compact connectiontable after all events of a timeframe are handled. Fixes parsing of CD1.mpr, where in one timeframe a driver disconnects and another connects.
  • Improve parsing of Driver changes - now driver change also recognized correctly when dedicated server is NOT used.
  • Add, parse, interpret and set "isServer" char of SERVER_JOIN structure.
  • Support events MODEL_UPDATE and HELMET_UPDATE. Drivers should now always be the correct model and wear correct helmet
  • Filter duplicate timeframes from presplitevents (One timeframe can have multiple events - this resulted in duplicate timeframes before!
  • Only get the last events of type SPLIT_FINISHED, MODEL_UPDATE, HELMET_UPDATE for the presplitevents. Should have the same result, but decreases leadtime of generated replays during playback A LOT.
  • Store the last 3 split_finished events for each driver. So we are sure that the lap information and driver position is correct.
  • Add basic session type (race/qualy/training) detection.
  • Fix patch Z replay controls of created replays: Set the correct replay duration for generated replays.
As you may have read my original plan was to include dynamic mpr header generation so we can get rid of the "message flood" at the beginning of a splitted replay. Although i got that pretty much working there is an issue with the car setup data encryption inside the mpr files. As long as this is not solved it will be impossible to use dynamic header generation. So i moved all that stuff to a separate release branch and switched back to the old method of splitting. Maybe this can be solved in a future release but i need more time to investigate and think about possible solutions...

Have fun

UPDATE - Version 0.3.3 beta available

Fixed a critical bug that prevented splitting of replays with driver changes.
Download: http://mpredit.origo.ethz.ch/download

Changes since 0.3.2 beta:
=========================
Fix Bug #8 reported by DeadWolfBones and Birder.

UPDATE - Version 0.3.2 beta available

Finally supporting time-based splitting! See screenshot and read on for further changes.
Download: http://mpredit.origo.ethz.ch/download

Changes since 0.3.1 beta:
=========================
FEATURES:
- Add correct parsing of race time information.
- Add option to split based on time to GUI.
- Filter special LFS codes (colors, codepage) from driver names.
- Implement suggestion by J.B.: Relabel "save" button to "save as...".
- Add support for InitialRaceState parsing. Currently implemented:
-> Initial number of pitstops
-> Initial number of laps done
- Fix Issue #3 (http://mpredit.origo.ethz.ch/node/29): Last used directory should be stored.

BUGFIXES:
- Small cleanups of parsing code.
- Fix off-by-one error for lap count.
- small GUI cleanups
- some more GUI rework. Finally resizing support
- GUI: Fix tab order


UPDATE - Version 0.3.1 beta available

This is the first release where splitting seems to work reliable in most cases. Therefor I dare to call it "beta" instead of "alpha"

http://mpredit.origo.ethz.ch/download

Important changes since 0.3.0:
  • add "CHANGE_CONTROLLER" Event handling and add it to PreSplitEvents. This fixes cars jumping around on track in splitted replay.
  • Set the correct drivers to driverchange events. (target and initiator were sometimes exchanged)
  • Include localdriverchange in the PreSplitEvents. Otherwise LFS would not recognize changed names.
  • Restore dataEnd pointer after splitting a replay. This fixes the problem that you could only save once, subsequent replays would be missing 4 Bytes after the headerdata.
  • Cancel all driverchange requests on a driver when he issues a dc request for ID 0. This fixes the issue of double Driver change in MoE24h replay (changing car 04 from Weingram top Arens, TimeStamp: 18442)
  • Major changes to fix parsing of 24hr replay (Fix ID changing issues, Dont use drivername to connect car with driver)
  • fix detection of players leaving race
  • Introduce globally unique IDs for Cars and Drivers since the LFS IDs can repeat within a long replay (24hrs...)
  • Don't read the whole file into memory at startup. Instead use memorymapped file access. Surprisingly simple thanks to the great boost library!
  • Further improve memory footprint and parsing speed. Using mem-mapped file access now everywhere where it is possible.
  • display the chat message about mprEdit AFTER the PreDatapackes. Otherwise it scrolls out of screen too fast.
  • add "EVENT_JUMP_TO_PITS" to event selection.
  • Select the first player of PlayerCombo by default.
  • resize and rearrange controls.
  • fix tab-order.
  • dont display save result in status area - This is done through messagebox anyway.
  • Change order of split events so the "replay end" is the last event.
  • Support driver change as selectable event
  • sort drivercombobox alphabetically
  • display all drivers of a car instead of only the first one
UPDATE - version 0.3.0 is now available
http://mpredit.origo.ethz.ch/download
This release of mprEdit contains substantial changes "under the hood", while the GUI is still the same as in the 0.2 series.

Originally I had planned to further improve the GUI and lower the memory consumption. But since the demand for support of driver changes and joining/leaving server was quite high i decided to provide the first release in the current form.

Changes since 0.2.2:
  • Support players joining/leaving server at any time of the replay
  • Support players swapping cars during a pitstop
  • implement "method 2" of splitting to preserver the correct driver and connection IDs of all players. (See http://mpredit.origo.ethz.ch/wiki/How_to_split_a_replay for details)
  • Rewrite of parsing engine - it should not happen anymore that events are not recognized
  • display a chat line "replay created using mprEdit" when a splitted replay is played in LFS.
UPDATE - version 0.2.2 is now available
Changes of 0.2.2:
  • Only open Patch Y replays
  • Improve parsing of playernames
It seems Scavier implemented some slight changes in the mpr format with patch Y that i missed in the first release. Some replays parsed fine, some showed only garbage for the names. This version should fix this issue
Direct download link: http://download.origo.ethz.ch/mpredit/mprEdit_0.2.2.zip

UPDATE - version 0.2.1 is now available

Hello,

i want to introduce to you the project i am currently working on: mprEdit.

As you know there is no way to rewind a replay. So it is very hard for any league admin to review a certain race incident multiple times. mprEdit offers the possibility to split a replay into multiple separate replays. So you can extract the part with the incident and review it multiple times without having to do endless fast forwarding.

Limitations of the current version:
  • mprEdit tries to load the complete replay into memory. This leads to system performance/stability issues when loading large replays (e.g. the MoE replay of 24hrs race is 500MB in size - i did not manage to load it without crash or Windows running out of virtual memory...)

  • Driver change: The GUI displays only the name of the first driver of a car.
    Example:
    Jane is driving 12 laps, then makes a pitstop and Joe is taking over her car, continuing the race another 10 laps until finish. The GUI will only display Jane with a total of 22 laps.
  • Multiple race joins: Whenever a driver joins the race LFS assigns him a "new" car. Therefore during a replay a driver might have many different cars. To distinguish between these different "sessions" each driver is displayed with his car in brackets.
    Example:
    John joins the race from the start. Unfortunately he crashes out in the third lap. He decides to jump to the pits and rejoin the race.
    The GUI will display:
    "John (car 0)": This entry covers laps 1 to 3.
    "John (car 1)": This entry covers the rejoin after the crash in lap 3. (Note that the actual lap count is starting at 1 again!)

    Note: Cars are only displayed if they reached at least the first split of a lap.
Please see the project homepage for further info, documentation and downloads:

http://mpredit.origo.ethz.ch/



This release is still of alpha quality, so i expect that there still are many bugs and issues left. Please report anything that seems wrong here in the forum or open an Issue on the project homepage.
Attached images
mprEdit_040.PNG
A very very good initiative I'll give it a go asap.
just what i needed, thx ill give it a go
#4 - adin
link don't work, can i please a re-upload?
#5 - J@tko
Excellent work!!!
ive been waiting so long for this.
Wow, this is something that been needed for a while. I personally think this is something the LFS administration should have fixed a long time ago, but now I could care less. Thanks mate.
#9 - MikeB
I'm glad you all like it
I'll keep you posted about the progress of time (or lap) identfication. But so far i did not have much success...
Anyway also a gui is on my todolist
if i press Ctrl+Shift i see date of race. (date and time) may be use this data if it possibly.
Quote from A.Fedorov :if i press Ctrl+Shift i see date of race. (date and time) may be use this data if it possibly.

Thanks for the tip However it seems that this time information is not stored in the replay data itself - It is generated by LFS in real-time during playback of the replay data... But i need something that is in the raw .mpr data to identify the time/lap progress.
i tried this software but i dont know how to use it. could you make simple step-by-step guide please? thanks
Quote from Ondrejko :i tried this software but i dont know how to use it. could you make simple step-by-step guide please? thanks

It's rather easy Just keep in mind that there is no GUI.

1. Copy mpredit.exe somewhere in your %PATH. ("C:\Windows" will do)
2. open command prompt
3. type "mpredit" and hit return
=> You should see version info etc.

Now to get info about a replay type:
"mpredit path_to_replay.mpr"

This shows you many infos. Interesting is the number of timeframe packages.

To split a replay type:
"mpredit path_to_replay first_frame last_frame path_to_new_replay"

There is also some documentation on the website.
Quote from MikeB :It's rather easy Just keep in mind that there is no GUI.

1. Copy mpredit.exe somewhere in your %PATH. ("C:\Windows" will do)
2. open command prompt
3. type "mpredit" and hit return
=> You should see version info etc.

i did that but black window mpredit will dissapear as soon as i press Enter
#15 - troy
Quote from Ondrejko :i did that but black window mpredit will dissapear as soon as i press Enter

i guess you misunderstood him there, you need to extract mpredit.exe in your windows installation folder (c:\windows\ for example) then hit the start button on the left of your task bar, now press "run", write cmd in the textbox and hit enter.

then you have your command prompt open, now follow mikeb's instructions

Quote : 3. type "mpredit" and hit return
=> You should see version info etc.

Now to get info about a replay type:
"mpredit path_to_replay.mpr"

This shows you many infos. Interesting is the number of timeframe packages.

To split a replay type:
"mpredit path_to_replay first_frame last_frame path_to_new_replay"

There is also some documentation on the website.

Attached images
start_run.gif
Quote from troy :i guess you misunderstood him there, you need to extract mpredit.exe in your windows installation folder (c:\windows\ for example) then hit the start button on the left of your task bar, now press "run", write cmd in the textbox and hit enter.

then you have your command prompt open, now follow mikeb's instructions

thank you, it works now
If you get the time issue solved this will be an exciting tool.

Some suggestions:

- Add an option to split the mpr file into X separated mprs of the same size automatically. Let's say you have an mpr which is an hour long race. You execute "mpredit path_to_mpr -split 4" and then it generates 4 mprs which are "approximately" 15 minutes each.
Version 0.2.1 is now available with major changes. See first post for screenshot and details
Nice!

really a great tool for movie-editing and crash/lap analyzation
I haven't actually tried this, but judging by the screenshot - woudn't it be handy to have an input box to enter the filename and have the new (cut) mpr saved there? If I understand correctly, now you will cut the original mpr and lose all data from before/after the split frames. Am I right?
Quote from maczo :I haven't actually tried this, but judging by the screenshot - woudn't it be handy to have an input box to enter the filename and have the new (cut) mpr saved there? If I understand correctly, now you will cut the original mpr and lose all data from before/after the split frames. Am I right?

No, the screenshot and/or button labeling might be misleading When you click "save replay" you'll get a file dialog asking for the new file to save to. The original mpr will of course not be overwritten.
Cool
Great app, I think you should get a special prize from movie makers
Quote from MikeB :No, the screenshot and/or button labeling might be misleading When you click "save replay" you'll get a file dialog asking for the new file to save to. The original mpr will of course not be overwritten.

perhaps just make it "save replay as ..." or just "save as"
I've yet to try it but from what I've seen so far I have to say I'm very impressed with this little tool, thanks again for your work Mike its been a god send
Hello,

Great application! . One question this software is released under the GPL v3 license. Where can i find source? i very interested to know how mpr are do.

Thank's for your response.

Gai-Luron

mprEdit
(91 posts, started )
FGED GREDG RDFGDR GSFDG