Results 1 to 8 of 8

Thread: Live stats from Dedicated Server?

  1. #1
    GT4 Pilot F1_Racer68's Avatar
    Join Date
    Aug 2012
    Location
    Canadian Tire Motorsports Park (Mosport)
    Posts
    2,347
    Platform
    PC

    Live stats from Dedicated Server?

    Does anyone know of any web based tools for showing live data from the Dedicated Server during the race? I am looking for something that would allow our broadcast team to see some of the STATS data, such as laps lead, etc. in realtime from the server during the race.
    CanAm Virtual Racing League - League President Twitter: @canamvrl @F1_Racer68
    System Specs
    CPU - AMD FX-8370 w/Wraith Cooler MoBo - GB-78LMT-USB3 (Rev 6.0) RAM - 24GB 1600 DDR3, Video - Zotac GTX1060 AMP! 6GB DDR5, OS - Win10 Pro 64bit, SSD - Corsair 240GB Force LE, Controller - Fanatec CSW v2.5, CSL Elite LC Pedals, DIY Button Box, G27 Shifter (USB) Monitor - Samsung UN28H4000AF 28" LED x3

  2. #2
    WMD Member
    Join Date
    Apr 2012
    Location
    Fuerth, Germany
    Posts
    157
    Platform
    PC
    If you are interested in, a friend an me have a javascript project showing all cars on google maps and further a driver table.
    The project is on github -> https://github.com/eckhchri/pcars-ds-liveview

    It is WIP and more a playground for us to build up javascript know how.

    You need a webserver where you can put on the github project.
    If you are interested in and need more info I can help.

    Currently we have some problems with zooming and moving the map, since Google has updated the Maps API. But it is working in general.
    And one essential info is missing during race sessions: you have no time gaps between cars, because it is not provided by the DS API.
    And calculating it is not that easy. Using a timer is not working, because the DS API data in updated every half second only. The other way is sum up the diffs of the lap times after every lap, but this is also problematic.

    Some screenshots:

    Play DS recorded session - Quali

    Click image for larger version. 

Name:	Quali.jpg 
Views:	3 
Size:	243.1 KB 
ID:	260842


    Play DS recorded session - Quali with Settings window

    Click image for larger version. 

Name:	Quali_DSsettings.jpg 
Views:	1 
Size:	242.8 KB 
ID:	260843


    Play DS recorded session - Race

    Click image for larger version. 

Name:	Race.jpg 
Views:	1 
Size:	250.0 KB 
ID:	260844


    Play DS recorded session - Race - filtered to GT3 class

    Click image for larger version. 

Name:	Race - GT3 filtered2.jpg 
Views:	1 
Size:	252.1 KB 
ID:	260848


    Settings window - mode switched to DS2 (Project CARS 2 DS API)

    Click image for larger version. 

Name:	DS2mode.jpg 
Views:	1 
Size:	240.0 KB 
ID:	260845


    Drivertable pdf export

    Click image for larger version. 

