Training the adaptive AI

Lars Hansen

Buggered if I know.....
We all know that racing fellow humans is more fun, but sometimes there aren't any around when you feel like racing.
Which is why sims come with an AI.
The R3E AI has a rather bad reputation, which in my opinion is ill-deserved.
It works just fine, assuming you treat it right.

First off, forget about the percentage settings.
Nobody is equally adept at all car/track combinations, so you can't use one setting for all of them.
You could in theory write down the settings for each combo, but.......
So use the adaptive AI.

As you may have surmised, the adaptive AI adapts to your skill-level.
But it needs a baseline in order to work properly.
Here's what you do:

Step 1: Start a race with the desired combo, and run qualifying. The AI skill varies with the combos, and we need to find out whether you're faster or slower than the AI baseline.

Step 2: Quit out, and start a series of 10 minute races without qualifying. If you were faster than the AI, start at the front. If you were slower than the AI, start at the back.
The idea here is to be able to run consistent laps without interference from the AI.


EDIT: Scratch the above. I'll rewrite it once I figure out the best way to train it.

How many races you need to run in Step 2 is actually up to you.
The more consistent your lap-times are, the faster the AI will find your pace, and adapt to it.
For me it usually takes 2-3 races, and then I can get a good fight out of the AI.

Couple of things to note.
It's still an AI, and it's not perfect. Like most other AIs (and most sim-racers btw) it doesn't do particularly well in a crowd, so you need to be a little careful on the first lap.The further back you start the worse it is.

The adaptive AI constantly adapts. Which is good, because as you gain experience and improve your lap-times the AI will follow suit.
But if you've been down at the local for a few pints and a bit of a sing, and then run a race with adaptive AI, not only will you not be able to catch it, the next sober race will be ridiculously easy because it has adapted to your now slower lap-times. :D

But to show-case what it can do, here's a short 10 minute race for illustration purposes.
I've done 3 races before this one to get the AI to adapt to my pace, and put myself in 6th position.
Look out for:
1. The AI is not robotic, it makes mistakes. Observe the blue/red car in 4th position, and watch it fishtail as he locks the brakes.
2. The AI doesn't give up after being passed. Near the end I screw up, the AI takes advantage and I lose P2.
3. The only time there is contact (when I move to P2) it is my own fault. Not once do I get dive-bombed or rammed in to.

So if you're willing to do a little 'homework' to get the AI to adapt, R3E can certainly provide single-player entertainment.
EDIT: Fine-tuned the OBS settings.
Much improved video-quality.
Driving still sucks though. :D
 
Last edited:
I have a question:
Is the (adaptive) AI influenced by multiple tyre or fuel usage?
No, or at least not directly.
The adaptive AI works by comparing the players average lap-time over the last ten laps to the AI grids average fastest laps.
However, multipliers on tire-wear might result in slower player lap-times, which in turn will affect the AI level.

Furthermore, I suppose it's possible that a pit-stop in the last ten laps of the race might affect the average.
I'd assume that a lap with a pit-stop is disregarded (much like the first lap when using standing starts), but an assumption is all that is.
I've never tested the AI using pit-stops.
 
Thanks for the Info.
I try to get used to the adaptive ai better and it works pretty well. Best experience so far: Bathurst, DTM2016. OMG. :)
But then sometimes i'm just wondering, for example:
Custom Championship, 2 Race format, Nürburgring GP, 2nd race: The ai did laptimes of doom, basically top3-leaderboard times. I was not even close (not in trainingrace-sessions, not in 1st race).
 
Thanks for the Info.
I try to get used to the adaptive ai better and it works pretty well. Best experience so far: Bathurst, DTM2016. OMG. :)
But then sometimes i'm just wondering, for example:
Custom Championship, 2 Race format, Nürburgring GP, 2nd race: The ai did laptimes of doom, basically top3-leaderboard times. I was not even close (not in trainingrace-sessions, not in 1st race).
Well, it depends on how you go about it.
The adaptive AI doesn't adapt to YOU, it adapts to your skill-level for each car/track combo.
So for example, let's say you've done DTMs@Bathurst over and over again, and you've not only gotten good at that particular combo, you've also made the AI adapt to your skill-level at that combo, so now it's running at say 112.
Next you switch to Nürburgring (same DTMs), but you're not as good at that particular combo.
Here's the tricky bit, if the AI-file already contains data for that particular car-class, it'll start at the average of the available skill-levels, the logic being that most people are reasonably consistent with the same car.
Only in this case, this means it'll start at 112, and if you're a little less skilled at Nürburgring than you were at Bathurst, the AI will out-run you.
Now, after you've done the combo a few times, it'll adapt again to e.g. 104.
Which in turn means that the next track you'll try with the DTMs, it'll start at 108 (average of 112 and 104).
So the more entries you start accumulating, the higher the chance that it'll start at what is the correct level in the first place, and the faster it'll actually adapt.
 
@Lars Hansen you appear to be the expert to ask this :)

Do the AI Adapt to your driving line? For example at Bathurst the AI take a weird central line through The Chase (which is just plain wrong!) so will they essentially "copy" my line?

Only just started with this Sim so it's all a bit new to me, thanks :)
 
