The online racing simulator
champstat
(17 posts, started , go to first unread)
#1 - expr
champstat
champstat is an application that creates HTML presentation out of your well-preserved league replays, both race and qualifying. For each event, separate results pages are created, and additionally all results are combined in a series summary. To use this tool, you must create a directory for the executable (and conf), and then put all event replays into their own subdirectories (one per event – the name is ignored).
Then run the application (if everything goes according to plan, the application will run only very briefly, and you should have your HTML – errors may need acknowledging, but there's no user interface per se.)


Directory structure

champstat/
champstat/champstat.exe
champstat/champstat.conf
champstat/directory-names-dont-matter/neither-does-this.mpr
champstat/directory-names-dont-matter/or-this.mpr
champstat/event2/champstat.conf <-- event-specific rules
champstat/event2/q1.mpr
champstat/event2/q2.mpr
champstat/event2/race.mpr

Additionally, you can define your own scoring system by creating a file named champstat.conf. Also, event subdirectories can contain event-specific rules which by default inherit global rules. An example main configuration is included in the archive (lines starting with a semicolon are comments, and ignored by the application, but you should probably read them the first time). A word of caution: configuration files are not Windows Notepad files; you might be able to use Notepad to edit them, but you should not put any options on the first line because Notepad may add invisible extra characters at the beginning of the file, which prevents options from working.

The app is still very much in alpha stage, so bugs can be expected (especially with the Windows Console and its quirks). Suggestions are welcome.

Change log:
2020-03-31: Release 0.2c fixes some reported issues with penalties.
2021-03-05: Release 0.2d fixes an issue with 0.6V replays
2021-04-06: Release 0.3 includes a (very) limited templating system
Attached files
champstat-0.2.zip - 271.2 KB - 253 views
champstat-0.2b.zip - 275.7 KB - 197 views
champstat-0.2c.zip - 346.8 KB - 173 views
champstat-0.2d.zip - 340.1 KB - 14 views
champstat-0.3.zip - 347.9 KB - 15 views
Works like a charm
I managed to get it running feeding with Fragmaster's League replays.
Please consider adding more settings for awarding shared points. For example
shared-points-fastest-lap-mode
shared-points-highest-climber-mode

It will avoid manually adding and removing points according to league rules.
#4 - expr
Quote from jackson93 :I managed to get it running feeding with Fragmaster's League replays.
Please consider adding more settings for awarding shared points. For example
shared-points-fastest-lap-mode
shared-points-highest-climber-mode

It will avoid manually adding and removing points according to league rules.

More granular options are now available (shared-points-mode-fastest-lap, shared-points-mode-fastest-qualifier, shared-points-mode-highest-climber).

Release 2 also has options for customising output table columns and their order.

(edit: oh, and just a reminder: there are existing tools – like mpres AFAIK – that can get you much fancier statistics from MPRs. Despite the generic description in the opening post, this tool is mostly about a very simple way of keeping track of points, where it should be okay as long your scoring system is simple enough and requires finish results anyway. Although I first started this tool to extract "silly" stats like gear change counts from replay data, I decided against using data from the undocumented parts of MPRs because, again, there are already tools for that... although I'd really like to fix that issue with fastest laps :-)...)
Hello there,

I have been using this great tool for tracking multiple seasons (http://borntorace.eu/fmgtileagues/, https://lfs-points.000webhostapp.com/so/) of leagues and it works great. Thank you, expr. So if anybody needs some tracking program based on LFSW names I can recommend champstat for you.

One thing that I think was omitted during development was information about amount of laps/time scheduled in the race.

---
EDIT

Hello again,

I found one bug with highest-climber-with-qualifying-time. In qualifying racer B2マ Skattle scored 18th position, but started the race from the back. He then got high climber for that. In race it says grid 34.
Replay qualifying.
Replay race.
Global config.
Event config.
#6 - expr
Quote from jackson93 :Hello there,

I have been using this great tool for tracking multiple seasons (http://borntorace.eu/fmgtileagues/, https://lfs-points.000webhostapp.com/so/) of leagues and it works great. Thank you, expr. So if anybody needs some tracking program based on LFSW names I can recommend champstat for you.

One thing that I think was omitted during development was information about amount of laps/time scheduled in the race.

---
EDIT

Hello again,

I found one bug with highest-climber-with-qualifying-time. In qualifying racer B2マ Skattle scored 18th position, but started the race from the back. He then got high climber for that. In race it says grid 34.
Replay qualifying.
Replay race.
Global config.
Event config.

Hi, I must've missed the notification on this one. I agree that the current behaviour is not optimal, so as a quick fix I added yet another option, highest-climber-from-qualifying-position, that can only be awarded to drivers whose grid position is equal (or better) than their qualifying result. Admitted, it's not a perfect fix in case the starting grid is massively smaller than qualifying. I might implement a more thorough check when I have the time.

Also included race duration info on race result pages (hoping I didn't break anything in the process) :-)
#7 - expr
I've released a new version, 0.2c, that (hopefully) fixes a bug that occurred in certain cases when custom penalties were used. If you use the penalties functionality, you should probably upgrade. As the naming might suggest, there are few other changes.

The keen-eyed amongst us may have noticed that the application has bumped up in size. This unfortunate, albeit perhaps insignificant change is due to a change to a 64-bit release. While not a technical necessity, this was the only way I could avoid some rather disturbing false positives that plagued the 32-bit executable when scanned at an online anti-malware service. I've checked the now-released 64-bit version, and also the zip archive, and they shouldn't have any – shouldn't, indeed!

Hoping that this will not be an issue in 2020, all the future releases will be 64-bit exclusive as well, should there be any. Cheers!
Hey expr!

Thank you for the program. It works really great and I am a big fan of it. I also might have done a bit of advertisment across various discords in different contexts.
I love the support of rational numbers in addition to natural numbers for the point scoring. I played around with it as rational numbers are inherent to the Open Endurance Cup (Nürburgring Endurance Series) point system.


There are two features that might be handy:
  • Custom bonus/penalty points: In OEC I award bonus points to teams and drivers that use a skin with all official elements. I could do a work-around by using the modify-points options, but if I understand the option correctly, it overrides any points scored in the event, so I still have to calculate the points scored for the position plus the bonus or minus the malus by hand.
  • One feature that I'd like to see is support for endurance races with driver changes as currently it only lists the driver finishing the race, but not the driver(s) that drove the car in earlier stints. Again for now I help me with modify-points but team standings become inflated.
Keep up the great work!


EDIT: Never mind what I said as first point was wrong, it obiously works
#9 - expr
Quote from TFalke55 :There are two features that might be handy:
  • Custom bonus/penalty points: In OEC I award bonus points to teams and drivers that use a skin with all official elements. I could do a work-around by using the modify-points options, but if I understand the option correctly, it overrides any points scored in the event, so I still have to calculate the points scored for the position plus the bonus or minus the malus by hand.
  • One feature that I'd like to see is support for endurance races with driver changes as currently it only lists the driver finishing the race, but not the driver(s) that drove the car in earlier stints. Again for now I help me with modify-points but team standings become inflated.

Hi,

Good thing we got that first thing sorted out already :-)

Unfortunately, the situation regarding your second request is more complicated. Currently, champstat lacks several features I'd like to include because it only reads the documented header of MPR files, which contains only so much information. As you might guess, among other things missing, it doesn't have any data about co-drivers.

However, I'm not completely ruling out the possibility of including data from the undocumented MPR body in possible future releases. The format has been rather well figured out by other add-on devs in the past, and based on that I actually implemented my own "undocumented MPR" parser back in 2018 for use in this app, and got it at least sort of working; I just never tested it all that much, so I left it and features depending on it out (truth be told, I have inadequate tests as is, which is why I've been a bit hesitant of making much changes at all).

I assume your intention is to have all co-drivers getting the points for the car's finishing position (which are currently awarded only to the driver who drives the car to the finish line)?
Thanks for your quick answer!

Yeah, after all it was a typical user error. Face -> palm

Too bad it is not in the MPR header. If you get arround and test your mpr-body paser and maybe thereby come around to implement features you want to add and maybe even the one I suggested, that would be awesome! Smile
Yes your assumption is correct. I come from the perspective of running Open Endurance Cup, where we're giving all co-drivers the same points as the finishing driver would get for the classified posission.
#11 - expr
Quote from TFalke55 :Yes your assumption is correct. I come from the perspective of running Open Endurance Cup, where we're giving all co-drivers the same points as the finishing driver would get for the classified posission.

I have some additional thoughts on your improvement idea. Currently, a team's points is simply a sum of all its drivers' points. Even if the application automatically awarded co-drivers with points, it would still lead to “inflated” team standings. If what we want is to have a team and all its drivers to have the same amount of points, we need a new team mode.

My idea for this new mode would be as follows: for each specified point category (e.g. race), the best result of a team's members is considered the “team's result”, which is awarded to all the members of that team, and counted for the team standings only once. I think you could use this kind of mode to achieve what you want with a bit less manual work. You'd still need to manually keep list of each team's drivers, but as LFS has no concept of teams, you'd need to do this anyway (even if champstat parsed driver changes from the replays) if you want to use the named teams function of the application.
Even if champstat as of now is not designed to deal with endurance races, it was a great help in providing quick championship updates for Sim Broadcasts in the Open Endurance Cup Five (with its deliberately convoluted points system)! I only used the teams' championship and worked around the fact that it is a multi-class league. It worked very well and made it easy to provide results right after the race finished.

If interested, I put a zip archive with the champstat folders into my dropbox: https://www.dropbox.com/s/tg25 ... 3/OEC5_champstat.zip?dl=0
Hello,

I noticed today that since new LFS version release champstat doesn't recognize qualify and race replays. I put replays from two sessions as I always have and I get following error
entering event directory: event09
event-specific options detected.
parsing MPR: 9_FRAGMASTER_AS4R_GTI_Q.mpr
parsing MPR: 9_FRAGMASTER_AS4R_GTI_R.mpr
fatal error: multiple race replays in .\event09

It looks that champstat doesn't recognize qualifications replays from race replays.

What I did next:
I removed point settings about qualifications and removed qualify file and ran champstat again. I got race results correctly (attachment race.html)
Decided to see how putting qualify file back and removing race file will affect things. Result was getting qualify result formatted as it was a race (attachment fake_race.html).

I'm gonna link you replays pre 0.6V which were working correctly and two from event day on 0.6V.
pre-0.6V qualify: http://borntorace.eu/fragmaster/mpres/replays/fm/gti/2021/FRAGMASTER_08_q.mpr
pre-0.6V race: http://borntorace.eu/fragmaster/mpres/replays/fm/gti/2021/FRAGMASTER_08_r.mpr
post-0.6V qualify: http://borntorace.eu/fragmaster/mpres/replays/fm/gti/2021/FRAGMASTER_09_q.mpr
post-0.6V race: http://borntorace.eu/fragmaster/mpres/replays/fm/gti/2021/FRAGMASTER_09_r.mpr

I hope you find some workaround (also what would be nice is to champstat work seamlessly with replays from both versions at the same time).
Attached files
event09.zip - 4 KB - 9 views
#14 - expr
Quote from jackson93 :It looks that champstat doesn't recognize qualifications replays from race replays.

That seems to have been the case; I hope the new release fixes the issue, and better yet, doesn't introduce any new ones. Fortunately the problem was very minor: a condition which no longer applied for qualifying replays. Removing such a condition should not cause problems with older replays, either, so the new release should be fully backwards-compatible. I also added an indicator to the program output for all input files to make such an issue easier to recognise (should it happen again in the future).
Thank you,
it is working as intended now. champstat gives correct results on replays from 0.6V and replays before new LFS release provide same results as on version c so no bug reports about backwards compatibility from me.
#16 - expr
For the first time in a long while, a new version with new features instead of just bug fixes!

I recently received a very reasonable feature request regarding the possibility of using a custom stylesheet in the generated output files. This feature was always supposed to come with the full templating system; however, that has yet to be implemented so for the time being, the new version includes a very limited templating system that can be used to achieve this particular feature (but not much else).

The new release includes example template files that you can customise to suit yourself (in a very limited fashion). Note that to use a custom template file, you need to specify it in champstat.conf (see updated champstat.conf for details). Without custom templates, the behaviour should be close to the previous version, although there have been slight changes in the generated files to fix past oversights.

(There has been quite a bit of changes behind the scenes, which also leaves a realistic chance for new bugs and unwanted behaviour. A change which is supposed to be a feature and not a bug is that in the positive case where there are no warnings and errors, the diagnostic output is saved to champstat.log instead of printed on the screen. I noticed that printing hundreds of lines – the case when there are several dozen events – to the Windows command prompt took several seconds by itself, and the output is not that interesting anyway.)
Thank you expr.
Even though I am fine with default champstat styles this new update will save me some time from adding basic responsiveness every week to event's files.
<meta name="viewport" content="width=device-width, initial-scale=1.0">

I guess it's time to dig into some css styling as this will be much easier.

champstat
(17 posts, started )
FGED GREDG RDFGDR GSFDG