My Daily Race DR/SR statistics, and how I get them

GrumpyOldMan

Premium
1,662
United States
Southern California
dagware
I've been working on some software to semi-automatically retrieve my DR Letter and Pct, and my SR Letter, so I can keep track of how I'm doing each week. I knew there'd be questions about how I do it, so I thought I'd explain it here, and answer any questions you might have.

Here's an example:

Date/TimeDR/SRDR %DR %DR DiffStartEndComment
12/27/2022 05:40B/B75.00|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx__________|+3.1333
12/27/2022 08:29B/B70.31|xxxxxxxxxxxxxxxxxxxxxxxxxxxx____________|-4.697DNF
12/27/2022 12:01B/B64.06|xxxxxxxxxxxxxxxxxxxxxxxxxx______________|-6.25314
12/27/2022 14:41B/C57.81|xxxxxxxxxxxxxxxxxxxxxxx_________________|-6.254DNF
12/27/2022 16:08B/C57.81|xxxxxxxxxxxxxxxxxxxxxxx_________________|+0.0036
12/27/2022 16:30B/C53.13|xxxxxxxxxxxxxxxxxxxxx___________________|-4.684DNF
12/28/2022 07:03B/D48.44|xxxxxxxxxxxxxxxxxxx_____________________|-4.69110
12/28/2022 09:54C/E48.44|xxxxxxxxxxxxxxxxxxx_____________________|------210WTF?
12/28/2022 10:20C/D40.63|xxxxxxxxxxxxxxxx________________________|-7.81211
12/28/2022 10:41C/C57.81|xxxxxxxxxxxxxxxxxxxxxxx_________________|+17.1821
12/28/2022 14:42C/C70.31|xxxxxxxxxxxxxxxxxxxxxxxxxxxx____________|+12.5014
12/28/2022 15:21C/B89.06|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx____|+18.7511Viper
12/28/2022 15:42C/B99.99|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|+10.9313divebombed
12/28/2022 16:21B/B7.81|xxx_____________________________________|------14Back to B!

After each race I run my software. Here's how it works:

1) In GT7 on my PS 5, I change to my Profile Page which, as you know, looks like this (without the yellow boxes):
1672310176791.png


2) On my Mac, I run my software, which is a Keyboard Maestro macro I wrote.

3) It launches the PS Remote Play app and gets it to connect to my PS5.

4) It uses macOS Monterey's OCR to get my DR and SR Letters.

5) It looks at the DR progress bar, and calculates the percentage it's currently at.

6) It closes the PS Remote Play app, and asks me for the Starting and Ending Positions of the race, and allows me to enter a comment if I want to.

7) It stores everything like this:

12/28/2022 15:42 C B 99.99 +10.93 1 3 divebombed
12/28/2022 15:21 C B 89.06 +18.75 1 1 Viper
12/28/2022 14:42 C C 70.31 +12.50 1 4
12/28/2022 10:41 C C 57.81 +17.18 2 1
12/28/2022 10:20 C D 40.63 -7.81 2 11
12/28/2022 09:54 C E 48.44 ------ 2 10 WTF?
12/28/2022 07:03 B D 48.44 -4.69 1 10
12/27/2022 16:30 B C 53.13 -4.68 4 DNF
12/27/2022 16:08 B C 57.81 +0.00 3 6
12/27/2022 14:41 B C 57.81 -6.25 4 DNF
12/27/2022 12:01 B B 64.06 -6.25 3 14
12/27/2022 08:29 B B 70.31 -4.69 7 DNF
12/27/2022 05:40 B B 75.00 +3.13 3 3
12/26/2022 14:00 B B 71.87 +0.00 3 7 Lago Maggiore

When I want to display the data on this forum, I have another Keyboard Maestro macro I wrote that converts it into BB Code to display as a table.

I could make this available to other people, but it has some pretty specific requirements:
  1. This only works on a Mac.
  2. Requires Keyboard Maestro. You must have a rudimentary idea of how to use it - not much, but enough so I don't have to explain every detail. I would supply the macros.
  3. Requires macOS Monterey or later, for the OCR. For some reason Keyboard Maestro's OCR doesn't work for this - I assume it has some issue with black background with white text, but I don't know for sure.
  4. You'd have to create a simple Shortcut for doing the OCR. It's pretty simple, and I could walk you through it.
  5. You'd have find the screen coordinates for the DR and SR stuff, assuming your Mac's screen isn't the same resolution as mine. This is reasonably easy to do using Keyboard Maestro's "Mouse Position" window.
  6. You'd have to have the PS Remote Play app, which is free.
With the fact these requirements are pretty specific, I suspect nobody else will ever use my macro. Sorry.
 
