Simresults.net - a webbased result reader & PHP library

Discussion in 'Other' started by mauserrifle, Jun 2, 2013.

  1. mauserrifle

    mauserrifle Registered

    Joined:
    Feb 26, 2013
    Messages:
    382
    Likes Received:
    3
    Hi all,

    I'm proud to announce the release of the http://simresults.net website and it's open-source PHP 5.3 library.

    Website

    The website allows you to upload rFactor and rFactor 2 log files and transforms them in a readable format. The uploaded results become saved and public, so you can share them easily with your fellow racers.

    An example can be found here:
    http://simresults.net/130529-X2g
    http://simresults.net/130610-rz8 (endurance)

    Website features:
    * Ability to support more sim games in the future (if they produce log files)
    * Can read out a full session consisting of the following information: Game,
    Server, Settings, Track, Participants/Drivers including swaps, Vehicle, Chats, Laps/Sectors,
    Penalties and Incidents
    * Graphs
    * Detects and fixes position data (sometimes rFactor log files report complete
    wrong positions due to lag/bugs)
    * Detects human and AI players using their aids (sometimes rFactor log files
    report wrong player state)

    Library

    The library is open-sourced software licensed under the ISC license.

    Info and readme can be found at GitHub:
    https://github.com/mauserrifle/simresults

    The website simresults.net is a service but also a demonstration of what is possible using the library. The library does not supply any HTML templates or whatsoever. Any 'implementation' is up to you within your own project and is not limited to any framework.

    Library features:

    * Ability to support more sim games in the future (if they produce log files)
    * Can read out a full session consisting of the following information: Game,
    Server, Settings, Track, Participants/Drivers including swaps, Vehicle, Chats, Laps/Sectors, Fuel usage, Pit info, Penalties and Incidents
    * Offers extra methods to get specific data, e.g. `getBestLap()` and
    `getBestLapBySector(<int>)`
    * Offers a Helper class to sort laps by time and format times to human readable
    format (`h:i:s.u`)
    * Detects and fixes position data (sometimes rFactor log files report complete
    wrong positions due to lag/bugs)
    * Detects human and AI players using their aids (sometimes rFactor log files
    report wrong player state)
    * Caches heavy methods like getLapsSortedBySector(<int>). This is very
    useful with endurance results that have 200+ laps
    * The API is unittested


    KNOWN ISSUES

    rFactor 2 produces some buggy results:

    * Sometimes players have p="105" on laps
    * Sometimes players are marked Position 1 while they are NOT. Have to fix using finish times
    * Sometimes positions are really messed up. p1 fully missing etc.
    * Sometimes players have no finish status, missing their lap, but they finished and have proper position mark.
    * Sometimes complete players are missing from the results. If this happens, try getting someone else's result XML file and find the proper one. It can be frustrating, because sometimes other XML files have other players missing..

    Some things like the position corruption are detected and fixed. Though I can't fix players with no finish status and missing laps. Keep this is mind when the results are shown.

    @ISI could you please do something about this?

    Donation link

    Paypal

    ---

    Because I have driven a lot of great free mods and tracks. This is my appreciation to the rFactor community and hope to give back in this way.

    Big thanks goes to TIG_green for testing :)

    Have fun!
     
    Last edited by a moderator: Jul 27, 2014
    yashiman and jamesdio like this.
  2. Spadge

    Spadge Registered

    Joined:
    Oct 4, 2010
    Messages:
    311
    Likes Received:
    7
    Nice :)
     
  3. TIG_green

    TIG_green Registered

    Joined:
    Jul 21, 2012
    Messages:
    3,038
    Likes Received:
    44
    Congratulations on getting this released :)

    Really nice program ;)
     
  4. kaptainkremmen

    kaptainkremmen Registered

    Joined:
    Sep 25, 2012
    Messages:
    935
    Likes Received:
    17
    Nice work. Not sure I'd want anyone to be able to read my Text Chat tho ;)
     
  5. mauserrifle

    mauserrifle Registered

    Joined:
    Feb 26, 2013
    Messages:
    382
    Likes Received:
    3
    Haha, no "please hide my shameful messages" option, sorry :p
     
  6. DougSpinster

    DougSpinster Registered

    Joined:
    May 13, 2011
    Messages:
    108
    Likes Received:
    0
    I think I am doing something wrong, I get errors messages. Is this where I get the result files?

    C:\Documents and Settings\Administrator\My Documents\rFactor2\UserData\Log\Results

    Edited:

    Okay this is what happens on the server I upload the results and I get a message "Something went wrong" but it works okay if I download the result file to my computer first and upload it to SIMResults.

    It would be a lot easier to directly send the file from my remote server.
     
    Last edited by a moderator: Jun 3, 2013
  7. mauserrifle

    mauserrifle Registered

    Joined:
    Feb 26, 2013
    Messages:
    382
    Likes Received:
    3
    Yes the usual folder rFactor saves the files. It's your Job to find the proper one. The site allows you to check before saving.

    You mean automate the process? I don't like that idea, cause theres a step in between to check the results before saving them on the site. I like the 'saved' log files to be validated by the user, otherwise I would get alot of bad result pages.

    Unless I understand incorrect? Could you explain which steps would be useful for you?

    Though I received the errors in my inbox and it seems log files were succesfully read, it just throws an exception on some part. I'll see what that problem was. Maybe it was someone else :)
     
  8. mauserrifle

    mauserrifle Registered

    Joined:
    Feb 26, 2013
    Messages:
    382
    Likes Received:
    3
    Ok DougSpinster, I fixed the errors that you had. But your results are basically empty. I do not know what the server produces as log files. But they sure are empty looking at the XML :confused:
     
  9. DougSpinster

    DougSpinster Registered

    Joined:
    May 13, 2011
    Messages:
    108
    Likes Received:
    0
    I just went on the remote server and it works fine now.

    Looking great mauserrifle, nice work and simple.

    Thanks :D

    +1
     
  10. mauserrifle

    mauserrifle Registered

    Joined:
    Feb 26, 2013
    Messages:
    382
    Likes Received:
    3
    Yay. Glad you like it :D

    Thanks all!
     
  11. mauserrifle

    mauserrifle Registered

    Joined:
    Feb 26, 2013
    Messages:
    382
    Likes Received:
    3
    Last wednesday we had a good race with Mini championships @RookiesNight_WSu server (http://simresults.net/130605-g2o). But the produced logs were horrible due to alot of lag/bugs of rFactor 2 during Race 2. One person (TIG_green) even got lapped after the start...

    Just did some updates to clean up after rFactor 2 (and some more). Changes:

    * A leading participant for a lap will never be a participant with corrupted lap
    * Corrupted laps will have no position, thus there will be a gap on the graph for this driver
    * Always 4 digits of microtime when formatting seconds
    * Check for AIControl aid too when detecting human state of driver
    * Players without any aids are always human
    * PlayerControl aid always forces human driver

    For details (regarding code) see GitHub network overview:
    https://github.com/mauserrifle/simresults/network
     
  12. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
  13. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    Nevermind... Looks like it already works with that file.
     
  14. mauserrifle

    mauserrifle Registered

    Joined:
    Feb 26, 2013
    Messages:
    382
    Likes Received:
    3
    Edit: Oh I see the error message is from Sebring log file. Not your dropbox file.

    I just received the error message in my mail. Wow that's a huge result file!

    I will look into it. It reads the file, but its so big.. that the sorting of laps (which happens alot for the stats) takes too much time and it times out.

    So only a performance issue. It will be my mission to fix :)
     
  15. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    Great tool. Now if you can just add driver swap support to it. Driver swaps come at the end of the <Driver> node and look like this:
    Code:
    <Swap startLap="1" endLap="37">Mike Erickson</Swap><Swap startLap="38" endLap="82">Eddie Layton</Swap><Swap startLap="83" endLap="124">Noel Hibbard</Swap><Swap startLap="125" endLap="151">Mike Erickson</Swap><Swap startLap="152" endLap="191">Eddie Layton</Swap>
    The <Driver> node always uses the name of the finishing driver though. You can use that file from Le Mans I linked to as an example.
     
  16. mauserrifle

    mauserrifle Registered

    Joined:
    Feb 26, 2013
    Messages:
    382
    Likes Received:
    3
    Ye it's on my TODO list :) It will be implemented soon. I will dig into the performance issues first, as this will be a major issue with these big results.

    Thanks for using it and great test logs. Good test!

    You got any smaller race with swaps maybe? That will be easier to work with, due to the tests I write before coding anything.
     
  17. mclaren777

    mclaren777 Registered

    Joined:
    Oct 5, 2010
    Messages:
    546
    Likes Received:
    14
    This is fantastic. I wish you the best of luck as you improve it.
     
  18. mauserrifle

    mauserrifle Registered

    Joined:
    Feb 26, 2013
    Messages:
    382
    Likes Received:
    3
    Thanks mclaren777 :)

    Little update:
    I've done big performance improvements, the Le Man log by Noel is processed within an OK time now. But... I can't fix the big 12h Sebring log file he also uploaded (which lasted 403 laps! o_O). I think it will handle logs with like max 300 laps for now. I will need to find a proper caching solution. I avoided it within my core library as I do not want to be cocerned with caching there. But these big log files leave me no choice as there is so much sorting of laps going on internally to figure out the best personal/overall laps (per sector), etc, etc...

    I might pickup the performance later after implemented Driver swaps. It's acceptable now. Sorry Noel, for now no bigass log files :D
     
  19. mauserrifle

    mauserrifle Registered

    Joined:
    Feb 26, 2013
    Messages:
    382
    Likes Received:
    3
    It's been a long day of work :eek:. But simresults.net supports driver swapping now!

    * Shows all names in Result page
    * Shows driver for each lap
    * Shows all names in sector overview. The driver who drove that fast sector time, is highlighted bold.
    * Gap and Position graph shows all names. The driver currently driving that lap highlighted in bold (looks very cool to see race progress when hovering the mouse!)

    Please see this race log as an example @ http://simresults.net/130610-rz8

    Ofcourse all changes are part of the core too:
    https://github.com/mauserrifle/simresults

    As for performance with big log files like the Sebring 12h of Noel, currently only my host is the problem, which has a memory limit. So a possible solution is upgrading my hosting soon, but I'll have to see if that fits my budget ;)

    Enjoy!
     
  20. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    Great job! As far as I know you are the first to write a parser that supports swaps. All your hard work is appreciated.
     

Share This Page