Modding AMS 2: How to Create and Edit a Custom AI

From here on, our Ultimate Automobilista 2 Modding Guide will make a turn and deal with the aspect of how to actually create mods or at least alter game data. The first area we are going to tackle is the topic of Custom AI.

By using Custom AI files you can inject even more realism and authenticity into Automobilista 2 leading to even more immersion. Because Custom AI files allow the default Reiza driver names, nationalities as well as more than a dozen driving values to be edited and tweaked to your heart's content. You can even set track-specific performances for drivers.

Ultimate-AMS2-Modding-Guide-CustomAI-F1988-1024x460.jpg
Image credit: Brainbug / IMMERSION Modding Group

Admittedly, most of the skin packs now come with pretty good Custom AI files. So in 95 % of the time you may be good to go and will have an accurate drivers' BoP representation of the corresponding class, series, or season. However, sometimes some fine-tuning of an existing Custom AI may be necessary, because you disagree with the existing values or because you want to create your own for a certain series or event.

For instance, in the 1988 F1 season Nigel Mansell had 12 DNFs in 14 races and generally was inferior in his naturally aspired Williams-Judd to the turbos of McLaren and Ferrari, ending up only in 9th in the drivers championship. However, especially at the season-opener at Jacarepagua, in the rain of Silverstone and on the tight Jerez circuit he was very competitive and able to achieve a 2nd place in each of the latter two Grand Prix.

Ultimate-AMS2-Modding-Guide-CustomAI-F1-1988-Mansell-1024x395.jpg