As a data guy, I like what you have done. Congratulations on such a successful system. Have you found any benefit to improving your results from these data? Have you been using it long enough to see trends over time? I manually record my qualifying time and start end position to have the self satisfaction that yes, "this week I did ok."
 
Damn grumpy that's awesome!
Now I'm curious if there's equivalent software that can be produced for Windows machines... Might spend some time on that this week if I get bored doing demo in the basement
 
As a data guy, I like what you have done. Congratulations on such a successful system. Have you found any benefit to improving your results from these data? Have you been using it long enough to see trends over time? I manually record my qualifying time and start end position to have the self satisfaction that yes, "this week I did ok."
Thanks! I'm not sure yet what I can deduce from this, because it depends on the other people's DR also. But it's nice to know when I finish something like 7th, whether I gained or lost points.

I also verified that if I DNF, I lose the same points as if I finished last. Not sure yet if other people DNF before me, if that makes a difference. Also, the stats don't get updated until after the race is over, so I used to think it might not affect my DR. But it does, as I said.
I’m curious how you don’t have an S SR rating. Even if you bash half the grid off you can maintain S.
Not if you bash them off from behind. If you push them off sideways, it seems to not affect the SR as mich. But if you knock them off from behind, it can have a big effect. During one horrific incident, I got 8 seconds worth of penalties! That's what put me into C/E.
 
Very nice man!

I'm a software developer and this looks fun to do.

I did a Windows version but It only captures the Driver Rating and Sportsmanship Rating for now.
Needs to add the bar calculation (%) like you did.

if anyone is interested:
Source code (.NET 6): https://github.com/JulioCesarSF/GT7TesseractOcr/tree/main/GT7.DrServer
Important files:

I'm using Tesseract too.
The application is a webserver, so after run using Visual Studio 2022, you do need a tool like Postman to upload an imagem.
Upload an image to:
http://127.0.0.1:5500/file/upload

This is the sample image (from player profile in-game): https://github.com/JulioCesarSF/GT7TesseractOcr/blob/main/SampleImageFromGame/WhatsApp Image 2022-12-29 at 12.35.51.jpeg
After analysis it will display in console a message: "You are: B/A"
 
Last edited:
I did a Windows version but It only captures the Driver Rating and Sportsmanship Rating for now.
Needs to add the bar calculation (%) like you did.
Very cool! When I check the progress bar, I start from the left edge of the progress bar and check the "red" value of each pixel (along one horizontal line, of course), and if it's less that 0.21, I assume it's the end of the progress bar. Not sure why I picked red, but that's how I did it. It's working well now, although I discovered it's actually possible for the progress bar to be completely filled up, without advancing you to the next DR letter. It wasn't a case of my SR being too high - I guess I was just right on the edge. So now I check to see if my percent is >= 100, and if so, I set it to 99.99, which looks better. :)
I'm a retired .NET developer myself! It's been something like 5 years since I last used it, but it was my favorite language (at the time). Good luck!
 
Very cool! When I check the progress bar, I start from the left edge of the progress bar and check the "red" value of each pixel (along one horizontal line, of course), and if it's less that 0.21, I assume it's the end of the progress bar. Not sure why I picked red, but that's how I did it. It's working well now, although I discovered it's actually possible for the progress bar to be completely filled up, without advancing you to the next DR letter. It wasn't a case of my SR being too high - I guess I was just right on the edge. So now I check to see if my percent is >= 100, and if so, I set it to 99.99, which looks better. :)

I'm a retired .NET developer myself! It's been something like 5 years since I last used it, but it was my favorite language (at the time). Good luck!
When I share a screenshot from PS App(Android) to my whatsapp the screenshot dimension is 1599x899px.
What is your screenshot dimension?

I'm curious because I do play in a 4k TV in performance mode and it is exporting in a strange resolution.😆

I do something similar to you, I do transform pixels from "gray" to red. My threshold is 141 for the R (assuming RGB).
This is the character "B" after crop and transform:
temp_driver.png


To find the initial position for Driver Rating I assume that It is always at 71.29% (x position) from the start of the screen.
To find the initial position for Sportsmanship it is 87.42% (x position).
And I do a dynamic calculation to get everything.
 
Last edited:
When I share a screenshot from PS App(Android) to my whatsapp the screenshot dimension is 1599x899px.
What is your screenshot dimension?
I don't actually make a screenshot, I just use the PS Remote Play app on my Mac and make it full screen. When I'm referencing the screen in Keyboard Maestro, the coordinates assume the screen is 2560x1440, which is the display resolution I've chosen so the fonts don't get too small. So the portion of the image would look like this.

1672361448648.png


But when I do the OCR, I save a box around the letter to a jpg file so I can use the Mac's built-in OCR. The resolution of the image saved to disk is my Retina display's native resolution, which is 5120x2880. So the saved jpg file looks like this:

KM_GT7_Letter.jpg