@Lars Hansen you appear to be the expert to ask this :)
Maybe I'm just the only one daft enough to try and figure it out. :D

Do the AI Adapt to your driving line? For example at Bathurst the AI take a weird central line through The Chase (which is just plain wrong!) so will they essentially "copy" my line?
No, they won't. In fact, the R3E AI doesn't operate with lines as such unlike e.g. rFactor.
Most of the files in question are encrypted, so this is essentially guesswork, but from what I can gather the AI are given a set of tools for each AI level which will result in a given lap-time for that AI level.
If you then move up a notch or two in AI level, either manually or through adaptive, the AI will be given a bigger and better tool-box to play with.
What exactly these tools are, is presumably proprietary information, but I would imagine they included the ability to drive closer to the edge of grip, maybe a bit of boost, that sort of thing.
What it means in practical terms is that if they're taking a wrong line through a series of corners, upping the AI level won't magically make them choose the correct one.
But it may enable them to take the proper one with their new tools, or alternatively offer them enough grip so that they can do the 'wrong' line in the same amount of time as the player does the 'right' line.

It's a fairly novel approach to the AI question, one with both pros and cons.
But right now the AI is very good at flowing corners, and less good at sharp, technical sections, chicanes and hairpins.
 
Excellent thanks for the quick response, although nothing I hate more is AI going through corners at the same rate as Humans but on a totally different line so this may come to bug the hell outta me eventually :(
That being said though the majority of Bathurst they're driving "correct" lines just The Chase is wrong, not had a chance to properly try other tracks yet so I'll see how they go eventually.
Adaptive AI does sound good in practice though and something that draws me into them especially as this Sim has good AI to start with :)

Thanks for the help, I'll no doubt be back in the future :p
 
Is the adaptive AI skill level divided per car or is it general?
Assuming that I can race at let’s say 110% with the GT3 cars and I achieve top 5 results with that does that mean that the adaptive AI will also use this skill set for other car classes as the open wheelers for example?
 
Have n't done a lot with this sim lately due to the AI being too aggressive. But now I have deleted the AI adaptation file they seem a bit more realistic, still getting the love taps but nothing like the blind reckless driving as before.
 
Is the adaptive AI skill level divided per car or is it general?
Assuming that I can race at let’s say 110% with the GT3 cars and I achieve top 5 results with that does that mean that the adaptive AI will also use this skill set for other car classes as the open wheelers for example?
It's a bit of everything, there's a hierarchy.
Each car-class/track combo has its own unique AI level tracked, but this can be influenced by other combos as follows:

If there is no times in the index-file at all, the AI will start at 80 (might be 90, can't remember off-hand), else.....
If the file contains AI levels for that particular car-class, the AI will start at the average of all those AI levels, else......
If the file contains AI levels for that track, it'll use the average AI level for all classes on that track, else.....
If there are AI level in the file, but nothing for neither that track nor car-class, the AI will start at the average of all the AI levels.

So if you run GT3@Spa at 110, the next track you start with GT3s will also start at 110.
(Assuming there are no other GT3 levels in the file).
After a few races, it'll adapt to your pace on this track, so when you start the third track, it'll start at the average AI level of the first two. And so on, and so forth.
So the more tracks you do with one class, the sooner it'll find the correct level, assuming you have roughly the same pace on all tracks with that car-class.

Have n't done a lot with this sim lately due to the AI being too aggressive. But now I have deleted the AI adaptation file they seem a bit more realistic, still getting the love taps but nothing like the blind reckless driving as before.
It should. The post-patch AI is a lot faster, so running with the same file suddenly has you running against opponents trying to force their way past you because you've become too slow post-patch.
Although deleting the file isn't necessary, you can simply delete the AI times and create new entries. They should be roughly 4-5 levels lower than your pre-patch ones.

So basicly, if want to race dtm at Hockenheim best thing before i start the race is to do a 10+ lap practise session/hotlap???
And then start the dtm raceweekend so that the AI uses my set times?
Not quite that easy.
Your own lap-times isn't all that is needed, the AI also needs entries for the corresponding AI levels which it only gets through racing it.
Easiest way is to edit the file manually, but if that isn't an option, do this:
2 lap races, standing start, with the player-car LAST on the grid.
Pick a fixed AI at what you think is roughly the right level, then let the grid get a head-start so it doesn't interfere with your own flying lap.
Next, do it again. If the AI was too fast, lower it by 5 (increase by 5 if it was too slow).
Keep doing this until you have your own lap-times 'bracketed' by AI levels.
Then switch to Adaptive.
Just be damn sure your lap-times are reasonably consistent if you do it this way.
 

Latest News

How long have you been simracing

  • < 1 year

    Votes: 290 15.3%
  • < 2 years

    Votes: 200 10.5%
  • < 3 years

    Votes: 197 10.4%
  • < 4 years

    Votes: 143 7.5%
  • < 5 years

    Votes: 252 13.3%
  • < 10 years

    Votes: 226 11.9%
  • < 15 years

    Votes: 141 7.4%
  • < 20 years

    Votes: 116 6.1%
  • < 25 years

    Votes: 87 4.6%
  • Ok, I am a dinosaur

    Votes: 248 13.1%
Back
Top