I tried doing this with the realtime F1 data which has variable packet timings but was quite unreliable.Can the "laptime" be reasonably approximated from the "Lap" variable? As soon as it switches, a new lap has started and a packets are then retrieved every 1/60th of a second (16ms)
Not ultra mega precise, sure... but 16ms is nothing major for non-aliens. And with laptime, one could calculate a realtime delta to best/last lap (ithose would need to be recorded from previous laps in the same session)
A simpler approach might be to compare an average or median of every "X packets" (say... 30 or so). That would give a more accurate (maybe?) delta every 500ms, which should be fine. Should also be easier to implement, without planet interpolations.I tried doing this with the realtime F1 data which has variable packet timings but was quite unreliable.
I could see if the code is portable and with the extra data afforded to us from the packets (plane data and the such) you could make some assumptions and use linear interpolation to fill in the gaps so to speak. It's something I am interested in because I want to see deltas against best in the actual race, not just in free practice / time trial once a lap has been completed (see iRacing in every race).
I did a quick test last night with Python's datetime object, and as you mention, it's not super precise. The resolution will be based solely on the 1/60 update, and as such won't give you the same lap time as in-game. However, it's perfectly adequate to have a "current lap" timer going until the last lap time can be gleaned from the telemetry data.Can the "laptime" be reasonably approximated from the "Lap" variable? As soon as it switches, a new lap has started and a packets are then retrieved every 1/60th of a second (16ms)
Not ultra mega precise, sure... but 16ms is nothing major for non-aliens. And with laptime, one could calculate a realtime delta to best/last lap (ithose would need to be recorded from previous laps in the same session)
# outside loop
prevlap = -1
# inside loop
curlap = struct.unpack('h', ddata[0x74:0x74+2])[0]
if curlap > 0:
dt_now = dt.now()
if curlap != prevlap:
prevlap = curlap
dt_start = dt_now
curLapTime = dt_now - dt_start
printAt('{:>9}'.format(secondsToLaptime(curLapTime.total_seconds())), 7, 41)
else:
curLapTime = 0
printAt('{:>9}'.format(''), 7, 41)
The point about storing the packets (or an average of every 'X' packets) is to be able to calculate realtime deltas comparing against previous/best laps.I did a quick test last night with Python's datetime object, and as you mention, it's not super precise. The resolution will be based solely on the 1/60 update, and as such won't give you the same lap time as in-game. However, it's perfectly adequate to have a "current lap" timer going until the last lap time can be gleaned from the telemetry data.
Basically, in my script I added the following (will be updated on GitHub later):
Python:# outside loop prevlap = -1 # inside loop curlap = struct.unpack('h', ddata[0x74:0x74+2])[0] if curlap > 0: dt_now = dt.now() if curlap != prevlap: prevlap = curlap dt_start = dt_now curLapTime = dt_now - dt_start printAt('{:>9}'.format(secondsToLaptime(curLapTime.total_seconds())), 7, 41) else: curLapTime = 0 printAt('{:>9}'.format(''), 7, 41)
But, as mentioned, the curLapTime that is stored when the lap counter changes will most likely not match the "last lap time".
Edit: As for "running counter" of lap times, why not just store the "last lap time" every lap? Other than as a more "informational" timer, there's otherwise no other use for running your own lap timer, is there?
Thanks for the information, downloaded it, added me to beta testing version, and it works great, so all my support to the dev.I contacted the dev of SIM Dashboard a few days ago, today he replied that he has already got it working, a beta version is available!
https://www.stryder-it.de/simdashbo..._Gamers/Game_Configuration/Gran_Turismo_7.php
I haven't been able to sign up for the beta though, for some reason my google play store has been stuck on the "beta signup in progress" state for a while now.
Update:
The play store on my tablet is still stuck, but luckily I was able to push an install from the web play store and I have the beta version on my tablet. Tried it a bit after GT7 1.19 update, and it works! (This particular dash was made for ACC so some info was not available, will try to make a new one that's fully compatible with GT7.)
View attachment 1177568
Of course, I see the point. But, I would surmise that you would need to set up some kind of homegrown "checkpoint system" based on the positioning to be able to get anything really useful as to +/– in seconds. And it would likely not be very accurate, at least not nearly as accurate (without any hard proof to its accuracy) as the in-game time trial counterpart.The point about storing the packets (or an average of every 'X' packets) is to be able to calculate realtime deltas comparing against previous/best laps. Similar to how GT itself has a delta when you are time trialing, or how back in GTS you could see at the delta between you and Lewis Hamilton's ghost in the DLC
Yes. This is why I am hoping that some of the planar information can be used to try and figure this out. I just loaded up a manufacturers race I did many, many moons ago around Brands Hatch and shoved the data in. Now, time to break out the fancy tools, so Pandas it is:Of course, I see the point. But, I would surmise that you would need to set up some kind of homegrown "checkpoint system" based on the positioning to be able to get anything really useful as to +/– in seconds. And it would likely not be very accurate, at least not nearly as accurate (without any hard proof to its accuracy) as the in-game time trial counterpart.
In-game I'm sure there are some kind of zoning system for the entire track width basically, for which the game can compare your best lap time to your current one. Not saying it is impossible to achieve outside the game, but surely it will come with a lot of caveats.
I could only find Android app Sim Dash that already has GT7 support (link below)I suppose so far those apps/scripts/programmes only run on Androids?
different API, unfortunatelyView attachment 1178755
Right then boys and girls, Let's work this out
I don't think spectator mode would be efficient as the data will still need to be sent to the server, or caldifferent API, unfortunately
all of that data isn't in Simulator Interface (also, Sim Interface is player-car only whereas their broadcast interface - which might even require you to be a spectator in a LAN event to start - provides data on all cars, obviously)
Gonna claim I just dumbed it down to make it obvious to people that we can't do that with this telemetry.
I don't think spectator mode would be efficient as the data will still need to be sent to the server, or cal
It's probably like GT:S where they use a custom client for the live events that provides more data, to be ingested by a controller. I mean, stick 16 Playstations on the same network and we could extract a lot of data in real time, but yeah, it was just a post in jest.
It's definitely a live-only thing due to the fact absolutely none of this data was presented to the user in the online races last week, which gives one of two scenarios heading forward:
1. Online race information and races will be sub-par to in-person events but nothing changes.
2. The data available from replays, or emitted from the Playstation will be more complete, containing more info per car for the online races for Polyphony to collate. But at a cost of the data no longer being available to third-parties at all.
There is a potentially good reason a lot of this data is seemingly locked down or not present, and it boils down to marketing & exclusivity. Tonight showed how bad a lot of the production work was and if this data became easily available to third-parties, it could hurt Polyphony.
Finding something like that would more or less be a needle in a haystack though. Not impossible, but I'm pretty certain it would require some kind of inside info (like that software for the motion rig) to be provided before we could make any use of it. But hey, you never know, right!True, but let’s not forget that it could also be something linked with the way we communicate with the game. We send a packet containing ‘A’ to a specific port. Maybe sending something else like ‘B’, or to another port would trigger another behavior. Just speculating but hey why not! Who would have expected this telemetry data
I don’t think I’ve ever been this excited. 😷I contacted the dev of SIM Dashboard a few days ago, today he replied that he has already got it working, a beta version is available!
https://www.stryder-it.de/simdashbo..._Gamers/Game_Configuration/Gran_Turismo_7.php
I haven't been able to sign up for the beta though, for some reason my google play store has been stuck on the "beta signup in progress" state for a while now.
Update:
The play store on my tablet is still stuck, but luckily I was able to push an install from the web play store and I have the beta version on my tablet. Tried it a bit after GT7 1.19 update, and it works! (This particular dash was made for ACC so some info was not available, will try to make a new one that's fully compatible with GT7.)
View attachment 1177568
TCP paquets are meant to ensure that the packet is delivered. So laptime or essentials informations like this will be over tcp: imagine a player not receiving a new best lap or something like this (but slower and more time costing)Finding something like that would more or less be a needle in a haystack though. Not impossible, but I'm pretty certain it would require some kind of inside info (like that software for the motion rig) to be provided before we could make any use of it. But hey, you never know, right!
I tried to examine the traffic between GT Sport and the outside way back, and found that most of the traffic seemed to be encrypted TCP (https), but I never did any UDP or other kind of deep diving at the time. What I was able to see from the traffic was that the in-lobby chat didn't seem to be encrypted (at that time at least). The messages were clear text.
Now I'm not a regular user of tools like wireshark and capturing traffic, but as a spectator in a lobby, you can see all the driver's lap times (even historically over the previous laps). So surely this info is transmitted either P2P or via a PD server so it propagates through to all players in a lobby. I don't recall really examining the UDP traffic at all at the time, but IF said traffic is sent over UDP, maybe it can be examined by a proxy, and possibly decoded? Perhaps someone with more experience with examining packets with such tools could gain more information?
What I would be interested in is a tool/proxy that could run while racing in a lobby, storing/watching every driver's lap times, position and such. If that would somehow be doable, that could lead to real-time leaderboards and such. If anyone is up for something like that, I'd be a happy camper
Yeah, I know the difference 👍🏻TCP paquets are meant to ensure that the packet is delivered. So laptime or essentials informations like this will be over tcp: imagine a player not receiving a new best lap or something like this (but slower and more time costing)
Wasn't sure they used TCP though, I mean considering that the "laggy" behaviour in lobbies, it could possibly be explained with UDP packets not being received in-order (likely discarded). At least that was my reasoning, but for sure, they could use TCP for communications that are critical to arrive (although TCP can time out as well) like fastest lap and such. Mostly I was curious if anyone had looked into this. As we now can get positioning telemetry from the motion rig API (for lack of better description), it could possibly be found in captured traffic knowing it was the same "run" on-track. For that matter, one could reasonably assume that the positioning data that we can dump is the very same data sent to the other clients in the same lobby – possibly the same packets of 296 bytes are sent back to our own client from other cars? Again, just speculating here.UDP packets don’t provide the mechanism to ensure that the packet is properly delivered... [snip] Better for pushing information a lot of information like telemetry where you can afford loosing some data.
No, my thinking was rather having like an online web-based "current order" of an ongoing streamed league race for example. I.e. all the collected data would be captured by either a driver or a dedicated PSN account spectating a race and updated on a website in pretty much real time (likely something like once a second would be entirely sufficient).However if a tool like this could be set up, having a real time leaderboard wouldn’t be really useful unless you join it with some text-to-speech to have like a race engineer keeping you up to date with some stuff (penalty ahead, guy behind setting better lap time, driver ahead loosing many position due to crash probably, flags…) and get something like crew chef
Agree with most of what the others have said to this so far, just some more remarks:Right then boys and girls, Let's work this out
Use Case | Scenario | Data Needs | Time Resolution |
---|---|---|---|
Racing Dashboard | racer wants to see real time info on separate screen when racing | lap time, sector change, lap change + additional info | 1/60s at best, 1/10s OK |
Racing/Car Setup Analysis | extract log of lap telemetry and analyse after race to improve driving approach or tune the car setup | as much as possible | as high as possible |
Motion Rig | use realtime data to drive motion rig | car orientation + ? | as high as possible |
Race Leaderboard | spectator wants to see leaderboard of all racers lap times and race positions + additional info | for all cars driver and car info, race position, lap time, sector change, lap change + additional info | 1/10 at best, 1s OK |
Trying not to take away from the main thread here, but with your proxy and SRS, how much control do we have over bass shakers??I am traveling on vacation but I could not wait to get back home!!! Here is the python script that collects data from the GT and sends to SimRacingstudio (http://www.simracingstudio.com)!!!
GitHub - gt7coder/grandturismo-srs-proxy: This app is a proxy to collect telemetry from the Grand Turismo Series (GT Sport and GT7) and send to the Sim Racing Studio API to drive Wind Simulator, Shakers, Leds, Rumble and Motion platforms from DOF Rea
This app is a proxy to collect telemetry from the Grand Turismo Series (GT Sport and GT7) and send to the Sim Racing Studio API to drive Wind Simulator, Shakers, Leds, Rumble and Motion platforms f...github.com
We can now finally use Wind Simulators, Shakers, Leds, Rumble and Motion platforms from DOFReality (http://www.dofreality.com), ProSimu, PT-Actuator, SFX-100 (With Thanos Controller) and YawVR.
All the credits go to Nenkai to that was able to figure out how to decrypt the telemetry packets from the game: https://github.com/Nenkai/PDTools/tree/master/PDTools.SimulatorInterface I encourage you to donate for him!
Please note that I am not affiliated to SimRacingStudio and I am not responsible for any damage that this could case to you or your equipment
Keep in mind that this is an undocumented API from Grand Turismo Series, the game developer might patch the game and close the door in the future.
@poumpoum can you please give it a try?
Enjoy!