Name:	Drivertable Export.jpg 
Views:	2 
Size:	127.5 KB 
ID:	260846
    AMD Phenom II X6 1090T | MSI GTX970 Gaming 4G | Asus M4A89TD Pro USB3 | 16GB DDR3 | Windows 7 64 Bit | Fanatec CSW V2 + Porsche 918 RSR Rim + Formula Carbon Rim + CSP V2 + CSS SQ V1.5 | TrackIR 4 | 27" 1080p
    The following 3 users likes this Post: eckhchri, F1_Racer68, Visceral_Syn


  3. #3
    GT4 Pilot F1_Racer68's Avatar
    Join Date
    Aug 2012
    Location
    Canadian Tire Motorsports Park (Mosport)
    Posts
    2,347
    Platform
    PC
    This looks like EXACTLY what I was looking for, and then some. I will definitely take a look at it.

    Thanks!

    Question though..... Do all elements (DS, Web Server, CREST) need ot run on same physical box, or can they be scattered? Also, which Map API specifically will I need. I am assuming the Maps JavaScript API, but before I register fo rit, I wanted to make sure I go the right one.
    Last edited by F1_Racer68; 02-10-2018 at 19:52.
    CanAm Virtual Racing League - League President Twitter: @canamvrl @F1_Racer68
    System Specs
    CPU - AMD FX-8370 w/Wraith Cooler MoBo - GB-78LMT-USB3 (Rev 6.0) RAM - 24GB 1600 DDR3, Video - Zotac GTX1060 AMP! 6GB DDR5, OS - Win10 Pro 64bit, SSD - Corsair 240GB Force LE, Controller - Fanatec CSW v2.5, CSL Elite LC Pedals, DIY Button Box, G27 Shifter (USB) Monitor - Samsung UN28H4000AF 28" LED x3
    The following user likes this Post: M. -VIPER- Morgan


  4. #4
    GT4 Pilot F1_Racer68's Avatar
    Join Date
    Aug 2012
    Location
    Canadian Tire Motorsports Park (Mosport)
    Posts
    2,347
    Platform
    PC
    It appears I have it working properly using CREST2, but for some reason I cannot get it to work with our Dedicated Server directly. I have entered the IP Address of the DS, and the correct port number for the HTTP API, but it's not communicating at all. Did I miss something?
    CanAm Virtual Racing League - League President Twitter: @canamvrl @F1_Racer68
    System Specs
    CPU - AMD FX-8370 w/Wraith Cooler MoBo - GB-78LMT-USB3 (Rev 6.0) RAM - 24GB 1600 DDR3, Video - Zotac GTX1060 AMP! 6GB DDR5, OS - Win10 Pro 64bit, SSD - Corsair 240GB Force LE, Controller - Fanatec CSW v2.5, CSL Elite LC Pedals, DIY Button Box, G27 Shifter (USB) Monitor - Samsung UN28H4000AF 28" LED x3

  5. #5
    WMD Member
    Join Date
    Apr 2012
    Location
    Fuerth, Germany
    Posts
    157
    Platform
    PC
    Quote Originally Posted by F1_Racer68 View Post
    It appears I have it working properly using CREST2, but for some reason I cannot get it to work with our Dedicated Server directly. I have entered the IP Address of the DS, and the correct port number for the HTTP API, but it's not communicating at all. Did I miss something?
    1. rename the config-sample.js to config.js. Then you can change the settings in the config.js: Ds2ServerURL (domain name or ip address) and Ds2Port. Or you set AllowUrlParams on true, then you can use the URL parametes as described in the readme.
    2. Javascript is executed on client side. That means your browser is polling the DS HTTP API.
    a. Check your firewall settings on client side outgoing and maybe on DS side incoming. The tool uses normal HTTP requests, which means your DS can run on another machine. For CREST2 the same, CREST2 must run on the same system where the game runs, but you can open the liveview on another system with browser. But here the CREST2 TCP port must be open in the firewall of your game system.
    b. liveview polls the following paths on the DS:
    /api/session/status?attributes&members&participants
    /api/list/tracks
    /api/list/vehicles
    We have not authentication implemented, which means these paths must be accessable for public in the DS server.cfg. I think tracks and vehicles are public by default, but session/status not. You have to add the following for httpApiAccessLevels in the DS config:
    Code:
    httpApiAccessLevels : {
          "api/session/status" : "public"
    }
    You should be able to open the URL without authentication: http://DS_domain_name/api/session/st...s&participants. If this works, liveview should work,too.

    Relevant settings in DS config:
    Code:
    enableHttpApi : true
    httpApiPort : 9009
    httpApiInterface : ""
    Another problem could be if you open the liveview via HTTPS on your webserver, because the DS is polled via HTTP. In this case your Chrome prevents this and shows an icon on the right side of the address field
    Click image for larger version. 

