This is a mini guide on track AI improving, based on knowledge gained by trial and error and some headaches. (The downloadable PDF file has the same info as this post).
Here goes a quick tutorial on Assetto Corsa AI line recording and tweaking. You only need the ingame AI app, the AI Line Helper app by esotic (LINK), a notepad and some monk like patience. The process is stupid but the game’s AI is stupid too, so the workflow is often not that streamlined.
The line that’s recorded has data on steering, gas and brakes inputs that the AI will read after, meaning you will have to drive at a decent speed to get decent braking and turn in points, besides hitting every apex. This also means that you need to drive the lap without oversteering and with minimal steering corrections as to not confuse the already dumb AI.
The perfect car for this is the Audi TT Cup car. It’s fast enough so you need to brake, it’s slow enough so you don’t have to be fighting it to stay in the racing line, and it’s front wheel drive so you don’t have to deal with mid corner oversteer. Setting the stability control at 100% is a must too.
Once you jump into the track on hotlap mode, you just need to start recording on the AI app and drive until you get the perfect lap. If you know the track and have the talent this can take about ten laps. If you are like me then you can be driving in circles for an hour before you can hit every apex and braking point without having to correct the steering way too much. An important thing to have in mind is the Audi can take some kerbs than the faster GT or formula cars cannot. Keep in mind that and dont hit or ride kerbs that are way too high, or you will see Mark Webber taking flight again when you try to have a Formula 1 race. Also try to stitch the line well crossing the start finish line, and if you are driving a street circuit with walls close to the racing line, always try to keep at least a foot between the car and the barrier, even if it means missing some apex by a bit.
As soon as you finish the good lap, you can exit the game. No need to click save or anything. A “fast_lane.ai.candidate” file will appear in the track ai folder. Erase the “.candidate” in the name part so it becomes an .ai file.
Now time to record some track boundaries. First, turn off cache generated payloads on the custom shaders patch menu. That breaks things, I dont know why. For recording this you will need to use the AI Line Helper app by esotic. Its pretty simple, on hotlap mode you hit record left or right, then start the lap and your front tyre will record the limit of the track for that side. A formula car is perfect for this as you can see the front wheels. You will need to get a bit creative, dont let the AI use all the track width on very wide or fast corners or they will get easily confused, flat kerbs and asphalt runoffs can be part of the track so cars can have better exits on some corners, high kerbs should be left outside track limits so cars dont fly off.
You can narrow the track on the approach to corners you dont want dumb overtake attempts or stupid three wides to happen too. When theres a wall next to the track, like on a street circuit, always leave at least a foot of distance between the boundary and the Wall, even if an apex is next to the wall.
Once you have both boundaries recorded, they will be saved on the track data folder once you exit the game as two spreadsheet files, and they will be backed onto the fast lane file once you boot the track again. If they dont automatically bake, you can launch the game holding shift to force it.
Ok last step, you can do this one while you drink some coffee and chill. The ai_hints is a notepad file in the data folder. This is the secret sauce. There are many types of hints you can give the AI, and all of these need a “start” and “finish” value for the corner or sector you want them applied to. You can see these coordinates for each corner on the AI Line helper app, the go from 0.000 to 0.999. Drive a lap while taking note of each corner/sector start and finish coordinates.
The [HINT_x] hints are the ones you will use for each corner. Long story short these tell the AI how much to send it into the corner. Normal value is 1.0, you can pump it up to 1.2, and you can lower it to 0.xx. Anything higher than 1.1 is in the danger zone and ideally you should only go lower than 1.0 in very dangerous and fast corners that have some sort of elevation change or off camber that kills AI cars.
What I usually do is set every corner [HINT_x] to VALUE=1.05 and let the AI drive the track in a GT4 Porsche Cayman. This car is perfect because the AI can barely drive it when in the limit. If the AI runs wide on a corner, that means you need to tone down the hint for it, lets say 1.03. If the AI takes the corner easily, you can amp it to 1.07 next. If the AI is on the limit through a corner, then its perfect. Modify all the values you need, save the notepad file, relaunch the game and check again all the times you need to fine tune it.
For vintage tracks you may want to use a Ford GT40 instead or a similar classic car.
For example, a track with six corners should end up with a ai_hints file that looks like this:
Other hint you can use (but only sometimes) is [BRAKEHINT_x] for a braking zone. If you see AI braking way too much or early for a corner you can up the value over 1.0 and up to 1.2. This can happen in a braking zone thats uphill, so cars will need less distance than the AI would think to decrease speed. On the opposite end, on a braking zone thats downhill or particularly problematic, you can set the BRAKEHINT value to something like 0.95 or 0.9.
Another hint you might use every once in a while is [DANGER_x], which tells the AI to NOT TRY TO OVERTAKE FOR GODS SAKE on the right or left on particular corners. The more you increase the value on “RIGHT” and “LEFT” the less likely the will dare to try a move. AI sometimes completely ignores this for some reason, only lord Kunos knows why. An example of a sector where the AI shouldn’t try an overtake on the right:
And the last hint you might need, but once every a hundred years is [MAXSPEED_x]. This literally sets a speed limit on a sector (KPH units). Useful on rare ocassions. Lets say a particular difficult corner sends LMP1 cars flying off track, but GT3 cars and slower take it beautifully for whatever reason. Messing with the [HINT_x] would slow down every single car class, but setting [MAXSPEED_x] to the cornering speed of GT3 cars will slow down only LMPs and hopefully keep them on track too. Example:
On most tracks you will only need to use a [HINT_x] for each corner and thats it. On cursed rollercoaster tracks with lots of elevation changes, you will write a new bible in the notepad before every car can drive it properly.
Last thing to do is test it with various cars. Set different AI races with grids of GT3s, LMPs, F3s, F1s, etc. See if they crash out when racing wheel to wheel, tweak a bit the hints if they do, eventually all or most of them will be able to race the full lap.
Keep in mind some cars are hard to drive for the AI, no matter the track. In some cases this has to do by a bad ai.ini file setting in the car data, which happens even with Kunos cars (the Lamborghini Huracan GT3 and Lotus Exige 240R use way less brake than they should). Some particular cars like the Kunos F2004 or some shady sourced mods are straight impossible for the AI at a decent speed. Modding the cars ai.ini is another chapter for a future pdf I guess. Use the RSS cars for testing F1/2/3s, those are generally pretty good.
Overall you should know that the AI loves flat, hard braking, slow corners and hairpins. It hates full throttle fast flowing sectors with elevation changes and high kerbs. So at first glance you can predict which tracks will be easier to record and make the AI go fast in.
Thats it. It looks like a lot but its actually not. Any feedback is greatly appreciated. Enjoy racing the AI!
Here goes a quick tutorial on Assetto Corsa AI line recording and tweaking. You only need the ingame AI app, the AI Line Helper app by esotic (LINK), a notepad and some monk like patience. The process is stupid but the game’s AI is stupid too, so the workflow is often not that streamlined.
The line that’s recorded has data on steering, gas and brakes inputs that the AI will read after, meaning you will have to drive at a decent speed to get decent braking and turn in points, besides hitting every apex. This also means that you need to drive the lap without oversteering and with minimal steering corrections as to not confuse the already dumb AI.
The perfect car for this is the Audi TT Cup car. It’s fast enough so you need to brake, it’s slow enough so you don’t have to be fighting it to stay in the racing line, and it’s front wheel drive so you don’t have to deal with mid corner oversteer. Setting the stability control at 100% is a must too.
Once you jump into the track on hotlap mode, you just need to start recording on the AI app and drive until you get the perfect lap. If you know the track and have the talent this can take about ten laps. If you are like me then you can be driving in circles for an hour before you can hit every apex and braking point without having to correct the steering way too much. An important thing to have in mind is the Audi can take some kerbs than the faster GT or formula cars cannot. Keep in mind that and dont hit or ride kerbs that are way too high, or you will see Mark Webber taking flight again when you try to have a Formula 1 race. Also try to stitch the line well crossing the start finish line, and if you are driving a street circuit with walls close to the racing line, always try to keep at least a foot between the car and the barrier, even if it means missing some apex by a bit.
As soon as you finish the good lap, you can exit the game. No need to click save or anything. A “fast_lane.ai.candidate” file will appear in the track ai folder. Erase the “.candidate” in the name part so it becomes an .ai file.
Now time to record some track boundaries. First, turn off cache generated payloads on the custom shaders patch menu. That breaks things, I dont know why. For recording this you will need to use the AI Line Helper app by esotic. Its pretty simple, on hotlap mode you hit record left or right, then start the lap and your front tyre will record the limit of the track for that side. A formula car is perfect for this as you can see the front wheels. You will need to get a bit creative, dont let the AI use all the track width on very wide or fast corners or they will get easily confused, flat kerbs and asphalt runoffs can be part of the track so cars can have better exits on some corners, high kerbs should be left outside track limits so cars dont fly off.
You can narrow the track on the approach to corners you dont want dumb overtake attempts or stupid three wides to happen too. When theres a wall next to the track, like on a street circuit, always leave at least a foot of distance between the boundary and the Wall, even if an apex is next to the wall.
Once you have both boundaries recorded, they will be saved on the track data folder once you exit the game as two spreadsheet files, and they will be backed onto the fast lane file once you boot the track again. If they dont automatically bake, you can launch the game holding shift to force it.
Ok last step, you can do this one while you drink some coffee and chill. The ai_hints is a notepad file in the data folder. This is the secret sauce. There are many types of hints you can give the AI, and all of these need a “start” and “finish” value for the corner or sector you want them applied to. You can see these coordinates for each corner on the AI Line helper app, the go from 0.000 to 0.999. Drive a lap while taking note of each corner/sector start and finish coordinates.
The [HINT_x] hints are the ones you will use for each corner. Long story short these tell the AI how much to send it into the corner. Normal value is 1.0, you can pump it up to 1.2, and you can lower it to 0.xx. Anything higher than 1.1 is in the danger zone and ideally you should only go lower than 1.0 in very dangerous and fast corners that have some sort of elevation change or off camber that kills AI cars.
What I usually do is set every corner [HINT_x] to VALUE=1.05 and let the AI drive the track in a GT4 Porsche Cayman. This car is perfect because the AI can barely drive it when in the limit. If the AI runs wide on a corner, that means you need to tone down the hint for it, lets say 1.03. If the AI takes the corner easily, you can amp it to 1.07 next. If the AI is on the limit through a corner, then its perfect. Modify all the values you need, save the notepad file, relaunch the game and check again all the times you need to fine tune it.
For vintage tracks you may want to use a Ford GT40 instead or a similar classic car.
For example, a track with six corners should end up with a ai_hints file that looks like this:
Other hint you can use (but only sometimes) is [BRAKEHINT_x] for a braking zone. If you see AI braking way too much or early for a corner you can up the value over 1.0 and up to 1.2. This can happen in a braking zone thats uphill, so cars will need less distance than the AI would think to decrease speed. On the opposite end, on a braking zone thats downhill or particularly problematic, you can set the BRAKEHINT value to something like 0.95 or 0.9.
Another hint you might use every once in a while is [DANGER_x], which tells the AI to NOT TRY TO OVERTAKE FOR GODS SAKE on the right or left on particular corners. The more you increase the value on “RIGHT” and “LEFT” the less likely the will dare to try a move. AI sometimes completely ignores this for some reason, only lord Kunos knows why. An example of a sector where the AI shouldn’t try an overtake on the right:
And the last hint you might need, but once every a hundred years is [MAXSPEED_x]. This literally sets a speed limit on a sector (KPH units). Useful on rare ocassions. Lets say a particular difficult corner sends LMP1 cars flying off track, but GT3 cars and slower take it beautifully for whatever reason. Messing with the [HINT_x] would slow down every single car class, but setting [MAXSPEED_x] to the cornering speed of GT3 cars will slow down only LMPs and hopefully keep them on track too. Example:
On most tracks you will only need to use a [HINT_x] for each corner and thats it. On cursed rollercoaster tracks with lots of elevation changes, you will write a new bible in the notepad before every car can drive it properly.
Last thing to do is test it with various cars. Set different AI races with grids of GT3s, LMPs, F3s, F1s, etc. See if they crash out when racing wheel to wheel, tweak a bit the hints if they do, eventually all or most of them will be able to race the full lap.
Keep in mind some cars are hard to drive for the AI, no matter the track. In some cases this has to do by a bad ai.ini file setting in the car data, which happens even with Kunos cars (the Lamborghini Huracan GT3 and Lotus Exige 240R use way less brake than they should). Some particular cars like the Kunos F2004 or some shady sourced mods are straight impossible for the AI at a decent speed. Modding the cars ai.ini is another chapter for a future pdf I guess. Use the RSS cars for testing F1/2/3s, those are generally pretty good.
Overall you should know that the AI loves flat, hard braking, slow corners and hairpins. It hates full throttle fast flowing sectors with elevation changes and high kerbs. So at first glance you can predict which tracks will be easier to record and make the AI go fast in.
Thats it. It looks like a lot but its actually not. Any feedback is greatly appreciated. Enjoy racing the AI!