It's strange, I know, but that's how it works on my Mac.
To find the initial position for Driver Rating I assume that It is always at 71.29% (x position) from the start of the screen.
To find the initial position for Sportsmanship it is 87.42% (x position).
And I do a dynamic calculation to get everything.
That's a much smarter way to do it than what I do. I use exact pixel coordinates, and they work on my computer, but of course they would need to be adjusted for a different resolution monitor.
 
Hello!

I made some progress in my tool.
Now it can calculate the progressbar too.

It should work for any image size of an aspect ratio of 16:9.
Download link: https://github.com/JulioCesarSF/GT7.Tools/releases/tag/refs/heads/main
I did compare my result with @Milouse 's website and it gave the same result.

Features in this release
  1. Extract DR and SR
  2. Calculate DR progressbar percentage.
  3. Works with 16:9 images of any size.
Compatibility
  1. Windows 11, 10 and 7.(64bits)
  2. Max image dimension is 4K resolution from PS5: 3840x2160
  3. If your image is not in this size it should have an aspect ratio of 16:9, so an image of dimension 1599x899 should work just fine.

The old repository I made it private but there is a new one: https://github.com/JulioCesarSF/GT7.Tools
This tool is open-source and there is more instructions in download link.

Next step: Extract lap times from a screenshot.
 
Last edited:
Here's where I am now - it's pretty close to done, I think:

1672754300580.png


I added SR to the line chart (top chart). Not sure whether I like it or not - I might add an option to enable or disable showing SR.

The bottom table is using Google Table Chart to display. Works pretty well, but there's a few things I'd like to change (display-wise) that I don't think can be changed.

Still, here's some features you may or may not notice:
  • The DR progress bar is currently showing my progress towards DR A. If I ever reach A, it'll change to show my progress towards A+ (yeah, right).
  • Both DR and SR letters have red backgrounds when they go down (get worse), and green when they go up.
  • The DR % Diff has a red background when I lose DR.
 
Very nice man!

I'm a software developer and this looks fun to do.

I did a Windows version but It only captures the Driver Rating and Sportsmanship Rating for now.
Needs to add the bar calculation (%) like you did.
You could use Autohotkey and pixelread functions to identify the letters and the progressbar (or likely find a better solution for the letters).
 
I don't know how many, if any, of you want to see my progress, but I'm posting it anyway.

Here's screenshots of the latest version, which is pretty-much complete (with one caveat mentioned at the end).

I added a toolbar below the line chart. Although you can zoom and scroll with the mouse, it's way too touchy (at least with my mouse), so I added buttons for scrolling and zooming:
1673016066222.png


Here's the chart showing SR also (kind of messy, but whatever):
1673016127139.png


And I added a date range. Actually, a "racing week" range (the "From" and "To" boxes):
1673016211318.png


And lastly, if you click on a node in the chart, it highlights the corresponding row in the table:
1673016622971.png


The more observant of you will notice the "tooltip" floating box near the mouse pointer - this is the last thing I have to work on. I'll make it display more useful information. But I probably won't post pictures, unless it ends up looking cool.
 
This makes me miss kudosprime. It was nice to see the k score and SR/DR graphs there. The kscore really helped me improve, because I could see my weekly lap times improving over the year, and it was good validation of my driving skills getting better.

Nice work @GrumpyOldMan
kudosprime still exists

 
I ran into an issue when I earned enough DR points to move from B to A, but the game wouldn't actually give me DR A until I lowered my SR. So the screen says I'm DR B, but the progress bar is what it would be if I were an A. In other words, the progress bar was close to empty.

So after scanning the DR and SR letters, and the progress bar, when I go to enter in the rest of the info, like start pos, it thinks I lost a bunch of DR percentage:
1673753383241.png


So I added the "DR Constrained" checkbox, and when I click it, it changes the values like this:
1673753477237.png

The DR "A" is red-colored, so I know it's not my actual DR. If it's red, then I know my actual DR is one letter below that.

When I chart it, I chart the point with a red star, and if I hover the mouse over it, the popup tooltip tells the story:
1673753614545.png


I doubt anyone really cares, but just in case, I wanted to mention it here. :lol:
 
The latest version, which includes animated track maps:
DR Tracker.jpg


This image doesn't show the animation, but the red dot on the track (upper right) moves around the track, in the correct direction depending on whether the course is Normal or Reverse.

If you click on the track, you get the full track image, like this:
1678630321597.png


I've got maps for all the tracks, which took a while.
1678630522331.png


I didn't design the maps myself. I used online images of each track (which I felt was fine since I'm only using this for myself), then created SVG paths for each track, and animated a circle around it. I'd never done that before, so it was a fun exercise.

I still wish there was a way to make this available for other people. Maybe it's time to learn Node.js.
 
Back