* AI Learning - Step by Step Guide *

:cool: Another question that came up is what to do if have both .ini and .wis files such as when you try method 1 first but don't get good results so then use method two. Not sure which the engine gives priority to so I just deleted all the .ini files so might also be good to mention if it is known which takes precedence or it is recommended to not have both etc etc. Thanks again for pulling this info together. Should be a sticky. Now to read the test of the thread :p

That's something only ISI can answer (ini or wis).
 
Hi all, very interesting thread.
my question is if #1 and #2 methods are still up to date, I mean: do they work with the last builds or is there something new/different that i should do to make the AI learning ?
 
Hi all, very interesting thread.
my question is if #1 and #2 methods are still up to date, I mean: do they work with the last builds or is there something new/different that i should do to make the AI learning ?

They worked in the previous build not sure about the very latest build but I see no reason why they'd not function properly. There's nothing "new" employers the sense that you need do anything different.
 
Can someone help me here ?
I changed the player.JSON and loaded single player. (ultimately this will be for a dedi server)
Track RR Malaysia 1.11, AFCL APEX rF2 F1 2017 Mod.
I followed the guide for AI Learning Guide #1 but when I add the one AI, no message like this below appears :

in the Chat Box you'll see a friendly message from the AI telling you to pretty much sit in the Garage and not move:

I let the AI drive on two circuits but nothing changes, they continue to drive off the circuit on one corner, just tried the Malaysia 2007 1.7 from S397 (no DRS) and the cars run off on the same corner, possibly all other mods have used this one as a base.


I have created this Guide for the JSON entry of "Autocalibrate", this basically helps the AI learn a given track and save their Learning Process for future usage. I will be detailing both the "Autocalibrate AI Mode":1 and "Autocalibrate AI Mode":2 processes.
(I may make additons, fix errors in future, if so Post #2 will detail what has changed)

Before I begin here's a few notes:
- You don't need to do any of the AI Learning if the AI are just fine at a track, more often than not it's 3rd party Tracks that need it or if a particular Mod has difficulty in a corner or section of a track that you're racing at.
- Remember the AI make mistakes (there is a setting in the JSON for this). If you see AI occasionally spinning at a corner then that's ok, you don't need to panic and jump into the Learning Process to make them 100% Clean every lap. The beauty of RF2s AI is that they are very Human like....so they make mistakes!
- The Tracks AIW file (this is what the Track Author creates to give the AI a Basic Driving Line) is a Major key factor in both Learning processes, no amount of AI Learning will prevent the AI crashing if the AIW is poorly created.
- "Autocalibrate AI Mode":2 can have the tendency to create much faster AI and to a point where they become "too good", if (like me) you want AI to reflect Humans as best as possible (i.e. they make Mistakes) then either run fewer laps with this setting or don't run it at all. As per the first point you don't have to do any Learning, this guide is merely for those times where it is needed should the AI be struggling.
- Both #1 & #2 use Different algorithms, this means that #1 may actually work better at some tracks than #2 and vice versa.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

For the Guide I'll be using the latest ISI Renault Clio 2010 (v1.51) mod at Mills Metropark (v1.43) 'Layout Inner Loop C'.

AI Learning Guide #1: "Autocalibrate AI Mode":1,

1)

Locate your player.JSON file in your '\RFactor2\UserData\player' (yours may differ if you chose Default Dir when installing) and open with Notepad or preferred JSON editing tool.

Search for and locate the following:
"Autocalibrate AI Mode":0,

In this Guide we will be using the "1" variable so go ahead and change the 0 to a 1. (NB: Make sure your player.JSON isn't Read Only) Save and exit Notepad then Load RF2

2)

The in Game settings are important, so setup as follows (Picture for reference):
- Make sure to select PRACTICE ONLY
- Set the Weather to Sunny or Overcast, as long as there's no Rain at all
- Turn OFF Tire, Fuel and Mechanical Failures. Set the Strength to 100% and Aggression to 50%
- 0 AI Selected
View attachment 3567


3)

