RaceDepartment Store

Upcoming Events

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

GTR2 New simple AI experiment

Shovas

Premium
[This is now a mod with further improvements over here: https://www.racedepartment.com/downloads/sho-competition-ai.30447/]

As I always say, it really bothers me you can win from last place in GTR2. In real life, you usually finish +/- a handful of spots where you qualified.

The simple part of this are my goals and the params to change to accomplish it:

- Primary: Improve AI early braking and slow cornering speeds
- Secondary: Qualifying should represent racing ability +/- a few spots like real life. Ie. Your qualifying position usually indicates your final position in the race +/- a few spots.

I decided to try a new tack with AI by starting from all defaults, a clean, vanilla installation, and just modifying the three UserData PLR AI params related to AI performance. Here are the values I've landed on after a bit of bisection search testing:

AI Brake Power Usage="0.99500" // Default: 0.98000 Fraction of theoretical brake power that AI attempt to use
AI Brake Grip Usage="0.99250" // Default: 0.97000 Fraction of theoretical brake grip that AI attempt to use
AI Corner Grip Usage="0.96500" // Default: 0.93000


The Brake params help alleviate early braking into corners so that you don't end up running into the back of AI too much.

The Corner param helps alleviate slow cornering.

With these changes, if I've qualified realistically, I tend to have very good, hard racing, not passing too many cars unrealistically.

I arrived at these by (so far minimal) bisection searching between the default value and the "perfect" 1.0 value:

1637359293475.png


Additionally, these should not affect AI performance but should improve some AI related things:

AI Max Load="30000.00000" // Default: 40000 Maximum total load to set up theoretical performance tables
AI to AI Collision Rate="40" // Default: 20 Detection rate per second (1-40) for AI-to-AI collisions

Max Load seems to affect how cars respond when they contact (lower it enough and when you hit somebody they might send you flying like a ping pong ball).

EDIT: I was wrong, this doesn't seem to be what this does. Car HDC "AI Torque Stab" might fit this description

Collision Rate helps improve AI situational awareness and I think but not sure can help with first corner / first lap congestion.

EDIT: As of 1/6/22 I recommend default AI to AI Collision Rate=20 as after some testing 40 didn't seem to improve things much at all and I thought I noticed some odd behaviour that wasn't happening at the default. So to be safe I just leave it at the default now to avoid too many variables changing.

So far I've tested these:

- GT: Ferrari 575 at Valencia GP 2004
- NGT: Porsche GT3 RSR at Oschersleben GP 2004
- G3: BMW Z3 at Imola GP 2004

General Tips:
- Run all sessions with default setups to avoid 'gaming' the system with for example better tires or less fuel weight than AI (I'm not exactly sure what GTR2 is doing for session specific setups, though).
- Always start new class/car/track combos at 100% and tune from there

Qualifying Tips:
- Save time finding right AI level: If you're too fast or too slow (ie. not the position you want to be) then note your time and run qualifying again with a different AI level using time acceleration. Compare your time against the AI and see if your time would lie where you like to qualify. Change the AI level if you're unsatisfied and repeat. You don't have to actually put in qualifying laps until you see you're at the right AI level.
- AI Levels (Not Exact, Probably wonky):
- 80-90: 0.5sec increments
- 90-100: 0.25sec increments
- 100-110: 0.2sec increments
- 110-120: 0.10sec increments

Racing Tips:
- Take it easy first race lap, don't pass or don't pass too many anyway, the AI can't really race properly until they're spread out which usually happens by the end of lap 1
- I find it necessary not to pass at all the first lap, just maintain the position, to avoid 'gaming' the race and moving up too quickly (doing so will ruin your fun and immersion)
- Don't take chances with the AI you wouldn't take with a human. This will enhance your experience, improve immersion, and stop you 'gaming' the race by abusing AI behaviour
 
Last edited:

MJQT

Premium
- Run all sessions with default setups to avoid 'gaming' the system with for example better tires or less fuel weight than AI (I'm not exactly sure what GTR2 is doing for session specific setups, though).
This is the default practice I always follow when playing offline, for exactly the reason you mention! It can be a little immersion-breaking though, especially regarding basic things like appropriate gear ratios and having more or less aero (e.g. at Le Mans).

I'm almost certain you can add default setups car-by-car and track-by-track for AI in rFactor, and I would think you can do this in GTR2 as well. Perhaps this would be a worthy addition to your AI mod – a basic default setup for each car-track combo in default GTR2 content that has reasonable gearing and aero for the AI and player to add to the immersion? Simple things like gear ratios and aero for top speed or cornering shouldn't (I don't think) screw up what you've discovered about parameters through bi-section searches... (right?)

EDIT: this is something I bet you could easily get other people to figure out on their own and share with you as well.

EDIT #2: You mention session specific setups. I recall reading a AMS1 changelog mentioning implementing different setups for quali and the race, but I think it's something Reiza had to add to the existing engine. Unsure if it's something SimBin had added too... but I doubt it somehow.

EDIT #3 (lol): Forgot to say thanks for all the amazing work on this!! And for sharing the 'best practices' with us so we can have a good experience with minimal effort. Cheers man.
 
Last edited:

Shovas

Premium
This is the default practice I always follow when playing offline, for exactly the reason you mention! It can be a little immersion-breaking though, especially regarding basic things like appropriate gear ratios and having more or less aero (e.g. at Le Mans).

I guess one way to look at it, and to get around that limitation, is to consider it all as simply "performance". For example, say on a default setup you qualified 10th but with a custom setup you qualified 5th. I guess it's all relative so you'd just be competing with the higher positions.

Same with a race session and tires, etc., if those ahead of you are still putting in better laptimes than it should still be a good race.

The thing that we want to avoid is just having an outright advantage over ALL of the AI. You want to at least have some AI to have real battles against. As long as your setup only gives you an advantage over SOME than does it really matter that you have a custom setup and they don't?

I suppose I want to keep that guidance in the mod for the purpose of reducing complexities and having too many variables to deal with while I develop the mod but actually in the future it may be moot if you just consider everything "performance".

I'm almost certain you can add default setups car-by-car and track-by-track for AI in rFactor, and I would think you can do this in GTR2 as well. Perhaps this would be a worthy addition to your AI mod – a basic default setup for each car-track combo in default GTR2 content that has reasonable gearing and aero for the AI and player to add to the immersion? Simple things like gear ratios and aero for top speed or cornering shouldn't (I don't think) screw up what you've discovered about parameters through bi-section searches... (right?)

This is apparently possible with "Vehicle Specific AI Setups" (see below).

But there are a lot of car/track combos. Customizing and testing each would be a mammoth undertaking.

EDIT: this is something I bet you could easily get other people to figure out on their own and share with you as well.

Good point. I think for now I want to keep working on the most basic universal parameters that affect everything at once to get the most benefit out of the least work (80/20 rule and all that). Once I run out of those options is when I consider getting into Talent, Track, and Car files.

EDIT #2: You mention session specific setups. I recall reading a AMS1 changelog mentioning implementing different setups for quali and the race, but I think it's something Reiza had to add to the existing engine. Unsure if it's something SimBin had added too... but I doubt it somehow.

I worded that poorly. There is this setting:

Vehicle Specific AI Setups="1" // If 1, search specific vehicle directory for "<track>.<qual/race>.svm" or "<track>.svm" or "ai.svm" before falling back on game.gdb defaults

What I really meant was I'm not sure what happens in a race session when you use soft tires for a sprint: Do the AI use soft tires too or are they still using mediums (I assume...) ? Like, do they respond in any way to your setup changes? I don't know.

EDIT #3 (lol): Forgot to say thanks for all the amazing work on this!! And for sharing the 'best practices' with us so we can have a good experience with minimal effort. Cheers man.

No problem, I enjoy doing it, and I hope it helps rejuvenate GTR2 for everyone for years to come!

PS. All of this is now a mod over here: https://www.racedepartment.com/downloads/sho-competition-ai.30447/
 

MJQT

Premium
Thanks so much for the detailed follow-up!! :) Will keep all this in mind.
But there are a lot of car/track combos. Customizing and testing each would be a mammoth undertaking.
Yes, that's true. Work to save for later!
What I really meant was I'm not sure what happens in a race session when you use soft tires for a sprint: Do the AI use soft tires too or are they still using mediums (I assume...) ? Like, do they respond in any way to your setup changes? I don't know.
I don't know if they respond intelligently by default, but I'm almost certain there is a setting in the PLR file to force AI to use your setup. So if you enabled that setting, if you only changed your tyres to soft for a sprint race (as per your example) they would use softs too. But it could be dangerous to alter anything other than tyre compounds in your own setup, given I'm guessing the numerical values describing a setup are not equally applicable to every car (although I may be wrong about this). So I don't feel like it would be right to suggest enabling this setting for everyone, always and everywhere.
 

Shovas

Premium
I don't know if they respond intelligently by default, but I'm almost certain there is a setting in the PLR file to force AI to use your setup. So if you enabled that setting, if you only changed your tyres to soft for a sprint race (as per your example) they would use softs too. But it could be dangerous to alter anything other than tyre compounds in your own setup, given I'm guessing the numerical values describing a setup are not equally applicable to every car (although I may be wrong about this). So I don't feel like it would be right to suggest enabling this setting for everyone, always and everywhere.

I keep thinking there is but I can't find it.
 

MJQT

Premium
I keep thinking there is but I can't find it.
As an update, I've kept looking for this option, and still can't find it. In fact, I don't even see this option in other ISI-based sims like rFactor or Automobilista. Must have invented it in my head! My bad.
 
funny enough I am looking for same exact setting to test one enhancement I am working on. I see this:
Vehicle Specific AI Setups="0"

But did not yet try it.
 

Shovas

Premium
funny enough I am looking for same exact setting to test one enhancement I am working on. I see this:
Vehicle Specific AI Setups="0"

But did not yet try it.
The GTR2 description of that param didn't sound like it, though? -->

// If 1, search specific vehicle directory for "<track>.<qual/race>.svm" or "<track>.svm" or "ai.svm" before falling back on game.gdb defaults
 
The GTR2 description of that param didn't sound like it, though? -->

// If 1, search specific vehicle directory for "<track>.<qual/race>.svm" or "<track>.svm" or "ai.svm" before falling back on game.gdb defaults
You are right, but doesn't it mean you can force some setup by changing the .gdb? Not exactly force your setup, but still
 

MJQT

Premium
If I understand correctly - you'd have to create equivalent custom setups for each car for each track, then update each track's gdb to look for them? Is that right?
 
Have you looked at Von Dutch AI Tutorial? (in the library here) He goes over much of this; you can get good AI performance, but it's tedious and time consuming.

Another irritant is brought by default track settings. Don't you hate when practicing to be noticeably faster than the AI but then start a race and they leave you in the dust? Or the other extreme where you are a backmarker all through practice and qualifying, start the race at the back of the field, and am in the lead by the end of the first lap.

I tweak the aiw file for each track. Start by running enough practice laps to create a decent setup and know my average times, then set QualRatio and RaceRatio to zero. Run a few testing sessions and note the AI lap times, tweak MidAdjust to set them where you like. Now run a few qualifying sessions and tweak QualRatio to set the AI times where you want them. Next a few AI only races and tweak RaceRatio to set the laptimes there. You will now have AI speeds consistent through practice, qualifying, and race.

You will probably have to do this for each class of car you race, what is optimum for GT cars may be horribly wrong for F1 or prototypes. I keep a txt file in each track folder containing those lines for various classes/mods so a quick copy-paste into the aiw file sets the AI for whatever I want to run.
 
Top