1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Information for Customizing AI drivers in AMS2

Discussion in 'Automobilista 2 - General Discussion' started by gian, Nov 19, 2021.

  1. deadly

    deadly Well-Known Member

    Joined:
    Jul 8, 2016
    Messages:
    1,519
    Likes Received:
    532
    Did several tests with the values for reliability within my custom files and can confirm that they work as expected.
    AI with high values will end the race without any issues, but those with really low ones (0.09 - 0.2) are forced to retire even in a short race (15 minutes) if you set damage to "sync to race" within the game settings. Allows player to portray certain historic races with many retirements quite well.
     
    Last edited: May 6, 2023
    • Agree Agree x 1
    • Informative Informative x 1
  2. Mazdaspeed

    Mazdaspeed Well-Known Member AMS2 Club Member

    Joined:
    Aug 25, 2022
    Messages:
    1,527
    Likes Received:
    781
    Yep, it works great, the only minor complaint I have is that most terminal failures happens towards the end of the race, so you have the last 5 laps or 10 minutes of cars retiring one after the other.

    If they manage to spread the terminal failures more evenly it would be perfect.
     
    • Like Like x 1
    • Agree Agree x 1
  3. deadly

    deadly Well-Known Member

    Joined:
    Jul 8, 2016
    Messages:
    1,519
    Likes Received:
    532
    With extremely low values, I managed to force retirements in early stages of the race.
     
  4. GregzVR

    GregzVR P1 passion, P10 talent.

    Joined:
    Mar 12, 2020
    Messages:
    696
    Likes Received:
    480
    Is it possible to rename the driver names for the McLaren F1 cars, for 1988, 1991, 1990 and 1997, and if so how?
     
  5. john Ellis

    john Ellis The Rectifier of Names AMS2 Club Member

    Joined:
    Mar 18, 2020
    Messages:
    863
    Likes Received:
    1,036
    If you already have any liveryset mods that included their own custom-AI file, you can peek inside one of those and Thanos away anyone you wish and conjure up replacements.

    If you just want to mess around with the default rosters, I suggest you simply download the mod in my signature, open up whichever .xml file you wish to edit in any text editor, and replace whichever names you want. Nobody likes racing against Andres Roch and Roberto Porcelli anyway. The mod's overview page will instruct in how to extract the files into the main AMS2 folder. The only limit is your imagination.

    If you want specific attribute numbers for AI drivers for any of the files, you can use the attached version of my mod, which includes dummy "1" values for all attributes, as a starting point for further editing. Better yet, @jusk has like a billion ready-made realistic AI files that you could use as a base to privately add Jean-Pierre Sarti, Michael Delaney, or Lightning McQueen, if that's more your thing.;)
     

    Attached Files:

    Last edited: May 8, 2023
    • Like Like x 2
    • Friendly Friendly x 1
  6. deadly

    deadly Well-Known Member

    Joined:
    Jul 8, 2016
    Messages:
    1,519
    Likes Received:
    532
    Now I am a bit confused about the reliability values (and I am really bad in math).
    Did a race with the F_V12 (20 minutes). Gave some cars extremely low values (0.00X) and set mechanical failures sync to race. Expected those cars to retire rather early.
    But none of this cars retired, whilst others with values about 1.XX did.
    Any clues?
     
  7. Mazdaspeed

    Mazdaspeed Well-Known Member AMS2 Club Member

    Joined:
    Aug 25, 2022
    Messages:
    1,527
    Likes Received:
    781
    Theres a level of randomness on the failures, so you can have a car with .10 finish a race and one with .50 retire.

    Also the more modern the car class, the higher the reliability window is, so a car with .10 in the F-Vintages will probably retire in every race, but a F-V10 with the same rating can survive some races as they are more reliable.
     
    • Like Like x 1
  8. john Ellis

    john Ellis The Rectifier of Names AMS2 Club Member

    Joined:
    Mar 18, 2020
    Messages:
    863
    Likes Received:
    1,036
    Even a winning strategy loses some of the time....
     
    • Like Like x 1
  9. benvelor

    benvelor Member

    Joined:
    Aug 30, 2020
    Messages:
    91
    Likes Received:
    76
    anyway, AI customization needs adjustment: now, to make a driver go slowly, we need to adjust the racing skill, but a driver with a high racing skill can drive a weak car and vice versa
    for this, I think a parameter like car power is needed
     
  10. EverlastingApex

    EverlastingApex ApexRivals career companion app dev

    Joined:
    Apr 28, 2023
    Messages:
    24
    Likes Received:
    31
    Is there a log I can look at to troubleshoot why some custom grids won't work?

    I made a custom grid for the Copa Fusca in an XML file, as far as I can see everything should work, but it loads about half the drivers I want, and then makes up the rest.

    My XML file is 14 drivers, and I set 14 opponents, single class, and I made sure to pick a car that is not part of the XML file.

    Edit: Nevermind, found the issue, I typed F-Goncalves as the livery name instead of F.Goncalves.
     
    Last edited: May 12, 2023
  11. john Ellis

    john Ellis The Rectifier of Names AMS2 Club Member

    Joined:
    Mar 18, 2020
    Messages:
    863
    Likes Received:
    1,036
    In what will no doubt prove to be one of the most-short-lived mods of all time, here is a set of files that combines AFry's F-Classic Gen 3 (F1 1991) livery set, jusk's expanded F1 1991 custom-AI file & mungopark's MP4/6 skins into a unified F-Classic Gen 4 package. It also incorporates the use of driver suits (no helmets) by k5kelen50 into the conversion. Thanks to jusk for granting permission to use his original Gen 3 file as the basis for the conversion. This F-Classic Gen3-to-Gen4 F11991 conversion is available below:

    Update: This temporary conversion has been removed to make way for the complete, updated 1991 F1 set, available here: [AMS2] F1 1991 Season
     
    Last edited: Jun 5, 2023
    • Like Like x 5
    • Winner Winner x 1
  12. deadly

    deadly Well-Known Member

    Joined:
    Jul 8, 2016
    Messages:
    1,519
    Likes Received:
    532
    Had a race now with V_12 (20 minutes). Failures set to 10x.
    I retired to pits in lap one and watched the race.
    Driver with reliability of 0.001 won the race, whilst another with reliability=1.0 retired. So, values given within the file are rather worthless for this class.

    Edit : Found the clue:
    To force retirements, give the drivers negative values. High values will lead to early retirements.
     
    Last edited: May 14, 2023
  13. john Ellis

    john Ellis The Rectifier of Names AMS2 Club Member

    Joined:
    Mar 18, 2020
    Messages:
    863
    Likes Received:
    1,036
    AMS2 Custom-AI Guide

    The following AMS2 Custom-AI Guide merges the information provided by Reiza with subsequent suggested ranges of custom-AI attributes shared by @jusk, @Romeo Foxtrot, @Mazdaspeed, and other community members.


    Valid custom-AI attribute values range between 0 and 1 (inclusive), except vehicle reliability (see below). All custom-AI parameters are calibrated so that 0.5 is a realistic, average driver's value (1 = a realistic high extreme, and 0 = realistic low extreme). Both 0 and 1 are valid and reasonable for the extremes with the range weighted towards 0.5 (i.e., bell curve). Any missing or invalid values are replaced with the original, default attribute values for that AI driver.


    name: Driver name.

    country: 3-letter ISO country code. This is used for displaying the country flag.

    Note: So-called NAMeS files, which convert Reiza fictional drivers into their real-life counterparts, typically only contain name and country information, and they exhibit Reiza's default AI behavior.


    Custom-AI Skill Attributes

    race_skill: Race session driver skill. It is mapped into a smaller (10%) range based on the "Opponent Skill Level" slider setting. For example, at 90% "Opponent Skill Level” builds a range from 85% to 95% (just example, the exact numbers vary for each vehicle model), so a 1 race skill driver would be 95% skill and a 0 race skill driver would be 85% skill in this example. In other words, the maximum range is approximately +/- 5% from “Opponent Skill Level” setting.

    Suggested race_skill: 0.45 - 0.97 (bring up the lower limit to maybe 0.65/0.70 for closer or spec series)
    Mazdaspeed: 0.40 to 0.99 in my testing .05 difference is worth about .100 to .150 tenths difference, but that amount varies across series.


    qualifying_skill: Same as above, but for practice/qualifying sessions (qualifying_skill is completely independent from the race_skill). Lower qualifying_skill value increases the likelihood of AI programmed mistakes during qualifying hotlaps.

    Suggested qualifying_skill: 0.50 - 0.99 (i.e., make qualifying_skill a little higher than race_skill for all)
    Mazdaspeed: 0.40 - 0.99


    aggression:
    Driver aggression. It is scaled by the "Opponent Aggression" setting:

    >> Low "Opponent Aggression" = a 0 - 1 aggression value is mapped onto a 0.0 - 0.8 range.
    >> Medium "Opponent Aggression" = a 0 - 1 aggression value is mapped onto a 0.2 - 1.0 range.
    >> High "Opponent Aggression" = a 0 - 1 aggression value is mapped into a 0.6 - 1.0 range.
    >> Max "Opponent Aggression" = All drivers have 1.0 aggression.

    Suggested aggression: 0.35 - 0.70
    Mazdaspeed: 0.20 to 0.99


    defending: How much the driver will try to defend his position; also scaled by the "Opponent Aggression" slider setting. One detail is that a lower defending value increases the likelihood of AI programmed mistakes when under pressure.

    Suggested defending: 0.20 - 0.65

    @Romeo Foxtrot suggests offsetting, complementary ranges for aggression (0.5 - 1.0) vs. defending (0 - 0.5) to help encourage overtaking.
    Mazdaspeed: 0.10 to 0.90, but not much difference even with .99 defending, you will not see many drivers blocking,


    stamina: Lower stamina value means the driver is programmed to lose more of his skill during the session; as the driver becomes tired earlier, the likelihood of AI programmed mistakes inevitably increases.

    Suggested stamina: 0.50 - 0.90


    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). The randomness is biased towards not losing too much skill, so there is a higher probability for the drivers to lose few skill than to lose too much skill. It has a per-weekend effect (determined upon loading of a track) and also a per-lap effect (determined every new lap or so). One detail is that a lower consistency value slightly increases the likelihood of AI programmed mistakes during the session.

    Suggested consistency: 0.55 - 0.95

    @Mazdaspeed recommends offsetting, complementary stamina (low; 0.15 - 0.25) vs. consistency (high; 0.75 - 0.85) values for history's hot/cold drivers or to add increased variance to final race results.

    Mazdaspeed: 0.10 to 0.95 I like the extremes in this value, it's the only one that can cause very fast drivers to have an off weekend and change the results a bit. I tend to give slower drivers a higher consistency and fast ones a lower consistency, it's this parameter the one I use for the hot/cold drivers.


    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 green flag (like losing rear grip with some smoke).

    Suggested start_reactions: 0.65 - 0.95


    wet_skill: Controls how much driver will slow down in curves as the track gets wet (lower wet_skill values means he will slow down more), and how likely he will make programmed mistakes related to wetness, like losing grip in puddles or in wet surface (lower wet_skill values increases the likelihood of those mistakes).

    Suggested wet_skills: 0.45 - 0.95
    Mazdaspeed; 0.10 to 0.99, this one was explained very well by Gian in the AI skill thread, I have done some testing, but can't really see much difference between a .70 and a .99 driver, will try with more extreme values later.


    tyre_management: Higher values = less tyre wear and consequently he will be able do keep doing good laptimes for a longer period and pit later due to that). This doesn't change the behavior of the driver (i.e. he won't drive differently to try to save tires), just the tyre wear.

    Suggested tyre_management: 0.65 - 0.95

    fuel_management: For now this parameter works in oval tracks only (but in future it will be extended to all track types); The higher the value, the more the AI will try to save fuel in some strategic situations instead of pushing, like when it sees it can maybe save a pitstop, it will try to stay in draft and coasting instead of overtaking while at the same time trying to not lose much distance to the race leader. It doesn’t mean high value is better than low value, it’s just a characteristic of the driver.

    Suggested fuel_management: 0.35 - 0.65

    blue_flag_conceding: Drivers with high blue_flag_conceding will work harder to concede the position when under blue flag.

    Suggested blue_flag_conceding: 0.85 - 1.0 (1.0, unless the driver is known for holding up leaders)

    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 doesn’t mean 1.0 is better than 0.0, it’s just a characteristic of the driver, not really a skill. Sometimes staying longer on the track with the wrong tyres is better, sometimes it’s worse.

    Suggested weather_tyre_changes: 0.45 - 0.99 (Note: Higher is not necessarily better; higher values will pit sooner when weather changes, lower values will remain out on track longer)



    avoidance_of_mistakes: Drivers with lower avoidance_of_mistakes are more likely to make AI programmed mistakes during the session in general (like understeer, oversteer, recoverable and non-recoverable mistakes).

    Suggested avoidance_of_mistakes: 0.30 - 0.70
    Mazdaspeed: 0.10 to 0.55

    avoidance_of_forced_mistakes: Drivers with 1.0 value for avoidance_of_forced_mistakes won’t have their chances of mistakes increased when under pressure (when defending position). Drivers with lower value for avoidance_of_forced_mistakes will have their chances of mistakes increased when under pressure (compared to their chances of mistakes when not under pressure).

    Suggested avoidance_of_forced_mistakes: 0.20 - 0.65



    vehicle_reliability: In short this is a ratio between the lowest and highest possible reliability for the car/class in question. 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. Note that mean minutes between failures is simply a way to quantify reliability. In the end there can be a lot of variance and if you want someone to last for 60 minutes consistently, better make them much more reliable than that.

    Suggested vehicle_reliability: 0.01 = 1.0 (Note: Utilize the full range (0.00 = 1.0) as this attribute is scaled by series into historically-plausible ranges; vehicle_reliability can have negative numbers as well as numbers greater than 1.0. See Reiza's initial post for more information).
    Mazdaspeed: 0.20 to 0.70



    Updates: Added revised fuel management range based on more recent jusk recommendations. Added Romeo Foxtrot's complementary ranges for aggression (0.5 - 1.0) vs defending (0 - 0.5) and Mazdaspeed's complementary ranges for stamina vs. consistency.

    Added additional ranges for attribute variables suggested by Mazdaspeed.
     
    Last edited: May 7, 2024
    • Like Like x 2
    • Winner Winner x 1
  14. Mazdaspeed

    Mazdaspeed Well-Known Member AMS2 Club Member

    Joined:
    Aug 25, 2022
    Messages:
    1,527
    Likes Received:
    781
    It depends on what the end goal for each class the user is looking for. Do you want close racing? Do you want variations on the race results? Do you want a lot of retirements? That's the great thing about the AI in the game, however it's not perfect.

    Also on spec and evenly matched cars series it's much easier to create good all around AI values without causing other issues.

    Gonna give my example, the car class I am using the most right now is the F-Vintages, while as you say Jusk work is excellent on the file that comes with the 67 skins, the V12 model is way overpowered compared to the V8 in the AI hands, if you leave the file as it is, the V12's will monopolize the top positions on most vintage tracks(they loved them long straights back then), I think only in Interlagos the V8 are faster. So I had to lower the race skill values to .70 and lower to give the V8's a chance on most tracks.

    The issue with lowering them too much though, is that because the race skill values affect the AI cornering speeds, it has the effect of the V8's passing the AI on some corners only to get overtaken again on the straights, or because of their inability and hesitancy to overtake they get stuck behind the slower but more powerful car until it makes a mistake and they can keep this zit-zagging for a whole lot of the race. While I am having a ton of fun racing the AI, it could be much better without those issues.

    If you want some variance on the end results and not have the same drivers finishing in the sameish positions, use very low consistency values(.15 to .25) on fast drivers that where very hot and cold or had mixed results in real life (Reuteman, Alesi & Berger 97, GHill 69, etc) and a high consistency to low skilled drivers, that combined with the reliabilty values gives me some variance on the race results

    Wet skill is an enigma in my case, sometimes it seems to work other times it doesn't, I don't really know how that value works, if it overrides the race skill value when it rains and replaces it.
    So let's say a .50 race driver with a .90 wet value becomes a .90 race while it's wet, I have no Idea. What I have seen is that when it seems to work, it starts when the track is wet or soaked and a couple of laps have passed. Saw it once in Spa when it got wet, Pedro Rodriguez was one of the fastest while in the dry he was 12th.

    Anyhow I enjoy testing the AI as much as driving the game, could keep writing, but I will finish it here, if you need any help just write me up, if I have the time and can help, will do!
     
    • Informative Informative x 2
  15. john Ellis

    john Ellis The Rectifier of Names AMS2 Club Member

    Joined:
    Mar 18, 2020
    Messages:
    863
    Likes Received:
    1,036
    Here are two complete sets of custom-AI files for AMS2 (for the default liveries) that I generated for testing puposes. Feel free to try them out or utterly ignore them. The majority of files have Race skills and Qualifying skills randomly generated between a high of 1 and a low of either (a) 0.764 or (b) 0.618 (i.e., Fibonacci retrace levels) to tighten the race and qualifying ranges compared to the 10% Reiza default. All other attributes are randomly generated from the ranges @jusk provided above (except reliability that I set the minimum at 0.6 for now). The remaining classes (i.e., typically classes without quasi-fictional driver names) had their race and qualifying values ranked by championship standing, but all other attributes were randomized same as above. Obviously, specific drivers (especially in well-known classes) will perform quite differently than they did in reality.

    If anyone finds a preference, if any, for the 2.36% vs. the 3.82% range in race pace, let me know. I'm hoping the randomized variability across all other attributes will offset the tightened range in race pace--but who know....
     

    Attached Files:

    Last edited: May 23, 2023
    • Like Like x 1
  16. jamespoly86

    jamespoly86 Member

    Joined:
    May 28, 2019
    Messages:
    81
    Likes Received:
    21
    Hi all,
    I did some tests with custom AI files formula inter at Interlagos. If two AIs have similar race values and have a gap under 1 second they are attached for all the race because of slipstream effect. If the first AI has a gap up 1 second in the first lap this problem doesn't exist, for example when I tried with 0.99 race value for the first AI and 0.8 for the second. This problem in my opinion is caused from PC2 AI system. The problem is also that the second AI lose 1 second at lap from the front car is difficult to create a good custom AI file. I don't know if can be reduced the slipstream effect between AI.
     
  17. Mazdaspeed

    Mazdaspeed Well-Known Member AMS2 Club Member

    Joined:
    Aug 25, 2022
    Messages:
    1,527
    Likes Received:
    781
    Its more complicated than just the slipstream effect, though that does factor in the issue.

    Only Reiza can truly fix the pack racing and AI overtaking ability. You can mitigate the issue a little bit with low consistency values, but you will always get 2 to 4 pack AI racing each other through the race.
    It would not be an issue if they where like 1 to 2 seconds from each other, you see that on many real life races, the problem is that they seem glued to each other.

    I have seen AI with less race skill have a much better corner entry from the car in front (who is supposed to be faster) like it was coded to stay glued to the car in front and suddenly got super brakes.

    I haven't seen this behavior on PC2, I like the AI in AMS2 more overall but the pack behaviour is definitely not an issue in PC2.
     
    • Agree Agree x 4
  18. SoulMaTriX

    SoulMaTriX New Member

    Joined:
    Oct 31, 2020
    Messages:
    22
    Likes Received:
    0
    I just came across this and by far not an expert and more on the very green side of things. Can these files work on a dedicated server?
     
  19. deadly

    deadly Well-Known Member

    Joined:
    Jul 8, 2016
    Messages:
    1,519
    Likes Received:
    532
    I don't think so. When setting up a mp race with AI, the game loads the liveries each player has in his game, but the drivers have the standard names of the game. So, your liveries are in, but the AI data within the custom file is not.
     
  20. Rollo

    Rollo New Member AMS2 Club Member

    Joined:
    May 31, 2022
    Messages:
    8
    Likes Received:
    13
    I agree that something to determine how much of the cars the AI drivers should be able to use would be interesting. For example formula ultimate gen2, all cars are obviously equal and to simulate a difference in teams pace you have to adjust the AI's skills.

    Something like:
    car_straighline: 1.0
    car_fastcorner: 1.0
    car_slowcorner: 1.0

    Where the AI use the full car (as it is now) at 1.0. With something like this we could simulate some teams being slower in parts of tracks rather than just pick out tracks with certain characteristics and make AI more skillfull on the specific track if we want their car to be more optimum for that track.

    I would love something like this, but I am just thinking out loud.
     
    • Like Like x 2

Share This Page