Information for Customizing AI drivers in AMS2

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

  1. Romeo Foxtrot

    Romeo Foxtrot Active Member AMS2 Club Member

    Joined:
    Apr 10, 2020
    Messages:
    166
    Likes Received:
    69
    I thought you were quick off the mark! :)

    Here's the Excel spreadsheet for my way of doing these. It's been checked for all the changed classes mentioned in the Changelog (and most others as well but I've found no other changes so far).

    It's updated for the new skins and livery_name changes in the Copa Classics (B and FL), the Lola 95 (F-USA Gen 1), Opala (79 and 86), P2, Stock Car Omega, Stock Car 2020 and 2021 as well as the two new classes F-Ultima Gen 2 and Stock Car 2022.

    I'm also including a text file (comma separated values) for all the livery_names for those that want to hand craft their AI names rather than use a spreadsheet.
    It also includes the names with underscores for spaces although there's only two drivers now with trailing spaces in their names though there's still that double space in Opala 86, Marcos Gracia #67.
     

    Attached Files:

    • Like Like x 5
    • Friendly Friendly x 1
  2. Harry H

    Harry H Active Member AMS2 Club Member

    Joined:
    Mar 25, 2020
    Messages:
    237
    Likes Received:
    197
    Glad you like it!
     
  3. gian

    gian Administrator Staff Member AMS2 Club Member

    Joined:
    Mar 16, 2020
    Messages:
    95
    Likes Received:
    128
    No. Even a driver with 1.0 for avoidance_of_mistakes may eventually make a programmed mistake (just much more rare), as explained there are a lot more factors into mistakes than just the avoidance_of_mistakes value.

    All AI personality parameters are calibrated so that 0.5 is a realistic-ish average driver's value, 1.0 is mapped to a realistic-ish high extreme, and 0.0 is mapped to a realistic-ish low extreme. Its a sane range so 0 and 1 are valid and reasonable for the extremes though you would expect the spread to be weighted towards 0.5. Bell curve stuff.

    Thats the expectation, but of course 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.
     
    • Informative Informative x 4
  4. br1x92

    br1x92 Active Member

    Joined:
    Aug 1, 2021
    Messages:
    329
    Likes Received:
    146
    That is another fantastic addition to the AI.

    Though right now I am waiting for a BoP and AI pass update to the GT1 class before I make myself a lot of work that gets obsolete soon, I expect that with the arrival of the Nissan R390 GT1.

    So without giving a timeframe or anything, is that a realistic expectation?
     
    • Like Like x 1
  5. deadly

    deadly Well-Known Member

    Joined:
    Jul 8, 2016
    Messages:
    1,519
    Likes Received:
    532
    Workaround to avoid double liveries in classes where this bug occurs (like Formula_V12, Formula V10_Gen2).

    1. Before starting the game, decide which car you want to drive.
    2. Open the Custom AI file for this class of cars and delete the entry for car/driver you want to to choose in race (make a backup of the original file before!!).
    When starting a race with this car now, no oppenent will have same car as player.

    3. When race is done and you quit the game, copy/paste the original file back to the game directory.

    Strange thing: This workaround works with F_V12, but not with Formula V10 Gen2.
     
    Last edited: Apr 12, 2022
  6. F1Aussie

    F1Aussie Well-Known Member AMS2 Club Member

    Joined:
    Mar 21, 2016
    Messages:
    2,423
    Likes Received:
    673
    I don't recall seeing all that in the patch notes, where did you get it from? It is great news regardless
     
  7. Rober

    Rober Member

    Joined:
    Jul 7, 2020
    Messages:
    56
    Likes Received:
    72
    Because he is the developer who did it ;)
     
    • Agree Agree x 2
    • Funny Funny x 1
  8. F1Aussie

    F1Aussie Well-Known Member AMS2 Club Member

    Joined:
    Mar 21, 2016
    Messages:
    2,423
    Likes Received:
    673
    Oh right, lol
     
    • Funny Funny x 2
  9. sampopel

    sampopel Active Member AMS2 Club Member

    Joined:
    Mar 31, 2020
    Messages:
    339
    Likes Received:
    150
    Really enjoying these new parameters, which makes me think, do you think it's possible that likelihood of random mechanical failures could be added as a custom AI parameter?

    I don't know if random mechanical failures already exist in the game for the AI but if so, having that as a parameter that can be individually assigned to effectively every car in the game would be awesome.
     
    • Agree Agree x 4
  10. jusk

    jusk Well-Known Member AMS2 Club Member

    Joined:
    Jan 13, 2022
    Messages:
    234
    Likes Received:
    376
    Agree - would be a fantastic addition to be able to assign that individually, particularly when it comes to historic series where mechanical failures were so much more common than they are now. There is provision for mechanical failures in the game already I think (it's in the options menu), but I don't know to what extent (if any) it has been implemented.

    Also - if we could tweak (i.e. scale) car performance on a per driver basis it would really open it up. The custom AI so far is effectively trying to summarise car and driver capability into the available driver's attributes, whereas obviously the two things are quite separate.
     
    • Like Like x 3
  11. Apex

    Apex Active Member

    Joined:
    Sep 22, 2020
    Messages:
    303
    Likes Received:
    186
    Well, I suppose we can pretty much tick this one off the list. Well done, Reiza!

    :cool:
     
    • Like Like x 2
  12. jusk

    jusk Well-Known Member AMS2 Club Member

    Joined:
    Jan 13, 2022
    Messages:
    234
    Likes Received:
    376
    It occurred to me that the specific track override feature (outlined in the OP) might be of use for recreating historic seasons where teams ran different drivers in different races, as was not uncommon (an obvious example being Jordan in 1991 F1).

    I thought maybe I could add an override for e.g. Spa, which would effectively change all of Bertrand Gachot's attributes (including the name and nationality), effectively replacing him with Michael Schumacher for Spa only, then Moreno for Monza/Estoril, Zanardi for Suzuka/Adelaide, etc.

    But, I tested it, and it doesn't seem to work. So - does anyone know if/why this is not possible, or am I perhaps just doing something wrong?
     
  13. Romeo Foxtrot

    Romeo Foxtrot Active Member AMS2 Club Member

    Joined:
    Apr 10, 2020
    Messages:
    166
    Likes Received:
    69
    I think you're doing something wrong, jusk.

    This file shows the system works. Drive a VT60s Mini, choose same class, 4 opponents and drive at Monza Jr and Oulton Foster's. At Monza "The Master" (#47) gives a lesson but at Foster's "A Newbie" (also #47) gets a pasting.

    If you can't find what's wrong post your xml file and I'll have a look at it.
     

    Attached Files:

    • Informative Informative x 2
  14. jusk

    jusk Well-Known Member AMS2 Club Member

    Joined:
    Jan 13, 2022
    Messages:
    234
    Likes Received:
    376
    Thanks so much - that is super helpful! I will have a closer look at my xml to see if I have typos or something and if I can't figure out I'll take you up on that offer :)

    Edit: Ok, I think I need a second pair of eyes on this - just can't find the issue, though it must surely be something obvious:
    Code:
     <driver livery_name="Project Indy #64">
      <name>Christian Danner</name>
      <country>DEU</country>
      <race_skill>0.76</race_skill>
      <qualifying_skill>0.68</qualifying_skill>
      <aggression>0.50</aggression>
      <defending>0.74</defending>
      <stamina>0.80</stamina>
      <consistency>0.68</consistency>
      <start_reactions>0.69</start_reactions>
      <wet_skills>0.71</wet_skills>
      <tyre_management>0.70</tyre_management>
      <blue_flag_conceding>0.75</blue_flag_conceding>
      <weather_tyre_changes>0.70</weather_tyre_changes>
      <avoidance_of_mistakes>0.61</avoidance_of_mistakes>
      <avoidance_of_forced_mistakes>0.62</avoidance_of_forced_mistakes>
    </driver>
    <driver livery_name="Project Indy #64" tracks="Cleveland_GP">
      <name>Hubert Stromberger</name>
      <country>AUT</country>
      <race_skill>0.70</race_skill>
      <qualifying_skill>0.62</qualifying_skill>
    </driver>
    <driver livery_name="Project Indy #64" tracks="Long_Beach">
      <name>Franck Fréon</name>
      <country>FRA</country>
      <race_skill>0.71</race_skill>
      <qualifying_skill>0.63</qualifying_skill>
    </driver>
    With the above, it's always just Danner - overrides not appearing. I've tried stripping it back to just the names with race & quali skill, just one override, using Fosters like the example, etc - but I'm obviously missing something.
     
    Last edited: Apr 15, 2022
  15. Romeo Foxtrot

    Romeo Foxtrot Active Member AMS2 Club Member

    Joined:
    Apr 10, 2020
    Messages:
    166
    Likes Received:
    69
    I don't have a livery_name of "Project Indy #64" but I plugged your text into my TC60S2 file, changed the livery_name to "Lotus 23 #47" and it worked fine. I got Danner at most tracks, Stromberg at Cleveland and Fréon at Long Beach.

    Since the text in the file is working, livery_name aside, the issue is either the name of the xml file for the class or the chassis livery_name. Try using the data in a class that uses default livery_names.

    I only use default livery_names for simplicity. When I download paint jobs I edit the texture override files and assign the dds files to the ID I want them used for.

    You might try that for just this one car while you're investigating. It's one more thing to eliminate.

    ETA Since you got Danner's name appearing the chassis livery_name looks good. I would now turn to the xml filename and the location of the one you edited. Perhaps you saved yours to the wrong directory and the previous one is still there and working?
     
    Last edited: Apr 15, 2022
    • Useful Useful x 1
  16. jusk

    jusk Well-Known Member AMS2 Club Member

    Joined:
    Jan 13, 2022
    Messages:
    234
    Likes Received:
    376
    Thanks again for helping - that's a bit of a head scratcher - but great to know that it works in theory. I'll have time to do some more testing with it later, but it seems odd to me that the livery_name is picked up fine for my 'base' driver (i.e. Danner), but does not work for the overrides.
     
  17. Romeo Foxtrot

    Romeo Foxtrot Active Member AMS2 Club Member

    Joined:
    Apr 10, 2020
    Messages:
    166
    Likes Received:
    69
    My next step would be to check you're editing the right xml file, perhaps by renaming it with a preceding underscore rather than deleting it, and make sure the default drivers show up again after a restart.
    When you know you're editing the right file paste the text you posted earlier to the end of the file (just before the </custom_ai_drivers> line). That way the original lines are overwritten without being deleted. Then try again.
     
    • Like Like x 1
  18. jusk

    jusk Well-Known Member AMS2 Club Member

    Joined:
    Jan 13, 2022
    Messages:
    234
    Likes Received:
    376
    I don't mean to clog up this thread - but yes it's definitely the right xml file. Even more weirdly, I've now got it working properly for another livery within the same file, but still can't get the #64 car mentioned above (or one other example) to work o_O.
     
  19. Romeo Foxtrot

    Romeo Foxtrot Active Member AMS2 Club Member

    Joined:
    Apr 10, 2020
    Messages:
    166
    Likes Received:
    69
    I downloaded the car set and I have it working fine now for the Reynards and 15 opponents. I can choose to drive a Lola and I still get Fréon at Long Beach but as soon as I add a Lola driver to the custom AI, and I've tried several of them, I get Danner back.

    So, no solution yet and I'm unable to investigate further before Tuesday.
     
    • Like Like x 1
  20. jusk

    jusk Well-Known Member AMS2 Club Member

    Joined:
    Jan 13, 2022
    Messages:
    234
    Likes Received:
    376
    Thanks for going to all that trouble - it is good to know that someone else has replicated the issue at least! Could it be a bug of some sort I wonder, or maybe something slightly different in the naming convention of the Lola liveries?

    I will see if I can narrow it down any further - but thanks again for your help.
     

Share This Page