RaceDepartment Store

Do you ever race in VR?

  • Yes

    Votes: 248 35.9%
  • No

    Votes: 442 64.1%

Upcoming Events

AC events on Simracing.GP ACC events on Simracing.GP R3E events on Simracing.GP Weekly rFactor 2 events Join TCR Virtual today!

GTR2 How to find the right AI level without trying them all?

Shovas

Premium
Update 2020-04-10: Based on my experience in this thread, I've released an AI mod: "SHO Competition AI is a mod for original content GTR2 cars and tracks that modifies various AI-related configuration parameters to achieve more realistic race performance by AI drivers resulting in more realistic, tighter, and more intense racing." Click here to download the SHO Competition Mod.

How to find the right AI level without trying them all?

I've always had a problem with dialing in AI. I don't know what produces a good race. It seems like I either get blown away or I have to start from way back in the grid (even though my times are better) and work my way up... There's no middle ground like where I might qualify top 6 and have a good battle with the lead pack: If I quality top 6 I always end up killing them in the race by large margins, like 10sec+.

I feel like there's some combination of qualifying grid position that would mean the AI level is correct and that I will have a tough battle to win. Maybe I need to qualify top 6-12th but not higher or lower to have a good fight mid pack? I don't know.

How do you find the right AI level?

Here's some times I pulled qualifying at VLM Sebring in the Ginetta G55:
Ginetta G55 @ VLM Sebring, 20C+, Clear, 2pm QUAL

screen capture tool

