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

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:
Thank you for your efforts. I understand that your improved AI is only for default stock cars.

Yes, it's intended for original content cars and tracks.

But it should also affect mod cars if you're racing on an original track.

You're right, CAR files can specify AI names but the actual Talent/RCD logic should come from Default.RCD, at the least, or original RCD files via some matching like on car class or whatever (I'm not actually confident about this).

I do know that, for testing my mod, I have a lot of extra liveries (so extra car files), that don't have Talent/RCD but even those AI are affected the same way by my mod.

It's actually my habit to remove all non-original RCD files when installing mods to my AI testing copy of GTR2 to avoid that affecting my tests.

So, to sum up, you *can* use this mod with other car mods, as long as you stay at original tracks, and the AI should act in sync with the AI mod.

PS. There's really only a few edits to AIW track files so you could even edit non-original track AIW files yourself and you could still use the ai mod.
 
PS. There's really only a few edits to AIW track files so you could even edit non-original track AIW files yourself and you could still use the ai mod.

Those 2 last lines .... should make me very happy when knowing those few edits !
A really interesting suggestion, Shovas. :thumbsup:

Could you tell me where to find them in this thread surely ?
 
There's only one AIW change as of beta7:

WorstAdjust=(0.95)

If you're familiar with Notepad++ you can open multiple files and do a mass replace using regular expressions like this:

Find:
WorstAdjust\s*=\s*\(([\d\.]+)\)

Replace:
WorstAdjust=\(0.95\) // DEFAULT=\1/

This assumes original track defaults in the mod track for MidAdjust and BestAdjust:

MidAdjust=(1.0000)
BestAdjust=(1.10)

Those haven't been changed but if your mod AIW has different values then set them to the those values.
 
Thanks, Matthew ... it can surely also be possible with "Search and Replace" tool ...I'm sometimes using for mass replaces in the .car files.

I'll try when I have more free time. ;)
 
At what AI level are you racing?
im doing some testing and did 2 races with GT1.
this is vanilla gtr2, no updates/mods just official patch 1.1
in the past I too sufferd from this problem about AI being too slow in the race etc. And I decided to give 1 last try to fix it, otherwise I’ll move to other sims.

so to start things off I tried to get a good qualifying run to make sure I start where I should be speed wise.
single class to minimise ai slowdown caused by lapping.
AI 115%
first race was GT1 2003 at Valencia with #17 Viper, racelength 45 minutes (no pitstop)
starting position 15, finished p10. Had some good battles and hard to keep up. Actually was surprised by this result.

then yesterday. GT1 2004, 90 minute race at Spa 2004 driving the #33 Maserati. Again AI 115%
oh my that was a shocker. Qualified p22, gained some positions at the start but quickly lost some as well. the Lister and Lamborghini I overtook were just too fast. Was in p21 for a while then made a mistake and 2 vipers overtook me. pitstops were done and some positions gained by me because of DNF’s but I did not gain any position on track or in pits besides the DNF’s.

seems at 115% AI is very competitive in race. I’ll do more testing later this week.
 
Hey Shovas
Thx for the help. The AI is now much more competative (althought I use the tweaks for GTL). I now testdrive every track and tweak the AI. What I found out is, that there are no fixed Parameters. For Example: On Road Atlanta the setting WOrst 0.95, Mid: 1.00 and Best:1.10 works great but on Mosport Park the AI nihilates me with this setting, eventhought I could drive this track in my sleep. But the basesettings you gave are great to start cusomize the AI strengh.
 
An observation. I have been working on RCD. files for a Mod (F1 -1967) for GTR2. I am trying to give certain drivers their due speed and skill-Jim Clark being an obvious example. I adjusted their high speed and low speed cornering values and some other variables. The adjustment had no influence on the quali lap times or race lap times. The RCD. files were located in the individual CAR files. I tried moving the RCD. files to their own Talent Folder, paying attention to the name of the Folder. Same results. There seems no explanation for this. Any ideas?
 
An observation. I have been working on RCD. files for a Mod (F1 -1967) for GTR2. I am trying to give certain drivers their due speed and skill-Jim Clark being an obvious example. I adjusted their high speed and low speed cornering values and some other variables. The adjustment had no influence on the quali lap times or race lap times. The RCD. files were located in the individual CAR files. I tried moving the RCD. files to their own Talent Folder, paying attention to the name of the Folder. Same results. There seems no explanation for this. Any ideas?
Thanks for reminding me of this. I’ve noticed this for a while and keep forgetting to ask about it. I’ve tested this a bit. Doing the same track and car class combo several times. Changing nothing and get different ai performance levels. Of course I expect some variation giving that it will load slightly different ai within the chosen class. But I’ve even experienced this reloading a saved race. All I can figure is there must be some kind of performance variable hidden in the hard code.?.
 
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.

Added update to OP about the AI mod that resulted from the investigations in this thread.
 
Last edited:
:thumbsup:Good stuff. I've spent the last two months playing around with .car comparitives and .aiw best, worst, quali ratio and race ratio, talent data, testing, racing, testing, racing trying to find that combo that creates a tight comeptitive field. Will certainly give this a try in the mix. Thanks. :thumbsup:
 
