RaceDepartment Store

Upcoming Events

AC events on Simracing.GP ACC events on Simracing.GP Automobilista 2 events RaceRoom events rFactor 2 events

GTR2 The GTR2 AI Engineer v1-beta1 - Auto Calculate AI Difficulty

Shovas

Premium
Update 2020-10-04: I have uploaded a new version of the GTR2 AI Engineer spreadsheet for GTR2 original content cars and tracks, default PLR AI parameters, and with no dependency on any mods.

GTR2 AI Engineer V2-Beta

The GTR2 AI Engineer V2-Beta spreadsheet provides an automatic calculation of a new AI strength (ie. 80-120) based on your best qualifying laptime vs the best AI qualifying laptime. This spreadsheet assumes original GTR2 content cars and tracks and default PLR AI parameters.

Click here to view the GTR2 AI Engineer Spreadsheet (also attached to this post). Download it to plug in your numbers and use the calculations for yourself. You can download a copy from the File menu > Save As > Download a Copy.

All you do is run a qualifying session at AI level 120, plug in your best time and the best AI time to the spreadsheet, and it calculates a new AI strength that will match your performance.

This version of the spreadsheet is based off a correct equation for polynomial interpolation of AI levels vs their laptimes using a relative/proportional metric to more accurately calculate the curve of AI level-laptimes and thereby be able to plot your performance against AI strength correctly.

1601867111851.png


Notes:
  • Helpful instructions in the spreadsheets.
  • The orange fields are input fields. Enter your values in the orange fields.
  • Make sure you're on the "GTR2 AI Engineer (V1)" sheet (bottom-left) and not any other sheet.
Issues:
  • You may find the new AI strength calculated still results in AI slower then you (although they should be right on your tail) where you might prefer a calculation that makes them just slightly faster than you so that you're in 2nd or 3rd. For now, just add a few to the AI strength. I provided the "Challenging AI" strength to accomodate this for now. I will see about a better solution in the future, perhaps something that auto-calculates you into a specific position.
  • This was tested on Single Makes, not mixed classes. Ferrari 575s and BMW M3 GTR at Oschersleben GP 2004. Mixing classes or trying different cars and tracks may have unexpected results but I'd like to hear about all experiences to make it better.

The Old GTR2 AI Engineer V1

The GTR2 AI Engineer provides a calculation for new AI performance parameters to make sure you have competitive racing with closely matched AI.

First, click here to install the SHO Competition AI mod (one of my mods) as this spreadsheet was developed in tandem with that mod. Remember to use original content cars and tracks. Calculations are based on AI performance characteristics in that mod and for original content cars and tracks.

Then, click here to view and edit the spreadsheet or download it to open in your own spreadsheet. You can upload and open in Google Sheets, as well.

Helpful instructions are in the spreadsheet.

I'd appreciate your feedback on your experience, suggestions, or questions if something isn't clear.

It's not 100% accurate for all cars and tracks but the results I've been having are good enough for a beta release

Have fun!

Here's what it looks like:

1588464689299.png


Notes:
  • Helpful instructions in the spreadsheets.
  • The orange fields are input fields. Enter your values in the orange fields.
  • Make sure you're on the "GTR2 AI Engineer (V1)" sheet (bottom-left) and not any other sheet.
Future:
  • Right now, calculation is based on literal time-per-units but in the future I'd like to move to a relative time%-per-unit to theoretically have more applicability across car/track combos
 

Attachments

  • GTR2 AI Data Sheet.xlsx
    55.8 KB · Views: 43
Last edited:
I tried your spreadsheet however I made two adjustments to the AI.