1. I notice 80-95 has its own slope linearity vs 95-120. I believe this is due to <95 not being able to use full throttle (it's hard-wired like that into the game, if I understand correctly).

2. My best qualify was a 2:14.420 so that turned out to be AI 93 (which I had times for: 1st 2:14.660 vs 25th 2:16.088). My actual qualify was lower, like 12th or something but I easily got up to 1st within a lap or two and proceeded to lead by 18sec at the end of the 5 lap race.

Ideally, I'd like to figure out the time deviation between each AI level, run a single qualifying session at AI 100, and then run my time through a calculation that would pick the ideal AI level for me. That calculation is eluding me so far, though

My whole problem is I don't want to have to try qualifying in many sessions with different AI levels just to run one race. I'd much rather run one qualifying session and then determine an AI level from that with a calculation and then start another race session with that AI level. I think that's about as streamlined as it can get.
 
Last edited:

Shovas

Premium
Thought I'd follow up on this with some comments on my testing of HQ Cars at HQ Imola GP 04.

It's an entirely different experience with all classes involved but I only focused on the fastest cars (driving the F575, myself).

If you compare the results,



With the previous tuning,



You'll notice it's quite different values to achieve the same basic idea.

My next step would be to crunch some numbers and see if I could find a calculation where you qualify once, see how ahead or behind you are, and put that qualifying time into a formula to put you into a certain qualifying position.

For example, say I want to have a good battle in the top 5 , so I want to qualify top 5, but I actually qualify 10th or something. The formula should be able to set the AI parameters up so that if you qualify with that exact time again you'll qualify 5th.

I've already been able to do this by hand tuning. It's just matter of putting it into a formula to make it easy. I'm pretty sure it can be done, though.
 

Shovas

Premium
Is there any way to alleviate the AI's late race slowdown?

I don't think it's due to car damage as there are some AI who don't have cars around them but slow down with about 2-4 minutes left in a race.
 

Shovas

Premium
I think I've had a breakthrough with this. After a lot of trial and error, I've reduced the number of variables that affect AI performance to a minimum and I'm now tuning one single parameter, AI Corner Grip Usage, which can be used with a simple formula to achieve just the right equivalent of an AI Difficulty Level.

The actual breakthrough was finding the +/- track time for each increment of Corner Grip: What I did was simply try 1.0, 0.9, ..., 0.5, and took the average track time from them all. I can use that number to multiply against a time difference that you want to speed up or slow down the AI by. Are they 5 seconds faster? Plugin in 5sec to the formula and it tells you how much +/- Corner Grip you need. It's actually so simple I plan to publish it as a simple form in a Google Docs spreadsheet that everyone can link: Just plugin your time, the AI time, and it will show your correct Corner Grip usage.

The benefit of using a parameter such as AI Corner Grip Usage is that it has a 1/1000th degree of precision which gives far greater granularity to find the right number versus the much less granular AI Difficulty 80-120 value which only gives you 40 distinct values to choose from, and they're not linear, and each increment may cause a relatively large difference in lap times such that no matter what you do you can't pick the right AI: You either blow them away, get left behind, or get left in an 'island' where nobody's around you, they're all either much faster or much slower.

I put in a full practice, qualifying, and race session and it was amazing how tight and close the racing was. I never did completely get rid of the 2nd place AI although the rest were back about 8sec by the end due to some accidents I think. The racing itself, down straights and through corners, was also such an improvement. I swear they're actually close(ish) to my experience with real people on iRacing. I also know I qualified faster than I tuned Corner Grip for (based on Practice) so that will throw things off but the good news is the racing experience could have been even better. Maybe I'll put in a little padding just to handle that case.

I will continue tweaking and eventually I will document the requirements for this calculation. You really need to eliminate the variables and set things to standard values in the PLR and the AIW in particular. Once you do that you can focus in on Corner Grip as your AI level equivalent and it's easy from there.

I'll keep updating here as I have time.

PS. The beautiful thing about this solution is that it actually could be done as an in-game Auto AI Feature for new sims: Run a practice session and instantly your qualifying and race will be representative. R3E tries Auto AI but I've tried it it doesn't really work well. And every sim has this AI Difficulty selection problem. The fact that we have to manually select it at all is an issue. This simple and automatic calculation could improve all that.
 

GTR233

Premium
Yep AI corner grip usage is the most powerful parameter to tweak AI speed. By example AI is way too fast for me above 0.97, I would say between 0.96-0,97 but it is only for my own driving skills. Indeed, if you drive slower then 0.94-95 is better for you, and on contrary if you are Hamilton then 0,98-0,99 or maybe higher would be better for you. There is no good value for everybody, it must be "taylor made"
 

Shovas

Premium
I'm glad this has some interest. I plan to do a little more refinement, actually create the easy formula, and then see if I can get some people to repeat my results for the same car and track and see if the calculations give others good results. I'm pretty confident it will no matter if you're fast or slow on the same track.
 

Shovas

Premium
I had a good observation in my last session: By using only Corner Usage to set the AI difficulty it makes them look amateur/slow in corners so that you easily catch them in corners even while they brake perfectly (ie. very late) and are equally competitive on straights.

My solution will be to recalculate the time differentials by using Brake Power, Brake Grip, and Corner Usage so that no single aspect of their driving is particularly amateur/slow. The same time differential numbers can plug right into the same formula so it's just a matter of running sessions to figure out their track times at each increment of Brake Power/Grip and Corner Usage.
 

Shovas

Premium
Ran into a snag with AI race times. After fleshing out the formulas, making them easy calculations in an excel spreadsheet, I ran a practice, noted the time and calculated a new Brake Grip/Power and Corner Usage value, restarted with those values, reloaded my save, and the qualifying went nicely, just like I was hoping, and the AI were competitive. Then, I started the race and the first lap felt good, I dropped back to 3rd but made my way back up within a lap or two, but by the end of a 5 lap race I was 8sec+ ahead the 2nd place AI. It was even less enjoyable than my previous post's race.

The good news is it looks like I have Practice and Qualifyng working with the formulas. The bad news is for some reason the AI are acting differently in a race than they do in practice or qualifying.

If anybody can shed light on that I'd appreciate it.

I do know about the AIW QualRatio and RaceRatio and I have those set at 1.0 to keep things as simple as possible: My idea was to get them to drive the same in Practice, Qualifying, and Race so that the calculation would be easy for now (and I could deal with QualRatio later on to make them a smidge faster in Qual just like they are in real life).

Is there some other parameter I might be missing that would cause the AI to drive much slower (1-2sec+ per lap) in a race versus practice or qualifying?

I know about Player Car Equal in the UserData PLR which keeps AI closer together in terms of lap times and which I feel makes for tighter racing (I have it enabled). Is there some other param in some other file I'm missing?

I don't think it's RCD ColdBrain params because I've zero'd them out, too.

Thanks,
 
You could try turning off damage!
Van Dutch had this idea that the Ai was bumping each other coursing aero damage
Believe he changed the AeroMin=1100.0 to AeroMin=7500. in each cars damage file.
It does help but not sure that is the entire issue.
 
I've had this same problem, even more so on my custom build tracks seems AI don't race for the fist half lap. will try these adjustments BUT... forgive my stupidity, i can't find QualRatio or RaceRation anywhere in the .aiw
 

Shovas

Premium
I still want to get back to this but I got a little frustrated after running out of parameters to use in a predictable manner so I can apply them to every track.

I've also been busy with life. I find I barely find time to race anymore, in any sim.

Maybe I'll get back to this at some point. In my last post I was mentioning race pace went screwy. Guess I'll have to focus on that. Maybe there's a new combination of parameters I need to try. Just thinking out loud...hopefully I'll get back to this at some point.
 
Altered worst, Mid, and Best adjust. So much better. Racing at Simulation, 120%, Angry AI and the racing is far more realistic.

Struggled to Qualify in top 10 and racing was work.

Still can't find QualRation or RaceRatio if anyone knows where it is?
 
"It's in the track AIW files under GameData\Locations\..."

Nope. It's not. I assumed it would be in the same text grouping as Best, Mid, Worse but it's not. I did a notepad text search for QualiRatio and RaceRatio and it's not there. Checked the .aiw files for four of my custom tracks. None have it.
 

Similar threads

Top