AC fast AI Line guide

AC fast AI Line guide 0.1.1

Login or Register an account to download this content
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).

Screenshot_crsh_porsche_gt3_2019_endurance_spa_25-7-122-13-5-5.jpg


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.

1.jpg


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.

2.jpg


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.

3.jpg


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.

4.jpg


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.

5.jpg


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.

6.jpg


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.

7.jpg


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:

[HINT_0]
START=0.1
END=0.067
VALUE=1.086

[HINT_1]
START=0.08
END=0.32
VALUE=1.09

[HINT_2]
START=0.35
END=0.46
VALUE=1.066

[HINT_3]
START=0.47
END=0.58
VALUE=1.078

[HINT_4]
START=0.62
END=0.75
VALUE=1.036

[HINT_5]
START=0.77
END=0.94
VALUE=1.051

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.

8.jpg


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:

[DANGER_0]
START=0.57
END=0.68
LEFT=1.0
RIGHT=1.9

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:

[MAXSPEED_0]
START=0.252
END=0.257
VALUE=250

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!

a.jpg

Latest reviews

The file I´ve got when recording is finished is "pit_lane.ai.candidate" and not "fast_lane.ai.candidate". And I´m not recording the pit lane.
This is nice to read. Thank you very much!
I tried it for 3 hours on varano track with the URD Radical - but no change - AI is not starting or crashes all the time :( ...
But thank you very much for your nice guide :)
Finally an decent guide!
Detailed, well explained, very well presented. Thank you very much, now I have no more excuses
Well done and very helpful guide. Thank you!
Only the hint [DANGER_x] should work vice versa. The higher the value is for the left or right side, the less the ai cars try to overtake on that side. I've used this for several tracks to prevent the ai cars from crashing at chicanes with non moveable tire barriers (e.g. Salzburgring or Körfez track v1.0). And it's very important to start the danger zone early enough, to give the ai cars enough time to pile up before a chicane especially in the first lap of a race.
parrilla
parrilla
You sir are correct! I got that part completely backwards, just updated it, thanks for the heads up!
Premium
Fantastic! Thank you very well put together
Very good overview of how to approach this. I have some slight differences in methodology in regards to how close you can record next to walls but very minor differences. This is how I recorded AI lines for 2022 F1 cars. In my testing, I find that there is no better method for AI other than to record a car/track specific combo. F1 cars drive fundamentally differently to gt cars to street cars. It seems a future feature for CSP will be car specific AI lines so this information is incredibly useful to have out in the community.
parrilla
parrilla
Yes! I initially started recording the lines with an F4 car, then realized high downforce cars take a different line than most other car classes. The CSP feature to select a line file would be game changing for that. With the wall distance, specially on the inside, I found it necessary for racing cars like the Euronascar, TCR and various other touring/classic car mods that have the "steering lookahead" value too high on their data file, probably so they can ride kerbs on normal tracks, but make them try to "cut" corners and hit inside wall on city circuits. Thakns for the feedback!

Latest News

Author
parrilla
Downloads
671
File size
1.4 MB
Views
15,749
First release
Last update
User rating
5.00 star(s) 8 ratings

More mods from parrilla

Shifting method

  • I use whatever the car has in real life*

  • I always use paddleshift

  • I always use sequential

  • I always use H-shifter

  • Something else, please explain


Results are only viewable after voting.
Back
Top