Custom Championship tool (SP & MP races) (creates HTML reports)

Discussion in 'Community Workshop' started by pixeljetstream, Jan 29, 2015.

  1. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +412 / 0 / -0
  2. NL-Jos

    NL-Jos Well-Known Member

    Joined:
    Jun 5, 2015
    Ratings:
    +182 / 0 / -0
    Thanks again, but now my bad english is a problem for me
    What exactly must i change in the r3e-open-championship.lua file
    Is this part in the file wich i have to change something
    local useicons = true
    local onlyicons = false
    local driver_standings_vehicle = true
    local driver_standings_team = true
    local vehicle_standings = true
    local team_standings = true

    I hope that al these questions are not a problem for you?
     
  3. NL-Jos

    NL-Jos Well-Known Member

    Joined:
    Jun 5, 2015
    Ratings:
    +182 / 0 / -0
    EDIT: I have yesterday tried a lot of changes in the LUA file and make it now as i want.
    Thanks for this great tooltje and for your help.
     
  4. NL-Jos

    NL-Jos Well-Known Member

    Joined:
    Jun 5, 2015
    Ratings:
    +182 / 0 / -0
    Hi there (again)
    I wil try to ask or suggest some things but i hope you wil understand it because my dutch is much better than my english.
    So, when you don't understand this message ask me in dutch and I sent it again. LOL
    I try a lot with your program to learn it better and better.
    The way i use it at this moment is at this way.
    We have a championship with 24 events, 16 of this are just one race at one evening..
    8 events are two races at one evening.
    The championship includes 6 different cars so I save every race at some place on my pc.
    The events which includes two races at one evening i'm doing this at the following way.
    After race one I'm going to my windows eplorer and put the raceresults.txt to another map so i can used it later.
    I know that at one evening every one used the same car with the same people at the same circuit the result come together in one view but i want to show the result seperately.
    When i finished i cut, copy, past the reseresults.txt file in the map wich is used for the program.
    This must be, otherwise the program won't open.
    Then i have a result UI file and a HTML file.
    Afer this i write GRRT (the name of the championship) in de overide database filename and check again.
    When I have two races i do this steps again.

    Here come's my question/suggestion.
    Is it possible that the program can start even if there is no raceresults.txt in the map and you put a browse button in de start option.
    So, the possible is there to surch for the raceresults.txt. file from your computer.
    In this case the cut, copy, past way is not nessesary ans i think easyer when you have a lot of files. LOL
    Than another question.
    I changed the points to earn with this championship but when i run two championships with two countings?
    Can I instal the program again and put i on another place on my pc so can use this together?
    Ofcourse i must look for myself that i use the good file at the time.
    Thanks for your time.

    P.S. i accept a no as an answer.

    Have a nice sunday.
     
  5. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +412 / 0 / -0
    Hi @NL-Jos I've added a few more features so you should be able to pull of what you want.
    • config file is now separate, and one can manipulate the config via commandline.
    • each race in a season can have its own "ruleset" which defines the points being given
    Those two features allow you to define your own point system and have it different per race :)

    Now for your organization I heavily recommend not to use the UI at all, but simply organize the result files manually (as you already do that).

    Use the batch file described here
    https://github.com/pixeljetstream/r3e-open-championship#commandline-mode

    Code:
    luajit.exe r3e-open-championship.lua -config "ruleset='%3'" -addrace ./results/%1.lua %2 -makehtml ./results/%1.lua ./results/%1.html
    Then you can simply append a race with a ruleset like this

    Code:
    mybatch.bat mygroup5 group5results1.txt fia1962_1990
    mybatch.bat mygroup5 group5results2.txt fia1962_1990
    ...
    
    If you don't like the point systems provided, add a new entry to the config.lua file

    Code:
    rulepoints  = {   -- applied based on race's "ruleset" entry
      default      = {25,18,15,12,10,8,6,4,2,1},
      fia1962_1990 = {9,6,4,3,2,1},
      fia1991_2002 = {10,6,4,3,2,1},
      fia2003_2009 = {10,8,6,5,4,3,2,1},
      fia_current  = {25,18,15,12,10,8,6,4,2,1},
      simple = {3,2,1},
    }
    
    and then for example use "simple" as last argument to the batch file.
     
    • Like Like x 1
    Last edited: Jan 17, 2016
  6. NL-Jos

    NL-Jos Well-Known Member

    Joined:
    Jun 5, 2015
    Ratings:
    +182 / 0 / -0
    Wow, so fast an answer.
    Now It's looks like abracadabra () but I'm gonna play with it to find out how to work.
    Great that you doing this.
    A deep bow.
     
  7. ::SKRO::

    ::SKRO:: Well-Known Member

    Joined:
    Jan 29, 2015
    Ratings:
    +972 / 0 / -0
    Hey Pixel. Quick question... sorry if It has been answered already but, is there a way to generate single lap times per driver reports with final avg and best time in Quali and Race sessions (SP and MP too)? Thanks!
     
  8. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +412 / 0 / -0
    Best time in race or qualification already exists (just raise the limit of top 3 to get all info)

    Individual laps don't exist in raceresults.txt file, only the json file from mp stored those.

    However that's a lot of numbers, don't think the per race columns would work well.

    What are you after? I doubt you want to look at so much numbers per driver (each lap...)

    Mean and standard deviation would show who drives consistent. That what you are after?
     
  9. Nicklas Petersson

    Nicklas Petersson New Member

    Joined:
    Jan 1, 2016
    Ratings:
    +4 / 0 / -0
    Hi and thanks for this program. We are about to start an MP-league and i was thinking about using your program for the race-reports.
    I have setup an batch-file for commandline-mode but i cant get the teampoints in the result-column. Is there any configuration that i´ve missed?
    The only config i have done is ruleset with points been given, and its working. Otherwise its all by default.

    Thanks in advance. :)

    upload_2016-1-26_13-11-42.png
     
  10. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +412 / 0 / -0
    unfortunately the current MP json result files do not contain team information, you'd need to ask sector3studios to add that information in future versions of the game. I also dislike that they don't use the "asset name" of the tracks, but just the track family, so one doesn't know which track exactly was used for icons...
     
    • Like Like x 1
  11. Nicklas Petersson

    Nicklas Petersson New Member

    Joined:
    Jan 1, 2016
    Ratings:
    +4 / 0 / -0
    Thanks for your reply.
    Ok, the teampoints is an optional competition for us, the main thing is driver-chart and standings. :)

    I have another question for you.
    I an trying to get the batchfile to download the *.json from my ftp-server to generate the season.lua and html-file but i cannot make it work.
    If i try the ftp-adress in a browser, i get the file on screen. But when i includes the address in the batch-extension it doesnt work.
    Do you have a solution for this? :)

    Here´s my commandline:
    json-result.bat DTM2015 ftp://user:password@server.net/domain/201601250947.json sz

    and the json-result batch-file:
    r3e-open-championship.exe r3e-open-championship.lua -config "ruleset='%3'" -addrace ./results/%1.lua %2 -makehtml ./results/%1.lua ./results/%1.html

    Im happy for any help i can get. :)
     
  12. ::SKRO::

    ::SKRO:: Well-Known Member

    Joined:
    Jan 29, 2015
    Ratings:
    +972 / 0 / -0
    Actually yes, it's fundamentally that. I'd like to see the performance of drivers during a race (and would like to see also when the tire wear starts to influence laptimes).
     
  13. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +412 / 0 / -0
    @::SKRO:: if you want to see the "raw detial" then imo, you can just open the json file and look at the laptimes there. Or take it as opportunity to start learning to program a little :)

    @Nicklas Petersson the system works from local files only, not urls. However depending on how brave you are, you can add support for ftp files
    either by teaching the lua script ftp links and using https://rawgit.com/diegonehab/luasocket/master/doc/ftp.html to get it
    or you find a simple commandline tool that downloads the file from ftp and stores it locally as part of your batch file prior executing luajit.exe
    "wget" is a popular commandline tool to download things, or "curl", http://curl.haxx.se/ for example http://superuser.com/questions/265062/downloading-file-from-ftp-using-curl
     
    • Like Like x 2
    Last edited: Jan 27, 2016
  14. Nicklas Petersson

    Nicklas Petersson New Member

    Joined:
    Jan 1, 2016
    Ratings:
    +4 / 0 / -0
  15. Nicklas Petersson

    Nicklas Petersson New Member

    Joined:
    Jan 1, 2016
    Ratings:
    +4 / 0 / -0
    Last night we had a pre-season testrace with almost two similar race.
    Racereport 1 doesn´t add to the html-result but racereport 2 does, and i cant see the difference in these two, except that we had mandatory pitstop in Race 1.
    If you had the opportunity to look at these files, i´ll be grateful.
    Attach a zipfile including the two json racereports.
     

    Attached Files:

    • Race.7z
      File size:
      1.9 KB
      Views:
      5
  16. ttfredo

    ttfredo New Member

    Joined:
    Dec 24, 2015
    Ratings:
    +0 / 0 / -0
    I always have a problem with the classification of the race.
    The ranking is done according to the total time.
    To check I added in the number laps display.

    Is it possible to change and taking into account the file [[description]] -. Lua?
    Or how to take into account the positions for the classification and not the total time ?

    Tks for your job ans your help
     

    Attached Files:

  17. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +412 / 0 / -0
    @ttfredo, thanks, confirming that is still a bug on my end (the different laps), last time I only fixed the DNF guy showing up first. Will need to add that information to the database-file as well in future.

    what do you mean with the "description" file?
     
  18. ttfredo

    ttfredo New Member

    Joined:
    Dec 24, 2015
    Ratings:
    +0 / 0 / -0
    html file in the folder, there is a file .lua I talk about it.
    I do not understand the entire operation. I can not find or is taken into account the total time instead of the order of arrival.
     
  19. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +412 / 0 / -0
    @ttfredo and @Nicklas Petersson pushed a new version, ideally fixing both of your issues.

    The results were based on racetime as the singpleplayer raceresults.txt doesn't write out the "position" as json does, and since the database should work with both systems it cannot be based on the position from json alone.
    I simply forgot to take the laps into account, but that is handled now.

    And for Nicklas the "minimum race time" filter kicked in for one of the races, also a left-over from the original singleplayer raceresults.txt parsing, and not applicable for json.
     
  20. ttfredo

    ttfredo New Member

    Joined:
    Dec 24, 2015
    Ratings:
    +0 / 0 / -0
    it's great :)
    thank you for your job.