Tantalizing progress on auto-calculating AI level:

I was able to figure out polynomial curve interpolation. I am not a math guy but what it allows us to do is figure out an unkown AI level(*) to use based on a set of known AI level laptimes.

*AI level for this post actually means PLR Brake Power/Grip and Corner Grip params, not AI DIfficulty 80-120 levels which would easily plug right in but wouldn't provide the granularity needed with only 40 increments.

In other words, plugin your lap time and it automatically calculates the AI level to bring the fastest AI up or down to your level.

What I did was let the AI run qualifying sessions for a given car+track combo at AI levels at certain increments. That gave me the known data set to work from.

Then I charted that, grabbed the polynomial formula you can make Excel display on a chart, plugged it into a cell, and made it solve for a given input value which you can enter into another cell yourself.

Now that I have that working, I feel like it's not such a huge task to generate the data sets. May even request some help from you guys to generate some data for me.

My hope is actually somehow that I can avoid generating data sets for all car+track combos. Rather, I'd like to see if dealing in relative percentages from one data set will apply to another data set. For example, I have a Ferrari 575 @ Oschersleben data set. I hope to use some relative aspect of the data to apply to at least another car on the same track. Ideally, it would be cool if it could also apply to any other car and track. Might be asking too much, though.

This was something I was able to do on Good Friday being a holiday. I'm working a new job so not finding time to sim race right now :( But I hope to get back to this at some point.

The end goal will be a freely available online spreadsheet where you just type in your laptime, the fastest AI's laptime, and you instantly get params to adjust the AI strength to your level.

This ideally reduces the headache of finding the right AI level to just (1) Run qualifying + save + exit, (2) Calculate new AI params + update PLR, (3) Reload saved game and continue to Race session. No repeating qualifying, no trying different AI levels.

One can dream...
 
Really hoping your dream might ... become reality ...even if it's not 100% accurate in all cases.

You already worked a lot in that meaning ... so that you should deserve at least a 50% positive result ... what already might mean a much better pleasure on track without spending hours to reach the same goal. ;)
 
Sorry for this comment, I did not want to open another thread, ;)so I leave it here:
shovas, it shows a lot of effort in the work you did,:thumbsup: I only have some questions from the ai of gtr2, not from your mod.

(this is aimed at shovas, jempy, gtr233, or anyone who has knowledge of the subject)

... yes, I saw that there is a lot of difference between the race and the classification, and your mod is the solution, I know that here simbin lacked some polish ... I don't know how to explain it ... but:
-Have you seen the real "2004 Proximus Spa 24 Hours"? (in youtube)... I mean, there is almost no action on track, (of course, it is not the wtcc-btcc wheel-to-wheel races to the finish) ... what I mean is that simbin may try to give the ia a look "similar" to the gt of those years ...
when we play, we want "action" and overtaking, but in reality it was not even, that year only the cars moved away from each other.

then the questions come:
-Is the gtr2 default AI wrong? (sure yes, but how much?)

-Are the ia, the tire wear of the ai (dry, and even worse in rain), and the fuel consumption of the ai ... the biggest problem of gtr2?

This is not seen in a 6-lap race, but it ruins the experience when on lap 15 you enter the box to change, but the AI holds 10 more laps. (worse in the wet).

unfortunately, the ia is not only a talent archive, it is the circuit, and the tracks and cars mods are sometimes not good.
 
Hi guys. Sorry to bump the thread but i'd like to help/clear if possible a few things on the AI of GTR2, or more specifically why IRG did what we did, with the AI. The premise of the GTR2 Reborn Project AI was not to stick to the default GTR2 and just tweak a few things to reflect approximate real world performance like the default game, but rather to expand the experience of the original. If we followed the convention of adjusting AI to suit ourselves, then anyone else using our AI -obviously having different driving abilities than us- will have a mixed reaction, either good or bad.

What we did then was to offer a better experience that would allow the offline user to race the AI as if they are online. When you race on-line you never know what the other drivers abilities are, thus the Talent files reflected this. I found early on the restrictive nature of the default AI. Having real life drivers do exactly the same race after race i.w.o qualy and race results might be ok for early users of GTR2, but as time goes on you either go online for a better challenge, of change the game to match your own abilities.

The drivers in the Talent files do not reflect the 'named' drivers abilities, doing so would put us back to square one by following our tails round and around trying to match the AI to what is expected. In a real life race no-one, and i mean no-one knows who will win, who will crash out, who will have mechanical failures, or even who's mechanics stuffed up the cars setup. A real life driver adapts to what he is driving at any particular race, The driver knows what to expect when he gets in the car, but that's all. We felt the GTR2 user might like the same.

Moving on....

Having suffered a couple of strokes a few years ago, a great deal of stuff i knew has gone and i'm only just starting back with GTR2 again. So i'll try my best to put stuff down i do remember.

First thing is to make sure all tracks have the same Dry and Wet parameters, some 3rd party modded tracks have <> values which deviate from the default 1.0 and this probably reflected the track makers/converters own thoughts, a modded car physics, or even to 'fudge' a problem with the track, who knows? We started our task with the default AI, then once that was done, we moved onto the Reborn project.