I started a weekend with one free practice and quallifying. I have pretty much all mods on my install so I took some at random which turned out to be a bunch of Honda Integras from a BTTC mod (please don't ask me which or where I got it from) and as track Eurospeedway Lausitz Long. Don't know if it's important but I thought I throw that in.
My inital AI value was 0,98000 so this is where I started from. Drove the FP just to find a setup and learn the line. Ended up not quite last out of 24 cars with a time of 2:01,165 against a best time of 1:59,055. So about 2 sec slow. Now I turned to your spreadsheet and used the average AI time, which was at 2:00,274, and not the best.
Your sheet's came up with an AI value of 0,89776 with which I went into Q. I managed to secure pole by a slim margin, 2:00,725 against 2:00,879, so I'd say that the value was on the nose.
I started the race but quickly determined I was way too fast, had about a 3 sec advantage per lap. So I went back to your sheet and made another calculation with the Q times @AI 0,89776 which gave me a 0,99365. Since this would have been over the 0,98 I started the weekend I decided to stay below that and entered something in the 0,96 range and reloaded the race.
I ended up scoring fifth fastest time of the race so I guess I was in the right ballpark. I managed to win the race however by a margin of about 1 minute and change and that was because of the AI using more fuel than I did. The race had 72 laps (I do no shorties), AI pitted every 17-18 laps while I could go 21 per stint. Do the math. I guess I have to play around with the AI Fuel multiplier. BUT since a full fuel and tire pitstop is around 50 sec I'd still say your sheet came up with good numbers. And had I gone with the 0,99365 it might have leveled out the extra stop. I hope you could follow me.
I tried to calculate AI before by laptime comparison but used the in game adjustment. Your way is better because I can change the value without having to restart the race. Just adjust the value and re-load. I will use this some more.
I hope I could offer some help.
 

Shovas

Premium
Thanks for trying it out!

It sounds like you were not using original cars and tracks + SHO Competition AI mod?

That's the key part. Calculations will be off if it's not the same setup.

Also, I tend to race sprints rather than endurance - so nothing requiring a pit stop for me, so far. That's another variable to try. Maybe try a few 10 minute races.
 
Pretty much mods only but no competition mod of any kind. I have about 370 rcd-files which came with various mods. I remember having a lot more but I eliminated the multiples.
As I said, in general the values from your sheet were not bad even for long distance. Usually my best race time is way of and having a top 5 is an improvement. I had stretches where I fought hard with AI for several laps and through a couple of corners. But mostly, if I manage to keep them behind me for, say, five laps they drop back. Sometimes the make up several seconds a lap while I still do constant times.
Those longer races follow a different approach because of the pitstops. But I love to have that strategy part. From what I gather AI always does 4 tires and max fuel so I try to gain time by not changing tires or only take the amount of fuel I need.
Like I mentioned I will keep using your sheet but it will take me some time to report back. And, personally, I am thinking about some kind of personal penalty system. How to explain ? I play a different mod and track every time. If I always use my time against the average AI I would end up always around the same places, no ? So, based on my place in the last race I did, I add a percentage value to the AI in the next one or subtract if I do bad. Kind of my personal BOP system. That way I hope to keep it more interesting.
 

Shovas

Premium
Just to be clear, the spreadsheet probably won't work well on non-original cars and tracks and without the SHO Competion AI mod.

Glad you're making use of it though and love to hear the feedback in case I can improve it in any way.
 
The GTR2 AI Engineer provides a calculation for new AI performance parameters to make sure you have competitive racing with closely matched AI.

First, click here to install the SHO Competition AI mod (one of my mods) as this spreadsheet was developed in tandem with that mod. Remember to use original content cars and tracks. Calculations are based on AI performance characteristics in that mod and for original content cars and tracks.

Then, click here to view and edit the spreadsheet or download it to open in your own spreadsheet. You can upload and open in Google Sheets, as well.

Helpful instructions are in the spreadsheet.

I'd appreciate your feedback on your experience, suggestions, or questions if something isn't clear.

It's not 100% accurate for all cars and tracks but the results I've been having are good enough for a beta release

Have fun!

Here's what it looks like:

View attachment 368848

Notes:
  • Helpful instructions in the spreadsheets.
  • The orange fields are input fields. Enter your values in the orange fields.
  • Make sure you're on the "GTR2 AI Engineer" sheet (bottom-left) and not the "AI Data" sheet which is there for reference.
Future:
  • Right now, calculation is based on literal time-per-units but in the future I'd like to move to a relative time%-per-unit to theoretically have more applicability across car/track combos
Hi Shovas,

As I don't have any MOD, I assume cars and trucks are original, so I could use this.

What does PLR mean, in point 4.? "Enter your current PLR values..."

Greetings
 
I take the liberty answering:

go to your game installation: open UserData, look for the folder named after your user name in the game. You'll find a *.plr file also named like your user name. You can open it with Editor. Search for "AI Brake Power Usage" (its a bit down under Game Options).

Looks like this:

AI Brake Power Usage="1.02627" // Fraction of theoretical brake power that AI attempt to use
AI Brake Grip Usage="1.02627" // Fraction of theoretical brake grip that AI attempt to use
AI Corner Grip Usage="1.02627" // Fraction of theoretical cornering grip that AI attempt to use

Take this value, here it's 1.02627 and put it into the spreadsheet. But you have to put in the numbers from your file !! If you have different values you should change them that they are all the same.
After you've driven and entered all the times in his spreadsheet you have to go back to the *.PLR to change the three entries accordingly to what the spreatsheet says.

I hope this helps and don't forget to save.
 
Thanks, FinFan, great answer!

You're welcome.

I managed to put in a couple more races. I know I probably haven't the right configuration, you told me that, but I wanted to share this anyway. Maybe it helps.

I always start with a free practice session with any mod/track I use and my laptimes are mostly in no mans land in comparison to AI (I use the values from the previous race as I figure I'll change them anyway and it won't matter what values I use for comparison). I'll take the fastest and slowest AI time, take the average and use that time for the spreadsheet. With the new value I do the first qually.

As I said in FP I am nowhere but I managed to put in 3 pole positions. One was basically a last lap afford. All those came within .5 of a second margin to 2nd place. So' I'd say your calculations work really good. Since I can still get the pole all the time I think I need to compare my time against the slowest AI which would give a higher AI value for the *.plr. I'll do the second qually just to see if times get better which they only do slightly and since I don't change the AI vlaue in between I think I can do with one session. I do however do another comparison of my best against AI best and run it again to your sheet with the AI values from FP. Since I am fastest it puts the new value even higher. Using AIs worst time would result in an even higher value. I hope you can follow my this far.

When it comes to racing I am still treading water. While the laptime comparison after the race looks good (I had top 10 times two out of three races and the third I was in the lower third) I still managed to win all races with ease. Race length is not reall an issue as I pull away from the start seconds per lap. I got the AI to do the same amount of pitstops as I do. But they are just to inconsistent. From best to worst my guess is their lap times are about 10 seconds apart and I don't know how to fix this.

In any case, as I mentioned I still like to work with your calculations as they provide easy adjustments and maybe the problems within the race can be attributed to me not having that AI mod.

Can I use just the talent files or wouldn't that make any difference ?

Hope you could follow my explanations and that I maybe provided some insights.
 

Shovas

Premium
You're welcome.

I managed to put in a couple more races. I know I probably haven't the right configuration, you told me that, but I wanted to share this anyway. Maybe it helps.

I always start with a free practice session with any mod/track I use and my laptimes are mostly in no mans land in comparison to AI (I use the values from the previous race as I figure I'll change them anyway and it won't matter what values I use for comparison). I'll take the fastest and slowest AI time, take the average and use that time for the spreadsheet. With the new value I do the first qually.

As I said in FP I am nowhere but I managed to put in 3 pole positions. One was basically a last lap afford. All those came within .5 of a second margin to 2nd place. So' I'd say your calculations work really good. Since I can still get the pole all the time I think I need to compare my time against the slowest AI which would give a higher AI value for the *.plr. I'll do the second qually just to see if times get better which they only do slightly and since I don't change the AI vlaue in between I think I can do with one session. I do however do another comparison of my best against AI best and run it again to your sheet with the AI values from FP. Since I am fastest it puts the new value even higher. Using AIs worst time would result in an even higher value. I hope you can follow my this far.

When it comes to racing I am still treading water. While the laptime comparison after the race looks good (I had top 10 times two out of three races and the third I was in the lower third) I still managed to win all races with ease. Race length is not reall an issue as I pull away from the start seconds per lap. I got the AI to do the same amount of pitstops as I do. But they are just to inconsistent. From best to worst my guess is their lap times are about 10 seconds apart and I don't know how to fix this.

In any case, as I mentioned I still like to work with your calculations as they provide easy adjustments and maybe the problems within the race can be attributed to me not having that AI mod.

Can I use just the talent files or wouldn't that make any difference ?

Hope you could follow my explanations and that I maybe provided some insights.

Yes, so the reason for the performance spread comes down to Talent (RCD) files and Location files (AIW). There are various parameters whose value spreads are far too wide and that results in AI performance being too widespread (the spread from fastest to slowest is too wide). I ended up zero'ing them all out to simplify things so I could get calculations working.

I would really recommend trying the mod. Use OvGME to easily install and uninstall mods if you're worried about messing up your install.

In my experience, using these calculations and the AI mod, if I can qualify top 5, say, it becomes a super intense race. Actually, it's a super intense race no matter where you qualify. Just like in real life, if you're realistic performance is a certain spot, you might go up or down a few spots, but it's difficult to win when you qualifying anything more than 5th. Just like real life.

Caveat: I really only do sprints (for faster testing) so can't comment on how endurance races and pitstop behaviour changes the experience using my mod.
 
the reason for the performance spread comes down to Talent (RCD) files and Location files (AIW)

I guess the talent files are just a basic swap, yours for mine, and backing my folder up to be on the safe side. How do you modify the .aiw files ? What values do you change? I barely race on orginal tracks any more and maybe I can change the files from the mod tracks.
 

Shovas

Premium
I guess the talent files are just a basic swap, yours for mine, and backing my folder up to be on the safe side. How do you modify the .aiw files ? What values do you change? I barely race on orginal tracks any more and maybe I can change the files from the mod tracks.
Yes, you're right, just a basic swap. Really recommend OvGME to make things easy and safe.

For AIWs it was just Qual/RaceRatio and Worst/Mid/BestAdjust params. The Adjust params were really a culprit for causing the field to be too far spread out.
 

Shovas

Premium
Update 2020-10-04: I have uploaded a new version of the GTR2 AI Engineer spreadsheet for GTR2 original content cars and tracks, default PLR AI parameters, and with no dependency on any mods.

GTR2 AI Engineer V2-Beta

The GTR2 AI Engineer V2-Beta spreadsheet provides an automatic calculation of a new AI strength (ie. 80-120) based on your best qualifying laptime vs the best AI qualifying laptime. This spreadsheet assumes original GTR2 content cars and tracks and default PLR AI parameters.

Click here to view the GTR2 AI Engineer Spreadsheet. Download it to plug in your numbers and use the calculations for yourself.

All you do is run a qualifying session at AI level 120, plug in your best time and the best AI time to the spreadsheet, and it calculates a new AI strength that will match your performance. Restart your race session with the new AI level and the AI should much better match your performance.

This version of the spreadsheet is based off a correct equation for polynomial interpolation of AI levels vs their laptimes using a relative/proportional metric to more accurately calculate the curve of AI level-laptimes and thereby be able to plot your performance against AI strength correctly.

View attachment 410602

Notes:
  • Helpful instructions in the spreadsheets.
  • The orange fields are input fields. Enter your values in the orange fields.
  • Make sure you're on the "GTR2 AI Engineer (V1)" sheet (bottom-left) and not any other sheet.

I'm happy to present a new version of the GTR2 AI Engineer spreadsheet that has solved some of the problems of the previous attempt (eg. correct polynomial interpolation equations and proportional-based calculations instead of naive static calculations) and which I think provides much better results.
 

Shovas

Premium
I tried out a few more car and track combos and unfortunately even my latest attempt is unreliable.

Even tried removing all Talent files except Default.rcd but it didn't help enough.

Back to the drawing board.
 
Top