OK here we are at the track, go ahead and ADD 1 AI (Important: Only 1 AI), in the Chat Box you'll see a friendly message from the AI telling you to pretty much sit in the Garage and not move:
View attachment 3568

Now during His or Her learning process he or she will drive lap after lap and gradually you'll see the "I can do better" message scroll down until the "Meters" gets to 0.00 or as close too it. Sometimes they finish Learning before they reach 0.00 so don't worry if they do:
View attachment 3569

Depending on the Track and/or Mod the AI might have difficulty in finishing the session, for example they might get into the 20.0meters range and constantly loop around that Number. If this happens type in FINISH into the chat box and you'll get the following message:
View attachment 3570

Once they have Finished Learning you'll see the "Track Learning Succesful" message, you can now exit the track and that's it, they have learnt the track and are ready for Racing.

4)

For Confirmation go to your \RFactor2\UserData\player\Settings\ISI_Renault_ClioCup_2010 folder and you'll see a List of the Cars (or just One) and their respective Folder. Inside one of the Folders there will be the following file:
MILLS_INNERLOOPC.ini
This indicates the Learning Process was completed.

5)
For this file to work with all cars you have to manually copy the INI file to all the other Individual Car Folders, this way each individual car will read the same MILLS_INNERLOOPC.ini file when the track is loaded.

Finally go back to your player.JSON file and set Autocalibrate back to 0:
"Autocalibrate AI Mode":0,

Important notes on this setting:
- If you're running a Multicar Mod then you will have to do the process for each type of Car.
- If the AI crashes before completing then simply Boot him out and ADD a new one (just 1 remember), if he crashes and fails to complete the process it could be the fault of the AIW, this Process is not a Perfect Cure for a poorly create AIW file.
 
Last edited:
Things that could explain... Just in case.

Can you verify that player.json still has the correct value for AI autocalibrate? If you edit it while ingame it will be overwritten when exiting rF2.

Be sure not to edit dev mode player.json.

Do you start with one AI or you add it after starting with no opponents.

I cant remember if session needs to be in private mode.
 
Hi Spaskis, thanks for the reply.
I reopened player.json while game was running to recheck and it was still "Autocalibrate AI Mode":1
Started with no AI and added one in Practice.
Basically followed MarcG's guide completely and double checked each step.
 
Track RaceRfactor Malaysia 1.11, AFCL APEX rF2 F1 2017 Mod.
DX9.
I also tried S397 Malaysia 1.7 but this seems to be the original circuit and has the same AI running off the corner problem.
Thanks for the help ! ;)
 
Track RaceRfactor Malaysia 1.11, AFCL APEX rF2 F1 2017 Mod.
DX9.
I also tried S397 Malaysia 1.7 but this seems to be the original circuit and has the same AI running off the corner problem.
Thanks for the help ! ;)

Does it work OK on other tracks? I'm away from my Rig so can't repeat it myself at the moment.
 
I tried with DX9 &DX11, with Addon Tracks (Oulton Park & Donington) and with a stock Track (SaoPaulo), it was proper working on both rF2 versions and on all Tracks... Could you please post a screener from the session menu?
 
rFactor2 2017-09-16 20-18-56-90.jpg Hi Juergen,
Here are the screenshots after adding "Autocalibrate AI Mode":1, and starting the game.
I tried Private Mode but still no message.
Would anyone know if this could be specific to the Mod or to the Track ?

rFactor2 2017-09-16 19-59-53-95.jpg rFactor2 2017-09-16 20-02-04-36.jpg
 
Last edited:
View attachment 10130
I just tried with MCL and ISI Malaysia and worked fine for me.

I also notice that your status is Testing in your screenshot, mine says Practice.
How do you get into Testing Mode ?
I have just tried Silverstone 2012 1.76 with APEX AM_FIAGT3_2012 mod and still do not get that message.
I also tried removing opponents in Session Settings but no change.
I obviously must be missing a step but I cannot see where.
I also notice that after shutting down the game the "Autocalibrate AI Mode":1 in player.json does not change back to 0
Just tried Developers Mode, still nothing.
 
Last edited:
Back
Top