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,512
    Likes Received:
    532
    The alpha-3 code. Every country has a 3 letter code.
    Germany=DEU
    Great Britain=GBR
    Netherlands=NLD
    Brazil=BRA
    and so on...

    ISO 3166-1 alpha-3 - Wikipedia


    So, for a brazilian driver, it must look like this:
    <country>BRA</country>
     
    Last edited: Dec 13, 2021
    • Informative Informative x 2
  2. deadly

    deadly Well-Known Member

    Joined:
    Jul 8, 2016
    Messages:
    1,512
    Likes Received:
    532
    If there are cars within a class which are much faster than the others, you have to consider that within your custom file.
    Example: If your best driver has skill "1.0" (the maximum), but is not driving the best car, he might be beaten or at least equaled by a driver with skill "0.9", but sitting in the best car by far.
    In the end, it is a try and error thing. Create your file, load a race weekend, stay in the pits and watch the action on the monitor. If you are not pleased with the results, you gotta change the values in your file.

    Edit: I have created a file for Formula Retro Gen2, there I gave Andretti in the Lotus79 the best values. Lauda could easily keep up with him with values about 87, because his Brabham BT46B is so freaking fast. So, I had to lower his skills even more to keep Andretti in front of him.
     
    Last edited: Dec 13, 2021
    • Informative Informative x 1
  3. DaVeX

    DaVeX AMSUnofficial Staff AMS2 Club Member

    Joined:
    Mar 8, 2016
    Messages:
    1,994
    Likes Received:
    1,057
    This is a good idea to tame the McLaren GT3...
     
    • Agree Agree x 1
  4. deadly

    deadly Well-Known Member

    Joined:
    Jul 8, 2016
    Messages:
    1,512
    Likes Received:
    532
    I only did files for open wheelers so far, because I drive them about 90% of my time in AMS2.
    But you of course tame the AI, also the fast cars, when trying to portray a certain season and the gaps in laptimes, which were pretty huge in some years. So, if you then want to have closer racing with backmarkers, you gotta increase the opponent strength ingame.
     
  5. hollow88

    hollow88 New Member

    Joined:
    Dec 13, 2021
    Messages:
    4
    Likes Received:
    0
    There's probably an issue with my game. All A.I. drivers' flags were Brazil even before I tried to override them.
     
  6. deadly

    deadly Well-Known Member

    Joined:
    Jul 8, 2016
    Messages:
    1,512
    Likes Received:
    532
    No. Everything is ok with your game. When you do not edit country flags in your custom file, all drivers are Brasilians. ;)
     
    • Agree Agree x 1
  7. br1x92

    br1x92 Active Member

    Joined:
    Aug 1, 2021
    Messages:
    327
    Likes Received:
    146
    There must be a bug then, I mapped my custom AI for the Porsche 911 GT1 in a range of 0.88 to 1.00, so the strongest driver (if we use 90 AI strength as an example) would be 95, the weakest should be 93.8 (or close to that), but the result in laptimes is an average of about 1.5 seconds. That can't be the difference from 95 to 93.8, can it?
    And that is how it looks for the other GT1 cars as well. Defenitely something off there.
     
    Last edited: Dec 15, 2021
    • Informative Informative x 2
  8. Romeo Foxtrot

    Romeo Foxtrot Active Member AMS2 Club Member

    Joined:
    Apr 10, 2020
    Messages:
    165
    Likes Received:
    69
    I don't think anything is off there because I can't reproduce the 1.5 seconds gap unless the cars are being baulked by slower drivers. The gap at Monza '71 and Brasilia was quite tight. The gap at the Nords (4.7 seconds) was caused by baulking. The AI in the GT1 class have the overtaking skills of a suitcase in a baggage carousel.

    I would ignore the added complication of plus or minus 5%. The fastest the AI are going to go is setting up a driver with a <qualifying_skill> set to 1.0. The slowest driver, in practise or qualifying, is going the have a smaller <qualifying_skill>. All other attribute values have little to no effect in practise or qualifying so you can leave them at 1.0, 0.0 or anything in-between and they won't have any impact on lap time (on a clear run).

    The fastest AI drivers should match and sometimes beat your 1.0 drivers (this is the random element). The slowest drivers will have a value around 0.9 (GT1), 0.8 (Sprint Race) or just below 0.5 (2021 Stock car). You can then tighten the field for tin tops, spread it out for open wheelers or just suit it to your own tastes then set the other attributes for races beyond twenty minutes or so (I've seen no tangible difference in shorter races though the Stock Cars are the only ones I've found worth racing for that sort of length).
     
    • Informative Informative x 1
  9. br1x92

    br1x92 Active Member

    Joined:
    Aug 1, 2021
    Messages:
    327
    Likes Received:
    146
    I am using qualifying times for this example. I did test runs with fields from 2-22, in the case of 2 just the slowest and fastest driver, laptime difference at 95 AI strength from 1.00 qualifying skill to 0.88 qualifying skill was around 1.5 seconds on most tracks, the longer the lap, the bigger the difference ofc (bar random occasions where the slowest driver had slipstream all lap or the fastest driver was stuck behind a slower one).

    And I did many, maaaaaany test runs for this. I mainly used Nürburgring GP, Kansai GP and Laguna Seca btw.

    And yes, AI overtaking in GT1 is horrendous.
     
    • Informative Informative x 2
  10. god666

    god666 New Member

    Joined:
    Feb 4, 2021
    Messages:
    11
    Likes Received:
    1
    This is my dream come true! Thank you Reiza!!!
     
    • Friendly Friendly x 1
  11. Harry H

    Harry H Active Member AMS2 Club Member

    Joined:
    Mar 25, 2020
    Messages:
    232
    Likes Received:
    193
    @gian I think there's a minor issue with the liveries for the Porsche Cup Car: Both the 3.8L and the 4L models share a common livery - Porsche Racing #911. Since these are both in the same vehicle class, it's impossible to have 2 different drivers...?

    On a related note, would it be possible for you to provide a list somewhere of any updates /additions / changes to livery names that happen going forward?

    Thanks
     
    • Agree Agree x 1
    • Informative Informative x 1
  12. eSTee3

    eSTee3 Active Member AMS2 Club Member

    Joined:
    Mar 17, 2020
    Messages:
    123
    Likes Received:
    69
    Another update to my AI Creation Tool complete! Thanks again, to @Harry H for some great partnership and ideas! New changes and features include:
    • Removed auto-randomization formulas for AI proficiencies
    • Added new menu item (AI Proficiencies) that can be used, to fill or "re-roll" all AI proficiencies
    • Re-worked xml creation formulas to rely on the driver's name only, allowing end users to pre-fill rosters and remove individual drivers before creating an xml, simply by deleting any driver's name.
    For anyone interested in the google script I google-foo-ed together, here ya go:

    Code:
    function numbers19() {
      var sheet = SpreadsheetApp.getActiveSheet();
      var range = sheet.getRange("H3:R");
      for (var x = 1; x <= range.getWidth(); x++) {
        for (var y = 1; y <= range.getHeight(); y++) {
          var number = Math.random();
          range.getCell(y, x).setValue(number);
        }
      }
    };
    
    function onOpen() {
      var sheet = SpreadsheetApp.getActiveSpreadsheet();
      var entries = [{
        name : "Randomize!",
        functionName : "numbers19"
      }];
      sheet.addMenu("AI Proficiencies", entries);
    };
     
    • Like Like x 4
    • Friendly Friendly x 1
  13. Harry H

    Harry H Active Member AMS2 Club Member

    Joined:
    Mar 25, 2020
    Messages:
    232
    Likes Received:
    193
    Awesome work. This is such a great tool and really easy to use. The first time you run the AI Proficiencies Google asks a bunch of questions about whether you're ok 'trusting the script'. Can I assume you're not going to be messing with all my other google spreadsheets? :)
     
  14. eSTee3

    eSTee3 Active Member AMS2 Club Member

    Joined:
    Mar 17, 2020
    Messages:
    123
    Likes Received:
    69
    Ha, yep, definitely won't do anything to other google docs. That's one of the reasons I added the actual script, in case anyone was concerned. I'm definitely suspect about anything like that, though, so I definitely don't blame ya for asking (seriously or jokingly) :)
     
  15. Harry H

    Harry H Active Member AMS2 Club Member

    Joined:
    Mar 25, 2020
    Messages:
    232
    Likes Received:
    193
    I trust you :)
     
    • Friendly Friendly x 1
  16. Pales

    Pales Member

    Joined:
    Jun 6, 2021
    Messages:
    57
    Likes Received:
    25
    Thoughts?

     
  17. deadly

    deadly Well-Known Member

    Joined:
    Jul 8, 2016
    Messages:
    1,512
    Likes Received:
    532
    The AI's passing behaviour towards each others is poor. The car coming from the outside always forces it's way through, while they driver who has the inside line and is already in front tends to step back. They do not know how to use slipstream, too.
    Those are general issues of the game itself, AI files do not help much. Only on some tracks like Monza or Kyalami 76 the fast cars dare to overtake.
     
    • Agree Agree x 4
  18. Harry H

    Harry H Active Member AMS2 Club Member

    Joined:
    Mar 25, 2020
    Messages:
    232
    Likes Received:
    193
    At least some of the AI parameters have an effect, speed being the most obvious. Concentration also has an effect (probably the occasional and temporary change to the speed value), as you can see a given AI have a slower than normal lap now and then. So, no, not a waste of time, at least in my experience. I'm having much more enjoyable tussles with the AI using completely random parameters (eSTee3's tool is fantastic for that) than I was with the stock AI, and wider variations in lap times. I set the overall strength at 100 and aggression at 50.

    As for general AI behavior, it's a very complicated landscape: so many track / car combos that ideally would have additional hand-coding to get realistic racing behavior, mostly to address track-specific issues of when to attempt a pass and when to defend, and how to adjust from the normal driving line for both those situations. Right now some track / car combos seem to provide more exciting / enjoyable AI racing than others.
     
  19. deadly

    deadly Well-Known Member

    Joined:
    Jul 8, 2016
    Messages:
    1,512
    Likes Received:
    532
    A car with race skill "1.0" can not even overtake a slow one with "0.1" when going from start/finish up to Tosa on Imola 88.
     
    • Agree Agree x 3
    • Funny Funny x 1
  20. Harry H

    Harry H Active Member AMS2 Club Member

    Joined:
    Mar 25, 2020
    Messages:
    232
    Likes Received:
    193
    I have not tried every single car / track combo. I don't doubt you. As I said, so many different combos, likely every one of them needing some degree of hand coding.
     

Share This Page