Name:	chrome_https_http_mixed.jpg 
Views:	45 
Size:	1.8 KB 
ID:	260883
    Then you can click on it and "Load unsafe scripts".

    I hope this could help.


    Further info: Google changes the access for their Maps API, which means you need an API key now. If you don't have one the maps have a watermark on it.
    If you need one here is the link -> https://developers.google.com/maps/d...pt/get-api-key
    I think 25000 calls are free per day.
    Last edited by M. -VIPER- Morgan; 03-10-2018 at 09:15.
    AMD Phenom II X6 1090T | MSI GTX970 Gaming 4G | Asus M4A89TD Pro USB3 | 16GB DDR3 | Windows 7 64 Bit | Fanatec CSW V2 + Porsche 918 RSR Rim + Formula Carbon Rim + CSP V2 + CSS SQ V1.5 | TrackIR 4 | 27" 1080p
    The following user likes this Post: F1_Racer68


  6. #6
    GT4 Pilot F1_Racer68's Avatar
    Join Date
    Aug 2012
    Location
    Canadian Tire Motorsports Park (Mosport)
    Posts
    2,347
    Platform
    PC
    Problem solved!! Thank you!

    It was the "api/session/status" permissions that were the issue.

    From what little I can see right now (I'm the only one on the server), all appears to be working properly now. The tool is amazing! Thank you for creating it and making it available. It will add a LOT to our live streams.

    I am sure I will have more questions on usage once we really get into it. Our first race that will make use of this is this weekend. We will look to incorporate use of this tool into our live streams, as well as having it accessible to our spectators.
    Last edited by F1_Racer68; 03-10-2018 at 13:16.
    CanAm Virtual Racing League - League President Twitter: @canamvrl @F1_Racer68
    System Specs
    CPU - AMD FX-8370 w/Wraith Cooler MoBo - GB-78LMT-USB3 (Rev 6.0) RAM - 24GB 1600 DDR3, Video - Zotac GTX1060 AMP! 6GB DDR5, OS - Win10 Pro 64bit, SSD - Corsair 240GB Force LE, Controller - Fanatec CSW v2.5, CSL Elite LC Pedals, DIY Button Box, G27 Shifter (USB) Monitor - Samsung UN28H4000AF 28" LED x3
    The following user likes this Post: M. -VIPER- Morgan


  7. #7
    WMD Member
    Join Date
    Apr 2012
    Location
    Fuerth, Germany
    Posts
    157
    Platform
    PC
    Quote Originally Posted by F1_Racer68 View Post
    Problem solved!! Thnaks you!

    It was the "api/session/status" permissions that were the issue.

    From what little I can see right now (I'm the only one on the server), all appears to be working properly now. The tool is amazing! THank you for creating it and making it available. It will add a LOT to our live streams.
    Nice to hear, that it has a benefit for you.

    Some additional info:
    - If you want to scroll a table, use the Pause Button. The table is reloaded every poll interval and then it jumps automatically to the beginning.

    - You can record a session. Use the "Start Recording" switch for starting and stopping the record. After stopping click the export Button. For long sessions this takes some time, because the record is saved in RAM of the Bowser process. With clicking on export a zip file is generated. This zip file can be loaded with the Button "Datei auswählen"/"Select File" (in my bowser it is german). You maybe have to switch to DEMO API Type, if it is not switched automatically.

    - There are some records already in for demonstration. Switch to DEMO API Type. Click on Button "Load from URL" and choose a record.

    - The Pit information during a race is no info from DS. It is detected by liveview, if a participant state changes to EnteringPits. That means this info is only correct, if liveview is running all the time and receives these state changes. If you open liveview during a race, it can only detects from this moment on.

    - Same for the "Export All" Button in the Driver Table. liveview collects all session results for the complete race weekend and if you click on the button you get a csv and/or pdf (configurable via config.js) with all finished sessions till this moment. But liveview have to run from beginning of the first session. I hope this still works, I haven't test it for a long time and there were already some DS changes in the past. Further this feature only works in DS mode.

    - If you open the track table, you can use the left mouse button to select a track, the map then jumps to it, right mouse button jumps back again. Fictional tracks have only a white background. For Sakitto GP are border lines available for example (there is a recording for Sakitto GP), but for the most others not. These lines must be recorded with a car on track, which needs a lot of time.

    - The main focus of liveview is the DS mode, which means that some features are not working in CREST mode, like mentioned above with the Export All, but also the the Pit counting or the Session States in the Driver Table Header etc.

    - You can click on the column headers for sorting the table

    - DS settings window: with the DisplayDurationCorrector you can manipulate the smoothness of the marker moving. WorkerDelay changes the time in ms between every polling. I think liveview needs at least 100 ms calculation time for one run. That means if the worker delay is 300ms for example, the time between every run is 400ms. The DS updates the data only every half seconds. It makes no sense to poll it more often. In this case you only get same data again. The color driver objects dropdown menu changes the marker colors, Top 3 is gold/silver/bronze color, but you can also change it to same class, then all cars of a vehcile class have the same marker color. Driver labels can chnaged to show the complete driver name or only the position on the markers.

    - If you filter the driver table for "GT3" for example, only the GT3 car markers are completely shown, all others are transparent. You can change the strength with the "Hidden driver opacity" slider in the DS settings window. If you set it to 0 all other cars are completely hidden.

    - You can use the map in fullscreen with the icon in the upper right of the map. In this case you see only the map an the markers.

    - In the config.js file you can change many defaults, which windows are default shown, tables default collapsed or not, default API mode (DS2 for example), marker colors, Export Type (csv/pdf), etc.

    - Chrome seems to have a problem, if you have liveview open, switch to another browser tab and later back again. Then the liveview tab freezes, normally it catches itself after several seconds. But better is you don't switch to other tabs. Maybe opening a new instance of Chrome instead of new tabs work, but I haven't analyzed it further yet.
    Last edited by M. -VIPER- Morgan; 03-10-2018 at 16:38.
    AMD Phenom II X6 1090T | MSI GTX970 Gaming 4G | Asus M4A89TD Pro USB3 | 16GB DDR3 | Windows 7 64 Bit | Fanatec CSW V2 + Porsche 918 RSR Rim + Formula Carbon Rim + CSP V2 + CSS SQ V1.5 | TrackIR 4 | 27" 1080p
    The following user likes this Post: F1_Racer68


  8. #8
    WMD Member
    Join Date
    Apr 2012
    Location
    Fuerth, Germany
    Posts
    157
    Platform
    PC
    Quote Originally Posted by F1_Racer68 View Post
    Problem solved!! Thank you!

    It was the "api/session/status" permissions that were the issue.

    From what little I can see right now (I'm the only one on the server), all appears to be working properly now. The tool is amazing! Thank you for creating it and making it available. It will add a LOT to our live streams.

    I am sure I will have more questions on usage once we really get into it. Our first race that will make use of this is this weekend. We will look to incorporate use of this tool into our live streams, as well as having it accessible to our spectators.
    Maybe another relevant information:
    Because liveview is executed on client side, every user who opens the website is polling the DS.
    I don't know how many parallel requests the DS can handle, but you should have an eye on it if it influences the DS performance for the game itself or the API.
    We never tested with more than 2 clients in parallel.
    Last edited by M. -VIPER- Morgan; 03-10-2018 at 16:15.
    AMD Phenom II X6 1090T | MSI GTX970 Gaming 4G | Asus M4A89TD Pro USB3 | 16GB DDR3 | Windows 7 64 Bit | Fanatec CSW V2 + Porsche 918 RSR Rim + Formula Carbon Rim + CSP V2 + CSS SQ V1.5 | TrackIR 4 | 27" 1080p
    The following user likes this Post: F1_Racer68


Similar Threads

  1. Replies: 5
    Last Post: 31-08-2018, 14:35
  2. Replies: 429
    Last Post: 08-07-2018, 15:21
  3. Dedicated Server - Live timings/Race Results
    By andythilo in forum Multiplayer
    Replies: 0
    Last Post: 25-06-2018, 06:17
  4. Project-Cars Dedicated Server Live App
    By Ph0eNiX in forum Multiplayer
    Replies: 132
    Last Post: 04-10-2015, 20:10
  5. 'Live Stats' suddenly only showing a driver network time?
    By Martakus in forum PC - Technical Help & Support
    Replies: 1
    Last Post: 18-05-2015, 15:46

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •