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 V1.3

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

  1. deadly

    deadly Well-Known Member

    Joined:
    Jul 8, 2016
    Messages:
    1,465
    Likes Received:
    505
    The new values
    <avoidance_of_mistakes>x.x</avoidance_of_mistakes> <avoidance_of_forced_mistakes>x.x</avoidance_of_forced_mistakes>
    do not have any noticeable effect. Even with very low values and low stamina/consistency, the AI does not make mistakes. They are just slow whilst blocking other cars.

    Another thing: Fast modern F1 cars with DRS can not overtake the ones with low values on most of the tracks. They close the gap quite soon, but then, instead of having an overtake, they just ram slow car in front and close their DRS by doing so.
    Has to do with this general issue of the game: AI has no idea how to outbreak a slow opponent on the inside before corners as they all stick to the ideal racing line and tend to form huge trains.
     
    • Informative Informative x 1
  2. sampopel

    sampopel Active Member AMS2 Club Member

    Joined:
    Mar 31, 2020
    Messages:
    315
    Likes Received:
    145
    In terms of AI errors, it possibly depends upon which cars you drive. I've seen many errors from things like the Brazilian Stock Cars, both forced and unforced.

    I often check the replays of races to see what the AI have been up to and there are plentiful minor errors, the most common being losing back end slightly when on throttle coming out of corners, costing them maybe 0.5-1 second. I've also seen numerous full-blown spins and a few offs. I've seen this happen when it's clearly a reaction to pressure from behind (forced), and have also seen it happen when no-one else is near them (unforced).

    That said, all the AI errors I've seen (other than AI crashing into each other) have been through them losing the rear-end. I don't recall seeing them take a corner too fast and go wide/off track, nor miss a braking point and overshoot. And I've only seen errors from RWD cars - I've yet to see a clear error from a FWD/4WD car, eg. I've never noticed any errors from the Copa Unos. I'd be interested to hear from others if they have and what type of errors they were.

    I generally don't race the open-wheelers, so no idea about them.

    Has anyone ever seen the AI pit or retire through mechanical failures (ie. not as a result of crashing into each other)?
     
    • Informative Informative x 1
  3. br1x92

    br1x92 Active Member

    Joined:
    Aug 1, 2021
    Messages:
    304
    Likes Received:
    123
    Overtaking is still horrible in a lot of cars, no doubt about it.

    But I definetly saw quite a noticeable amount of mistakes by the AI, and to a larger degree with lower avoidance values in GT1 cars.
     
  4. deadly

    deadly Well-Known Member

    Joined:
    Jul 8, 2016
    Messages:
    1,465
    Likes Received:
    505
    I race open wheelers most of the time and AI behaviour towards each others there is a mess.
     
    Last edited: May 8, 2022
  5. Tarmac Terrorist

    Tarmac Terrorist Well-Known Member AMS2 Club Member

    Joined:
    Apr 16, 2020
    Messages:
    1,666
    Likes Received:
    1,238
    I absoloutely would, not only on editing values but on A.I. hardcoded characteristics from car to car and track to track. For instance there are now some car class'es that even at 120 Skill are just so slow theres not much point in racing them, however im sure this will be addressed soon enough and could be put down to re-calibration of the A.I. after introduction of the new tire model having a knock on effect to the way A.I. handle them. I'd love to start work on a video today, but i've got a music event to run so it will have to be during the week.
     
    • Like Like x 1
  6. jusk

    jusk Well-Known Member AMS2 Club Member

    Joined:
    Jan 13, 2022
    Messages:
    218
    Likes Received:
    339
    To add to the above - here's my (rather long) two cents on the current state of the AI and the mistakes values, etc - based on what I have observed in putting together custom AI files for F-Classic_Gen1/2/3, F-USA_Gen1 and the BMW M1 Procars:

    (Caveats/context - this is just based on my own observations and could be skewed by incorrect assumptions and lack understanding of how things are working behind the scenes. It's also primarily focused on how the AI interacts with other AI - not the player (which I think is a different discussion, and maybe in a better state overall). My approach/aim with the files I have been making is to try to create historically plausible races and appreciable (but subtle) driver 'personalities' for the series/year in question - not to use the custom AI attributes to 'force' the actual historical results. I would be very happy to be corrected on any of the below. Also - just to mention, I think all this customisation potential is fantastic, and you can already have a lot of fun with the AI, but when you start to look at their behaviour in detail there is obviously some room to improve :).)

    -Mistakes: I have seen a reasonable number of AI mistakes, though it feels like there should be more - BUT, I tend to run 10 to 20 lap races, so it's possible the proportion of mistakes per driver per race may be about right in the context of longer (i.e. historically realistic) races. I've seen a leader spin out for no apparent reason, I've seen oversteer moments being caught, I've seen a lot of wheel-on-the-grass sketchy moments. Some maybe more situational, but the 'unprovoked' ones seem clear.
    - Overtaking: I would agree that overtaking is the single most obvious issue with the AI now - specifically AI on AI overtaking. The AI seems to have no issue sending it up the inside under braking to overtake a human player, but this behaviour is not replicated in overtaking AI. It almost seems like they 'know too much' - if that makes sense. I am purely guessing here, but it's based on my observations. It's like they get fully alongside, but they haven't met some arbitrary high threshold to 'decide' that they have 'won' the corner, so they back out and yield to the guy ahead, even if it is a back marker or clearly slower car. The overtaking car needs to 'care' less about the car in front and hold their line, with the behaviour of the car being overtaken modified to effectively concede/give space (based on their defending value) rather than forcing the overtaking car to yield in the vast majority of scenarios.
    - Drafting/slipstream: Drafting is also not really functional from what I've seen. If a car gets a good run out of a slow corner before a long straight, they will pull alongside immediately and just try to drag race the car in front, which is usually a stalemate unless they have a massive speed advantage. They need to bide their time in the slipstream, wait till they have the full benefit of the draft, then pull out in time to take the next corner.
    - Trains: This situation is further complicated when there are more than two cars in a row in a 'train'- they will typically go three or four wide down a long straight as they all replicate the same slightly weird behaviour of getting alongside immediately and 'drag racing', before usually all backing out.
    - The '3rd car' in the queue does make overtakes more likely though, as the 2nd car appears more concerned about the car behind than the car in front, which often results in the 3rd car taking advantage of the 2nd car's half-hearted overtaking efforts, or bumping the 1st car so much that it causes them both to lose time. This isn't necessarily bad (3rd guy taking advantage), but it seems mostly based on the 2nd car's inability to overtake the 1st car. If there is no third car, then running in super-close formation for many laps is more likely.
    - If a car doesn't obviously get a good run and decide to get alongside, they still run too close together - like almost touching, often effectively ramming each other through the corners. Again, this just looks wrong and suggests something missing in the AI logic. If you have excess speed you would move a little to one side or the other looking for a gap, or you will bide your time for appropriate time to attempt an overtake. If this is the 'biding my time' behaviour, then it could do with being tweaked to make it less robotic / 'on rails', with variation in the size of the gap maintained and the line taken. Open wheel cars running ~50cm apart for long periods just looks wrong.
    - Attempts to minimise weirdness: I have attempted to mitigate some of these behaviours with the custom AI values. It's hard to quantify how successful this is without doing amounts of testing that I simply don't have time or data to do, but again, just based on my observations, reducing 'defending', 'consistency', 'avoidance_of_mistakes' and 'avoidance_of_forced_mistakes' across the board seems to result in more overtaking in general (despite the above-listed points). I also keep 'blue_flag_conceding' at almost max for everyone, as it's very frustrating when a leader can't get past someone multiple seconds per lap slower due to being so tentative, so I don't want to make it any harder.
    - Aggresssion: One value I am not clear at all on how best to use is 'aggression'. I have kept it in the mid-range to (I guess) try to minimise ramming and barging that is completely wrong/unrealistic for open-wheel racing, and also the aggression value is linked to defending - which is not a priority concern for me when overtaking already seems so difficult - but then I wonder does it need to be high to somewhat mitigate the overtaking 'tentativeness'. Has anyone had good results with high/low values on this?
    - Skill: On 'race_skill' and 'qualifying_skill' - this might a gross over-simplification on my part, but I effectively see these as 'laptime'. All other things being equal, these decide who is quickest (but obviously all other things are not equal, so that's fine - we have consistency (applied per lap and per weekend), stamina, wet skill, tyre management, mistakes, etc). I tend to set the quali skill a little higher than race skill in order to not get race laptimes consistently quicker than quali laptimes.
    - Factoring in the car: A major consideration for all these 'historical' AI files (unless it is for a spec series) - is that the AI file is effectively trying to convey the attributes of the car, the team and the driver, not just the driver. Until such a time as we can configure the cars attributes on a per-car basis, I expect this is an unavoidable compromise. So that needs to be factored into at least the race and qualifying skill values, and potentially others too (mistakes consistency, etc) to reflect difficult to handle or inconsistent cars.
    - In an ideal world - I think you should be able to copy/paste a driver into another series/car without needing to adjust their attributes to reflect the car you're putting them in.

    Sorry about the stream-of-consciousness dump - might help someone fill in the blanks in terms of making better use of the current variables, but I also hope some of the underlying 'baked in' behaviours can be tweaked in due course.
     
    Last edited: May 8, 2022
    • Like Like x 8
    • Agree Agree x 2
    • Winner Winner x 2
    • Informative Informative x 2
  7. Harry H

    Harry H Active Member AMS2 Club Member

    Joined:
    Mar 25, 2020
    Messages:
    211
    Likes Received:
    177
    Great assessment.
     
    • Like Like x 1
    • Agree Agree x 1
    • Friendly Friendly x 1
  8. sampopel

    sampopel Active Member AMS2 Club Member

    Joined:
    Mar 31, 2020
    Messages:
    315
    Likes Received:
    145
    I had tried setting the Defending attribute to very low values (0.1 or lower) and Aggression to 1.0 for all AI drivers in the hope of it facilitating more AI v AI overtakes but it didn't work (in the car classes I play with - various tin-tops such as Brazilian stock, Porsche, GT4s). And I can't say I noticed any obvious sign of the maximum Aggression values resulting in more aggressive defensive behaviour.

    I tend to have the avoidance of mistakes attributes very low for many drivers in the field and because that leads to AI drivers losing the back end now and then, thus slowing them down for a second, it can lead to a bit more AI overtaking but not much.

    I think the AI v AI overtaking issue is baked in and needs addressed through programming rather than attributes.
     
    • Agree Agree x 4
    • Like Like x 1
  9. deadly

    deadly Well-Known Member

    Joined:
    Jul 8, 2016
    Messages:
    1,465
    Likes Received:
    505
    Yes. AI has severe problems with overtaking on the inside before corners. They come out of the slipstream and then step back again, going back to the racing line and ram slower car instead of passing on the inside. In AMS 2's logic, the car on the outside has right of way and always tries to force it's way through. By doing so, they also tend to ram player out of track who has done an overtake on the inside. This needs an overhaul, not much to do by altering values within the custom file.

    Another annoying issue is AI's behaviour when they are about to be lapped. As there are still no flag rules for those fellows, they fight and block player instead of giving way, no matter if you have set blue_flag_conceding to 1.0.

    Edit: One further thing: Within many open wheel classes, AI tends to almost stand still on the apex of slow curves, but can rocket out of corner, though.
     
    Last edited: May 9, 2022
    • Agree Agree x 3
  10. john Ellis

    john Ellis The Rectifier of Names AMS2 Club Member

    Joined:
    Mar 18, 2020
    Messages:
    725
    Likes Received:
    793
    • Like Like x 2
  11. farcar

    farcar Well-Known Member

    Joined:
    Mar 10, 2016
    Messages:
    485
    Likes Received:
    1,043
    There has been blue flag behaviour for the AI for a while now.
    I can notice it, though it's unpredictable. They slow up, but I can never tell if they're going to move off racing line or not.

    It's also annoying in practice or quali when you're looking for track space. You come up behind an AI car and Blue Flag mode kicks in and they slow. Then as soon as you overtake them, they're immediately at 10 Tenths to overtake agin, then immediately go back to Blue Flag mode when they do.

    Grr
     
    • Agree Agree x 4
    • Optimistic Optimistic x 1
  12. AUS_Twisted

    AUS_Twisted New Member

    Joined:
    May 12, 2022
    Messages:
    2
    Likes Received:
    0
    I've noticed when pitting to do a driver swap to the AI they were 4 - 5 seconds off my pace and the lead AI's at Long Beach in the Porsche GT3 racing against GT3's at 120%
     
    • Informative Informative x 1
  13. stlutz

    stlutz Active Member

    Joined:
    Feb 10, 2021
    Messages:
    193
    Likes Received:
    93
    I'm finding that this varies quite a bit from track to track. I'm working though a 13 race F-Classic Gen 3 championship and I've had races with few mistakes that I saw and then had races like tonight at Monza '91 where there were all kinds of them--an action-packed race!

    I'm sure that's a whole area that us custom AI geeks can probably over-analyze--which cars and tracks have more AI mistakes.

    Overall I think the number AI mistakes is appropriate (I have error-avoidance scores that average out to .5 in my custom AI files--with higher-skill drivers making fewer mistakes). I usually do races between 45 and 75 minutes, so I also have more time for things to happen. What I had tonight was fun, but I wouldn't want every race to be like that.
     
    • Like Like x 1
  14. br1x92

    br1x92 Active Member

    Joined:
    Aug 1, 2021
    Messages:
    304
    Likes Received:
    123
    @Harry H I somehow remember there was some kind of "per track" feature in your AI creation tool but just now I couldn't find it. Is it there somewhere or does my memory fool me?

    Would be something really nice to implement if it's not there already, I just did a lot of testing with the GT1 AI and wrote down all the values but now implementing it for 21 drivers on about 10-12 tracks is soooo much copy/pasta work, would be really nice if the tool could do that for me :)
     
  15. Harry H

    Harry H Active Member AMS2 Club Member

    Joined:
    Mar 25, 2020
    Messages:
    211
    Likes Received:
    177
    It's not there right now. I'll have to think about how it might be added.
     
  16. br1x92

    br1x92 Active Member

    Joined:
    Aug 1, 2021
    Messages:
    304
    Likes Received:
    123
    Yeah I thought about it myself, couldn't really come up with a good idea. Maybe some sort of drop down where you can select a track that inserts a new row with the values of the row above that then can be modifed? Not really sure, seems very complicated to implement.
     
  17. john Ellis

    john Ellis The Rectifier of Names AMS2 Club Member

    Joined:
    Mar 18, 2020
    Messages:
    725
    Likes Received:
    793
    I’m not sure how to put this, and I am afraid I already know the answer, but is there any set of custom AI values that ameliorate the problem that I can race with the dual AI sliders at 120/100 and still keep the AI cars behind me the whole race (i.e., the dreaded overtaking bug) even amidst some occasional and obvious driving mistakes on my part? Meanwhile, either I keep up with the ones ahead or, more often than not. any cars ahead of me eventually disappear into the distance at 120.

    I admire Gilles Villeneuve as much as anybody, but when EVERY race plays out like Jarama ‘81, it starts to damper my enthusiasm for this sim.
     
  18. deadly

    deadly Well-Known Member

    Joined:
    Jul 8, 2016
    Messages:
    1,465
    Likes Received:
    505
    No, it is not possible, I guess.

    1. The AI does not have same performance in all cars and on all tracks. Within some classes, they are pretty fast on track A, but slow on track B.

    2. As "gian" stated on page 1 of this thread, you should set the aggression slider ingame to 50%, because only then the drivers have the values given in the custom AI file.


    • At 50% "Opponent Aggression" slider setting, the driver aggression will be identical to the overriden value.
     
    Last edited: May 24, 2022
    • Like Like x 1
  19. kkdrummer

    kkdrummer Well-Known Member AMS2 Club Member

    Joined:
    Jun 25, 2016
    Messages:
    1,396
    Likes Received:
    683
    Also, the AI doesn't know how to pass on the straights and try to pass in some impossible places which normally result in the AI losing mentum out of corners.
     
  20. john Ellis

    john Ellis The Rectifier of Names AMS2 Club Member

    Joined:
    Mar 18, 2020
    Messages:
    725
    Likes Received:
    793
    Agreed; that’s probably one of the better ways to describe the current iteration of AI’s shortcomings. Consider it another reason to keep one’s driving smooth and tidy, and give the AI some extra room in the corners. I doubt we’ve ever driven a sim that we did NOT have to modify our driving style to accommodate idiosyncratic AI issues.

    For now, I’ll go with a FIA-inspired difficulty setting of 107 with aggression at 50 to activate any custom values I have installed, call it a day, and keep enjoying AMS2.
     
    Last edited: May 25, 2022
    • Agree Agree x 1
    • Informative Informative x 1

Share This Page