Thus, to accurately set the Custom AI for that class (F-Classic Gen2), there should be two Mansell entries; the first one with rather slightly above average skills and an abysmal "vehicle reliability" value, and a second track-specific with much better values for Jacarepagua and Jerez (in the picture, Silverstone is not included for it being a race in the wet, for which there is a separate driver's value named "wet_skills").

In our Ultimate Automobilista 2 Modding Guide we will show you how to create and edit a Custom AI.

How to Mod AMS 2 and Create a Custom AI: Tools​

To create and edit an XML file you can either use a text editor such as Windows' "Editor" or "Notepad++".

Ultimate-AMS2-Modding-Guide-CustomAI-Notepad-1024x576.jpg

Or you download and use AMS2 Custom Drivers Utility by LuxMundi. This is an open source Java app that allows users to quickly and easily generate new or edit existing Custom AI grids for Automobilista 2.

Ultimate-AMS2-Modding-Guide-CustomAI-Custom-Drivers-Utility-1024x598.png
Image credit: LuxMundi

File Type and Drive Location​

But let us start with the basics and then do it step by step. All Custom AI are .xml (Extensible Markup Language) files and have to be put in the following folder: UserData\CustomAIDrivers\. This folder is located in your Automobilista 2 steam folder which is usually here C:\Program Files (x86)\Steam\steamapps\common\Automobilista 2\UserData\CustomAIDrivers\.

To make a Custom AI XML work, it has to be named exactly like the vehicle class in AMS 2, e.g. "Group C.xml" (without the quotation marks). Below you will find the full list of vehicle class names in Automobilista 2.

ARC_Cam.xml
Carrera Cup.xml
Cat620R.xml
Cat_Academy.xml
Cat_Superlight.xml
Cat_Supersport.xml
CopaClassicB.xml
CopaClassicFL.xml
CopaFusca.xml
CopaTruck.xml
CopaUno.xml
DPI.xml
F-3.xml
F-Classic_Gen1.xml
F-Classic_Gen2.xml
F-Classic_Gen3.xml
F-Classic_Gen4.xml
F-Dirt.xml
F-Junior.xml
F-Inter.xml
F-Hitech_Gen1.xml
F-Hitech_Gen2.xml
F-Reiza.xml
F-Retro_Gen1.xml
F-Retro_Gen2.xml
F-Retro_Gen3.xml
F-Trainer.xml
F-Trainer_A.xml
F-Ultimate.xml
F-Ultimate_Gen2.xml
F-USA_Gen1.xml
F-USA_Gen2.xml
F-USA_Gen3.xml
F-USA_2023.xml
F-V10_Gen1.xml
F-V10_Gen2.xml
F-V12.xml
F-Vee.xml
F-Vintage_Gen1.xml
F-Vintage_Gen2.xml
G40Cup.xml
G55Supercup.xml
GT1.xml
GT3.xml
GT3_Gen2.xml
GT4.xml
GT5.xml
GTE.xml
GTOpen.xml
Group A.xml
Group C.xml
Hot Cars.xml
Hypercars.xml
Kart125cc.xml
KartGX390.xml
KartRental.xml
KartShifter.xml
Kartcross.xml
LancerCup.xml
LMDh.xml
MiniChallenge.xml
Montana.xml
OldStock.xml
Opala79.xml
Opala86.xml
P1.xml
P1Gen2.xml
P2.xml
P3.xml
P4.xml
Procar.xml
RX.xml
SprintRace.xml
StockCar99.xml
StockCarV8.xml
StockCarV8_2020.xml
StockCarV8_2021.xml
StockCarV8_2022.xml
StockCarV8_2023.xml
Street.xml
Supercars.xml
SuperKart.xml
SuperV8.xml
TC60S.xml
TC60S2.xml
TC70S.xml
TSICup.xml

How to Mod AMS 2: Assigning Liveries to Drivers in Custom AI​

For each vehicle class you want to assign AI drivers to, you must create a .xml file. Hence, if, for example, you want to edit the drivers of the Carrera Cup class, you need to create a file named Carrera Cup.xml and put it in your \UserData\CustomAIDrivers\ folder. Tip: Copy an existing file and only edit the changes. Thus you will have the correct syntax from the get-go.

Each driver is assigned to a specific livery, which in the XML is called livery_name. livery_name is the name of the livery as seen in the vehicle selection screen in-game. Hence, In the above example the livery_name "Porsche AG Rothmans #1" is assigned to Jacky Ickx. You can assign drivers to as many liveries as you want.

Creating Driver Personalities​

Apart from name and nationality, there are 15 further parameters for each driver to shape their personality on the track, including race skill, aggression, tyre management, or avoidance of mistakes. As this is the core of a Custom AI, let us have a close look at how that works. Below you will find all skill values and an explanantion of what they do.

name: The driver's name.
country: 3-letter country code. Used for displaying the country flag.
race_skill: Race session driver skill. It is mapped into a smaller range based on the "Opponent Skill Level" slider setting. For example, at 90% "Opponent Skill Level" slider setting, it builds a range from say 85% to 95%. So a 1.0 race skill driver would have 95% race skill and a 0.0 race skill driver would have 85% race skill.
qualifying_skill: Same as above but for practice and qualifying sessions. Completely independent from race_skill. A lower qualifying_skill value increases the likelihood of AI programmed mistakes during qualifying hotlaps.
aggression: Driver aggression. Scaled by the "Opponent Aggression" setting: At Low "Opponent Aggression" setting, the 0.0-1.0 aggression value is mapped into a 0.0-0.8 range.
At Medium "Opponent Aggression" setting, the 0.0-1.0 aggression value is mapped into a 0.2-1.0 range. At High the range is mapped to 0.6-1.0. And at Max all drivers have 1.0 aggression.
defending: Defending determines how much a driver will try to defend his position. Is also scaled by the "Opponent Aggression" slider setting. Lower defending value increase the likelihood of AI programmed mistakes when under pressure.
stamina: Lower stamina value means the driver loses more of his skill during a session, becomes tired earlier, which, in turn, increases the likelihood of AI programmed mistakes.
consistency: Lower consistency value means the driver skill can be randomly reduced more. Basically, the lower the consistency value of a driver, the more skill he can lose from the consistency logic. It has a per-weekend effect (determined upon loading of a track) and also a per-lap effect (determined every new lap or so). A lower consistency value slightly increases the likelihood of AI programmed mistakes during the session.
start_reactions: Lower start_reactions value means the driver will take more time to react to the race green flag and is more likely to make race start programmed mistakes at the moment of the race green flag such as losing rear grip with some smoke.
wet_skill: Wet skill determines how good a driver is on a wet track. This value determines how much he will slow down in corners as the track gets wet, and how likely he will make programmed mistakes related to wetness, like losing grip in puddles or on wet surface. While, for example, drivers with 1.0 wet skill only go 10% slower on a fully wet corner compared to their speed in dry conditions, drivers with 0.0 wet skill go 20% slower. The actual percentage varies per class.
tyre_management: This value determines how good a driver is in preventing tyre wear. Higher values mean he will have less tyre wear and consequently is able do keep his pace for a longer period and eventually pit later.
fuel_management: The higher the value, the more the AI will try to save fuel in some strategic situations instead of pushing. When for example it sees it can maybe save a pitstop, it will try to stay in draft and coast instead of overtaking while at the same time try to not lose much distance to the race leader. It doesnt mean high value is better than low value, its just a characteristic of the driver.
blue_flag_conceding: Drivers with high blue_flag_conceding work harder to make way when under blue flag or getting lapped.
weather_tyre_changes: Drivers with high weather_tyre_changes are more likely to make pitstops for changing tyres when the track wetness state changes. It does not mean 1.0 is better than 0.0, it is just a characteristic of the driver. Sometimes staying longer on the track with the "wrong" tyres is better, sometimes its worse.
avoidance_of_mistakes: Drivers with lower avoidance_of_mistakes value are more likely to make AI programmed mistakes during the session in general which can results in understeer, oversteer, recoverable and non-recoverable mistakes.
avoidance_of_forced_mistakes: Drivers with 1.0 value for avoidance_of_forced_mistakes do not have their chances of mistakes increased when under pressure and defending their position. Drivers with lower value for avoidance_of_forced_mistakes instead will have increased chances of mistakes when under pressure compared to their chances of mistakes when not under pressure.
vehicle_reliability: In short this is a ratio between the lowest and highest possible reliability for the car/class in question. More on that below.

How to Mod AMS 2: Values Range and Logic in Custom AI​

When creating a Custom AI and defining values, you should know and note the following:
  • The valid personality values range is between 0 and 1 (inclusive). One exception is the vehicle_reliability parameter which is explained further below.
  • For even further fine-tuning, you can set up to 3 digits after the dot, like 0.001, 0.537 or 0.999.
  • All AI personality parameters are calibrated so that 0.5 is an realistic-ish average driver's value. 1 is mapped to be a realistic-ish high extreme, and 0 is mapped to be realistic-ish low extreme.
  • Always test the values of your Custom AI drivers values to see if they are matching the result you would expect, and adjust it accordingly for your custom sets. For instance, when replicating a series like F1 1988, take a look at the real (qualification) lap times of all drivers and then set the (qualification) skills for every driver accordingly to match the real gaps (which were sometimes six or more seconds between the pole-sitter and the last driver on the grid).
  • The game always prioritizes Custom AI entries over default values. Thus, if a Custom AI consists of say 26 drivers but you race with a 32-cars grid, all 26 Custom AI drivers will be in there. On the other hand, any missing or invalid values are replaced with the original (default) values of the AI driver that would be picked for that car in that event.
Ultimate-AMS2-Modding-Guide-CustomAI-Custom-Manual-Grid-1024x507.jpg

A Strange Beast: Vehicle Reliability​

Vehicle reliability is a special, more complicated beast. To tame it and get it to work, you will need to be aware of the reliability range Reiza has set for each class as well as understand the term "mean minutes". Mean minutes defines the minimum and maximum range between possible failures measured in minutes. Consequently, you will need to do some math to turn it into the final reliability for a driver in the class in question. Maybe time from some spreadsheet acrobatics?

Very Low (5-400):
  • Copa Truck
  • F-Junior
  • Group A
  • Karting 125CC, GX390, Rental, Shifter & Super Kart
  • M1 Procar
  • Vintage Touring Cars T2

Low (25-700):
  • F-Vintage Gen 1-2
  • F-Retro Gen 1-3
  • F-Classic Gen 1-4
  • F-HiTech Gen1-2

Medium (50-1000):
  • Aussie Racing Camaro
  • Caterham 620R, Academy, Superlight & Supersport
  • Copa Classic B & FL
  • Copa Fusca
  • Copa Uno
  • F-3
  • F-Dirt
  • F-Inter
  • F-USA Gen 1 & Gen3
  • F-V12
  • F-Vee
  • Ginetta G40 Cup
  • GT5
  • Hot Cars
  • Kart Cross
  • Lancer Cup
  • Old Stock Race
  • P2, P3 & P4
  • RX
  • Sprint Race
  • Stock Car Brasil 1979, 1986 & 1999
  • Street Cars (Chevrolet Camaro SS)
  • Vintage Touring Cars T1

High (100-1500):
  • F-V10 Gen 1-2
  • F-USA Gen 2
  • Group C
  • GT Classic

Very High (300-2000):
  • Copa Montana
  • DPi
  • F-Reiza
  • F-Ultimate Gen 1-2
  • F-USA Gen 4
  • Ginetta G55 Supercup
  • GT1
  • GT3 Gen1-2
  • GT4
  • GTE
  • GT Open
  • LMDh
  • P1 Gen1-2
  • Porsche Cup
  • Stock Car Brasil 2019-2023
  • Street Cars - Hyper & Super
  • Super V8
For realistic reliability values, now first gather the minimum (y) and maximum (z) mean minutes between failures for the class you are working on (see above). Then consider your driver/team target mean minutes between failures (x) that you have derived from some real race statistics applying this formula:

sqrt((x-y) / (z-y))

Example: For the F-Classic Gen2 class there is a minimum of 25 mins and maximum of 700 mins. Now if our target for Nigel Mansell is 50 mins between failures, the term will look like this:

(50-25) / (700-25) = 0.037

Thus the vehicle reliability for Mansell is 0.037, which in the Custom AI reads like this:

<vehicle_reliability>0.037</vehicle_reliability>

Alternatively, if you wish to just set a reliability and see what happens, know that values above 0.6 are generally better for each class - relative to how reliable or unreliable the class should be. But for maximum chaos you can of course give low reliabilities a try.

If you wish to go below 0.0 or above 1.0, that can be done too. But know that if you go negative, the formula changes to this:

-((y/x)-1)

Please note that when negative, vehicle reliability is used as a divider for the minimum mean time!


Note that mean minutes between failures is simply a way to quantify reliability. In the end there can be a lot of variance and generally speaking if you want someone to last for 60 minutes consistently, better make them much more reliable than that.

Modding AMS 2 Custom AI: Tips, Limitations and Intricacies​

To round off this chapter of our Ultimate Automobilista 2 Modding Guide, we would like to point out some limitations as well as give you some tips to make your life easier when creating or editing a Custom AI.

Ultimate-AMS2-Modding-Guide-CustomAI-Custom-F1-1988-Grid-1024x592.jpg

An accurate Custom AI is characterized by the fact that it corresponds to reality in absolute terms as well as in terms of relationships and dependencies. Thus, using our above example of the 1988 F1 season, this means that Senna and Prost are generally the fastest and have the most reliable cars. Accordingly, their values for qualification skill, race skill and vehicle reliability should be the highest. At the other end of the scale should be drivers like Bernd Schneider and Piercarlo Ghinzani. While everyone else in between.

AMS 2 Gameplay Settings
General gameplay setting always override specific Custom AI settings.

Tips for creating the perfect Custom AI
  • Detailed statistics of real races and seasons are an immense, indispensable help in finding accurate data and values. Search for instance Wikipedia or dedicated motorsports sites for useful data.
  • General gameplay settings always override a custom AI. Thus, the selected Opponent Skill Level and the multipliers for for instance tyre wear or fuel comsumption significantly influence the absolute performance level of the AI drivers. We therefore recommend setting the Custom AI so that it delivers the best results with authentic settings and (depending on the class) an opponent skill level between 100 and 110.
  • Test, test, test: The best way to do this, of course, is to cover real race distances. However, as this is very time-consuming, there is also the option of pausing the respective session (practice, quali, race) and selecting "Skip to End". This simulates the session. The result may not be as meaningful as if you had driven it in real time, but it still gives you a good indication of the general pace, failure rates, etc.
  • The difference in pace between qualifying and the race is smaller with the AI in AMS 2 than in reality. Caution is therefore advised, especially in the historic classes, as the AI is almost as fast with a full tank of fuel as it was before in an almost empty car, while the player has to contend with all the disadvantages of a heavier car and cold tires. This can be a fun killer, especially in time-accelerated races. To remedy this, you could set the race skill for all drivers slightly lower by for instance 0.2 or 0.3.

Further Helpful Resources​