My personal enjoyment with GTR2 is to never increase the RPM, the AI cannot do it during Qualy or race so why give yourself an unfair advantage. Some guys complained the AI were too slow and said because of this GTR2 was no good, by not increasing your RPM you start on the same level.

In the tracks files there is a qualy adjustment that increases the AI ability, i look at this the same as the AI having a lower fuel load, with this in mind, the user can adjust their own fuel load in a qualy setup.

I use the default setups and help my imaginary mechanic by only adjusting the suspension, tires and steering lock to suit the track, weather, and track temperature. I never adjust wings, RPM, or anything that would give me an unfair advantage against the AI. Basically in my mind i use what the mechanic has setup the car for. The AI is the same, it only drives with the parameters it's given.

Having these in mind, the AI is much easier to deal with. I mentioned earlier about chasing our tails going round and round in circles, Adjusting the AI is like that without the basic 'rules' of the user. Use the Default car setup

Online racing is all about going flat out and crossing the line, so we maxed out, where possible, the AI's abilities. Made them more aware of other cars near them, stopped them from fading in the background once you passed them, stopped the rubber-band effect of drivers slowing then speeding up for no reason, only take a pass when it's viable to do so and not plough through the pack.

There are a few options when dealing with your personal AI experience, either change all or some of the parameters, all the drivers or some of the drivers, stay within the default GTR2 parameters as reflected in real life race results or take it up a notch and make it your own. The thing to remember is that the basic user rules must be in place beforehand i.w.o setups when racing against the AI.

I hope this helps in some small way.

Regards

Barry
 
Great thoughts, Barry, I feel much the same way in regards to finding out that, when trying to get the best AI, you have to keep things simple and reduce the number of variables as much as possible.

For example, I only ever adjust fuel for practice and races, I use mediums for those, too, whereas in qualifying the only I change is to use soft tires. There's millions of things you could tune in your setup but doing any of that prevents the AI from doing the same thing and you just put them at a disadvantage so it breaks your AI expectations.

I can't remember my findings when I retried Reborn but anything I ever tried with AI I always found what you found, that they were far too slow in a race, they gapped out during the race way too much and you often found yourself driving with nobody around, and almost always you could race from the back of the grid to 1st within a few laps (no exaggeration). It drove me crazy.

In my AI mod, I opted to make all the AI the same to allow only the game's AI logic to differentiate them. It's similar to your premise where the names of the drivers no longer match their real world performance.

But the racing it produces is fantastic when you find the right AI level for your own laptimes.

I'll have to give Reborn another try it's been a long time.

Maybe we could collaborate on some things and see if there aren't some new ideas to try out. I'm hoping you could help me figure out my auto-calculation based on relative performance metrics instead of static! :)
 
Hi guys. As i said earlier i've lost a great deal of stuff both in memory and hard drives, loads of scraps of paper etc... but if i can help in some small way.

Something i do recall for the AI is (Chronus -being a proper scientist worked out the exact formula- and myself rough and ready but similar results) was to set the AI Max Load="32000.00000" in your .PLR (the exact calculation arrived at was between 31000.00000 and 32000.00000), this calculation was done as the maximum mass of the heaviest vehicle is much less than the default 40000,00000, how i calculated this is gone, but it helped a great deal both with the default AI and reborn AI. At a guess it was based on mass and Inertia. The AI Min Radius was reduced to ="0.10000" this is based on -as far as our testing found- made the AI more aware (approx 1 meter) around itself for collision purposes. I don;t know if you had the F1 series or GTR1, but the AI would slow down if another car was off the track -we/i assumed this was because the default value for the Min Radius was 25 meters

A.t.m apart from the above AI Max Load and AI Min Radius="0.10000" values in the .PLR, i now only use my engine brake maps. In game i adjust only the Engine Brakemap, and the Diff Power, Coast, and Preload, the Diff settings are by default set at what -i assume- Doug Arnou or whoever made them preferred, and typically -i found- rear/mid engine vehicles prefer a lower power/higher coast setting due to the inertia distribution than what the defaults are. The reason i like the brakemaps is because they effect the AI as well, as the default values show all the AI -GT/NGT use either GT 0.000125 or NGT 0.00025 irrespective of what their differing mass/Inertia's are.

The Talent files were produced using a Batch talent editor by Tomdoyle1948 on No-Grip (pause for fond memories), the advantage of it was that min/max values could be applied to all the various values within each .RCD file and make a master .RCD in one go, and from this master .RCD i could adjust various value to suit different mods. This utility -despite my exhaustive searching- sadly is no-where to be found. Having said that, using the default GTR2 AI .RCD files are exceptable for their purpose, just not on a more exacting personal level.

I hope this helps

Regards

Barry
 

What are you racing on?

  • Racing rig

    Votes: 528 35.2%
  • Motion rig

    Votes: 43 2.9%
  • Pull-out-rig

    Votes: 54 3.6%
  • Wheel stand

    Votes: 191 12.7%
  • My desktop

    Votes: 618 41.2%
  • Something else

    Votes: 66 4.4%
Back
Top