The new adaptive AI

Discussion in 'General Discussion' started by Paradox Agi, Apr 18, 2016.

  1. Foofer37

    Foofer37 Member

    Joined:
    Nov 9, 2016
    Ratings:
    +15 / 0 / -0
    I don't have this aiadaptation.xml file. What does that mean? Searched my whole machine. Nowhere. Hmm.
     
  2. CheerfullyInsane

    CheerfullyInsane Well-Known Member

    Joined:
    Oct 24, 2015
    Ratings:
    +402 / 0 / -0
    ~Documents\My Games\SimBin\RaceRoom Racing Experience\UserData\Player1
    It only gets generated after the first AI race though, so if you've never raced against the AI it won't be there.
     
  3. Eisprinzessin

    Eisprinzessin Well-Known Member

    Joined:
    Dec 7, 2015
    Ratings:
    +315 / 0 / -0
    And i have to delete it after the big patch?
     
  4. CheerfullyInsane

    CheerfullyInsane Well-Known Member

    Joined:
    Oct 24, 2015
    Ratings:
    +402 / 0 / -0
    Absolutely not.
    You may have ro run a few short races with the Audi TTs to adjust for the new physics, but otherwise it'll work fine.
     
  5. Eisprinzessin

    Eisprinzessin Well-Known Member

    Joined:
    Dec 7, 2015
    Ratings:
    +315 / 0 / -0
    OK. Thanks

    Two races driven with the 16 Audi TT and aprox. 4 Secs per round faster as the second.
     
  6. CheerfullyInsane

    CheerfullyInsane Well-Known Member

    Joined:
    Oct 24, 2015
    Ratings:
    +402 / 0 / -0
    Hang on a minute. What gets added to the average after each race?
    Is it the fastest lap the AI did in that race, the average of the fastest laps in that race, the average of the grid, what?
    From what I've been seeing I'd assume it's the average lap-time of the grid, so as to put you around mid-pack.
    But if it's an average of all the laps, won't we end up with an accumulative error when using rolling starts?
     
  7. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +412 / 0 / -0
    if multiplayer ever gets support for AI, you could basically brute-force run a server configuring some AI levels, tracks etc, and suck the timing information from that, still with a bit of extrapolation. s3s could write a tool that runs the simulation at a higher speed than real-time, accelerating this further.
    Basically a standalone tool that just draws the track outlines + boxes for the cars (think like simple top down racing games). You could interactively "pull" on the cars and see how AI reacts. Not into AI programming but would hope they have such tools that aid iteration times. Using some just-in-time compilation schemes you could live modify the code, etc.
     
  8. Not Lifting Off

    Not Lifting Off Well-Known Member

    Joined:
    Dec 5, 2015
    Ratings:
    +368 / 0 / -0
    Why not unencrypt the driver files? Let people create their own if they wish, even be able to share them, used to love messing with the ai making and breaking.
    I can understand some files needing to be encrypted, but some its pointless, these are one of them in my opinion.
     
    • Agree Agree x 1
  9. Trux

    Trux New Member

    Joined:
    Apr 4, 2015
    Ratings:
    +1 / 0 / -0
    Ok just read entire thread... confused as hell now. Appreciate the efforts in here but I need clarification. Too many complex,criptic answers. I'm personally not interested in editing files to short cut the system. But I would like to know the quickest way to train AI as intended by revs.

    AI can only be trained in a race Yes/No?
    Min number of laps to train AI?
    Should I start AI at fixed level for one race and then switch to adaptive? Yes/No?
    Number of races required to train AI?
    Do I need to do it for every track combo in game?

    Thanks
     
  10. Peter Koch

    Peter Koch Well-Known Member Beta tester

    Joined:
    Jan 15, 2015
    Ratings:
    +191 / 0 / -0
    AI can only be trained in a race? Yes
    Min number of laps to train AI? Only a few timed laps. (I'm testing with 10 minute races.)
    Should I start AI at fixed level for one race and then switch to adaptive? No, deleted the aiadoption file and switch to adaptive.
    Number of races required to train AI? 3, but they keep learning.
    Do I need to do it for every track combo in game? No
     
    • Like Like x 1
    • Informative Informative x 1
  11. Gopher04

    Gopher04 Well-Known Member

    Joined:
    Mar 6, 2015
    Ratings:
    +237 / 0 / -0
    So not every track combo, but every class of vehicle per track? and what about each car for each class? ie, all gt3 cars, or just one in that class?
     
  12. Peter Koch

    Peter Koch Well-Known Member Beta tester

    Joined:
    Jan 15, 2015
    Ratings:
    +191 / 0 / -0
    Those 3 races are only a quick Ai setup to match your speed. They keep adapting you after every race you do in the future.
    So you only need 1 car/track to begin with.
     
  13. Trux

    Trux New Member

    Joined:
    Apr 4, 2015
    Ratings:
    +1 / 0 / -0
    Thanks for clarification Peter. Very helpful.
     
    • Like Like x 1
  14. CheerfullyInsane

    CheerfullyInsane Well-Known Member

    Joined:
    Oct 24, 2015
    Ratings:
    +402 / 0 / -0
    Quickest way?
    I'm editing a new video on training the AI which should be finished this week-end, but here are the highlights.

    If you're starting completely from scratch, first do one lap with 100 Fixed AI. One flying lap on any combo will do, you just need to get that 100AI into the file to start from the middle instead of from 80.

    Four basic rules govern the Adaptive AI:
    1) If there is no info in the index-file at all, it'll start with level 80.
    2) If there is data for the car, but not for that car/track combo, it'll start at the average level of all the data it has on the car.
    3) If there is no data for the car/track combo, but there is data for the track with other cars, it'll use the average level for the track.
    4) If there is no data on neither car nor track, but there is other data in the index-file, it'll use the average of all of it.
    The above is followed in that order, so FIRST it looks for car-data, and THEN it looks for track-data.

    Next thing to remember is that it looks for averages LEVELS, not lap-times.
    Or in other words, a lap at Norisring counts just as much as a lap at Nordschleife, and we can use that to our advantage.
    Also, not all AI drivers are created equal, some are faster than others. Presumably there's a file somewhere in the encryption that governs the specific drivers, but I don't think we have access to it.
    The important thing is that you can't just run races against one car, since the driver it picks for each race usually isn't the same each time, thus making it very hard for the AI to find a proper average.
    So for training races you need a 'decent' grid. What's decent, you ask?
    Well, for single-make classes I usually run with half the available cars. For multi-car classes, I've arbitrarily picked 15 AI opponents, which seems to work fine.
    Just be aware that with multi-car classes, you have both varying AI driver skills, and varying suitability for the different cars on each track, so getting single-make classes to behave is usually easier (or at least faster to do).

    Finally, when doing training races make sure you set up enough time for two laps, and you HAVE to use standing start.
    Once the AI is trained you can start however you wish, but for training-races, standing-starts only.
    The problem with rolling starts is that the first lap is never as fast as a 'real' flying lap, and yet it still gets added to your average for that combo, dragging the whole thing down and making the AI slower than it should.
    With standing starts, the first lap is disregarded completely.

    So, figure out which car you'd like to race. Never mind which track for the moment, we'll get to that.
    And I strongly suggest that once you've started training a car-class that you keep at it through all the tracks you're likely to race with it. It's simply easier to keep track of which ones are trained if you keep it systematic.
    Or maybe that's just me being anal-retentive. :D

    Anyway, grab roughly 15 AI drivers, choose standing start and choose the shortest track you can think of.
    Personally, I use Norisring, Brands Hatch Indy, East Suzuka and Hockenheim Club for my initial base-levels but anything you're comfortable with will do fine. Just remember, the shorter the track, the faster the training gets done.
    Again, the AI looks for averages, no matter how short the tracks may be.

    The first time you run a combo, you have to do qualifying. You need to sort out the fast AI drivers from the slow ones, otherwise the result gets skewed by them fighting for positions. And never qualify yourself, you need to start last.
    Don't worry, you only have to run qualifying once for each combo.
    Once the race starts, give the rest of the field a good 15 seconds head-start. If you feel like it, you can spend the time doing donuts. :p
    With standing starts, anything you do on the first lap never enters into the index-file. You could run the entire first lap in reverse, and nothing would get recorded.
    The reason for giving everyone else a head-start is to ensure that your own flying lap (which does count towards your average) is un-interrupted by slow AI, which can be a hassle especially in the first few combos when you have very little data in the index-file to build upon.
    Once the entire field, yourself included, has done two laps (that is, one flying lap) hit 'Escape' and choose 'Restart Race'
    I found out that you don't have to quit the race altogether for the index-file to add the data, and by simply restarting the race you don't have to sit through qualifying once again.
    Same procedure, one flying lap, then restart. Repeat until the AI leaders start doing lap-times that are FASTER than yours.
    Make no mistake, the lap-times that are in the index-file are the average of the FIELD. So in order to get a good fight, you have to see the leaders do lap-times that are faster than yours, otherwise you'll be leaving them all behind.
    After you've done 3-4 short-track races, then you can turn your attention to the tracks that actually intend to use.
    Since the AI now has data for the car, it'll use the average of your short-track adventures to start somewhere much closer to the real level, and thus adapt much faster.

    But that's the gist of it.
    And yes, it's a hassle the first few combos. But once the AI has some data to build upon, the AI adapts very quickly indeed.
    My main peeve right now is that it stops adapting too soon, but that can be fixed by a little manual manipulation.
    Also, you can fine-tune it faster by playing around with the Fixed AI levels, but all that minutia will have to wait until I finish the video.
    I'm not going to first do a video, and then sit and type the bloody thing out as well. :D
     
    • Like Like x 4
    • Informative Informative x 1
    • Useful Useful x 1
    Last edited: Jan 5, 2017
  15. CheerfullyInsane

    CheerfullyInsane Well-Known Member

    Joined:
    Oct 24, 2015
    Ratings:
    +402 / 0 / -0
    Right, here we are.....
    Due to my somewhat rambling narrating style, and unforseen feline interventions it's a bit longer than I hoped.
    But it does (eventually) explain how to go about it.
     
    • Like Like x 4
  16. bearr

    bearr Active Member

    Joined:
    Nov 27, 2016
    Ratings:
    +35 / 0 / -0
    not a real behavior of the adaptive AI.
    Conditons: Single race, WTCC 15, Zandvort, Qualification 60min, Race 15Lap.
    Pole position Ai 1.40.8, my time 1.41.8.
    In the race the AI goes 1.40.00. What happened? It is not real! Sorry for my English
     
  17. pascal.lafata

    pascal.lafata New Member

    Joined:
    Jun 3, 2016
    Ratings:
    +0 / 0 / -0
    I'm experiencing the same as bear, i.e. the AI lapping faster in race (20 min race) from first flying lap (while supposedly heavier) than in qualifying. Usually the AI is about 1 sec faster than in qualyfication while with fuel weight I'm about 1 s slower than my qualm time. This has happened to me with DTM2016, TT2016 on various tracks (Hungaroring, Nurburgring, Lausiztring, etc.) using either adaptive AI or fixed AI. I'vent tried to figure out if this happens with others cars or tracks.
     
    • Agree Agree x 1
  18. Balrog

    Balrog Well-Known Member

    Joined:
    Apr 10, 2015
    Ratings:
    +466 / 0 / -0
    I don't know about exact laptimes, but one thing I noticed in Zandvoort the AI is insanely quick in slow and mid speed corners, especially with smaller open wheelers like the Formula Junior or Tatuus F4. Overtaking them is almost impossible on the Club layout.
     
    • Agree Agree x 1
  19. Andi Goodwin

    Andi Goodwin Moderator Beta tester

    Joined:
    Jan 16, 2015
    Ratings:
    +791 / 0 / -0

    both dtm and audiTT will always be quicker in race than in Qualify for obvious reasons drs,ptp

    Andi
     
  20. Tobias Schröder

    Tobias Schröder Well-Known Member

    Joined:
    Jan 29, 2015
    Ratings:
    +273 / 0 / -0
    Yeah, I have that problem too.
    Same on Salzburgring and Spa with some classes.