The new adaptive AI

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

  1. Christian G

    Christian G Topological Agitator Beta tester

    Joined:
    Apr 8, 2015
    Ratings:
    +2,411 / 0 / -0
    The reason I personally prefer short sessions (and hence suggest to do so) is that the adaptation process usually needs at least two sessions to get close to my/your level of performance. After the first session the AI doesn't perform at your level instantaniously but instead they get closer in several steps (as you can see in the post by NLO).
    So you can do one very long session, drive f.e. 50 laps but the adaptation system will still only take your last ten laps into account and the adaptation will not go faster if you do more laps in one session. If you do less than 10 laps it doesn't make the adaptation "slower" or reduce the amount by which they will get closer to your level.

    Example:
    AI base level: 80
    Your average level: 115
    AI level after first session: 90 (just some random number)
    AI level after second session: 100
    and so on, until they reach your level.

    So in order to save time I prefer to do 2-4 short sessions in which I put consistent laptimes into the system. Which is also the reason why I suggest to check whether they are faster or slower than you by default and put yourself into first position in case they are slower and in last if they are faster. That way you can drive without being "disturbed" by the AI cars and create consistent laptimes.

    Hope this makes sense.
     
    • Agree Agree x 2
    • Informative Informative x 1
  2. CheerfullyInsane

    CheerfullyInsane Well-Known Member

    Joined:
    Oct 24, 2015
    Ratings:
    +402 / 0 / -0
    Okay, that makes perfect sense. So it's a combination of both the lap-times and your ability to consistently reach those lap-times.
    Fair enough, but that means there's a small snag to the short-race method of doing this.
    I spent most of last night training the AI on several tracks with the Aquila, figuring that by the end of it, I could use those tracks for a championship.
    And the 'three short races' format worked beautifully on both Zandvoort and Nürburgring.
    But I just couldn't get it to work at Spa. They just never improved, and I think I might have figured out why.
    The first problem is that I've never been very good at Spa.
    So as I started to do lap after lap, my lap-times improved. Or in other words, I was improving faster than the AI. :D
    Okay, so that one was my own silly fault. :rolleyes:
    But after six 10-minute races, the AI was still doing 2:33s even though I had been doing 2:31-2:32s for a while.
    (and yes, I suck at Spa. I know. Moving on....)
    So I took a look at the XML-file (this is after six races, remember):

    <key type="int32">4543</key>
    <value>
    <!-- Index:0 -->
    <key type="int32">253</key>
    <custom>
    <custom>
    </custom>
    <custom>
    </custom>
    </custom>
    <!-- Index:1 -->
    <key type="int32">255</key>
    <custom>
    <custom>
    <!-- Index:0 -->
    <custom type="float32">155.78283691</custom>
    <!-- Index:1 -->
    <custom type="float32">153.02120972</custom>
    <!-- Index:2 -->
    <custom type="float32">152.37628174</custom>
    <!-- Index:3 -->
    <custom type="float32">153.11471558</custom>
    <!-- Index:4 -->
    <custom type="float32">155.46817017</custom>
    <!-- Index:5 -->
    <custom type="float32">151.91989136</custom>
    <!-- Index:6 -->
    <custom type="float32">152.44479370</custom>
    <!-- Index:7 -->
    <custom type="float32">151.92858887</custom>
    <!-- Index:8 -->
    <custom type="float32">155.43629456</custom>
    <!-- Index:9 -->
    <custom type="float32">152.73019409</custom>
    </custom>

    (For those unfamiliar, 4543 is Spa Combined layout, and 255 is the Aquila. The other entries are my lap-times in seconds, e.g. 155,7 equals 2:35.7)
    The problem here is that with lap-times above 2:30 you only have time to do 4 laps. If you look at the lap-times you'll see a pattern of one starting lap of around 2:35 followed by three flying laps averaging around 2:32. So why would the AI still be doing 2:33s?
    Here's the kicker, disregarding the decimal-points, if you average the lap-times you end up with 152,9.....Or 2:33. :)
    The problem is that there are too many starting laps in there, and they're dragging the average down.

    Obviously, the best solution would be for the AI to simply disregard the first lap of every race.
    That is going to take some coding though, and presumably Sector 3 have other priorities. :)
    In the meantime, it would seem that the best way forward is still to do a couple of short races to get the AI to ramp up (or down if need be), but if you're unable to complete 6+ laps in the race-sessions you should finish off with a longer session in order to only have the one start-lap in the average.

    And let me just say that I'm in no way trying to diss the adaptive AI. I think it's a great addition, and I'm merely trying to figure out the best way to train it.

    Final thing that occurred to me....
    When doing the training races, do you actually need AI on the track?
    There is an option of doing a race with 0 opponents, but it should still collect the lap-times if you're running adaptive AI, shouldn't it?
    The reason I'm asking is that if you're doing practice for a MP race anyway, instead of doing a e.g. 30 minute practice session you might as well do three 10 minute race-sessions without adding AI.
    You still get the same practice-time, but you also get an improved AI, thus killing two birds with one race-car.
     
    • Like Like x 1
  3. kamackeris

    kamackeris Active Member

    Joined:
    Dec 12, 2015
    Ratings:
    +31 / 0 / -0
    Can someone tell me what the benefit of adaptive AI that finds your level over moving the ai level manually so that it matches your lap times? Does training it make it smarter ? I'm just struggling to see why I should spend so much time training it for every track?
     
  4. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    It's not smarter - 'adaptive' just means it matches your pace (once it's collected the required data). The actual on-track behaviour is the same
     
    • Like Like x 1
  5. kamackeris

    kamackeris Active Member

    Joined:
    Dec 12, 2015
    Ratings:
    +31 / 0 / -0
    That's what I thought... Yet I have seen posts say it is smarter if you train... Must be a placebo. Again if by just changing the slider to match your times I really do not see the point of adaptive AI. The only thing I can see is that if you want to run a championship but then you would need to have done all the legwork beforehand.
     
  6. CheerfullyInsane

    CheerfullyInsane Well-Known Member

    Joined:
    Oct 24, 2015
    Ratings:
    +402 / 0 / -0
    Depends on how you look at it.
    How many races would you have to do to find the percentage setting that matches your skill-level?
    The reason I like the adaptive AI is that I can fight 106% AI on Zandvoort, but I need to go down to 98% at Spa.
    So I would have to figure out a setting for each car/track combo before I could get decent racing.
    And then I'd have to adjust those sliders every time my skill improved.
    With the adaptive AI all this happens automatically, although it doesn't happen instantly.

    Besides, no-one is saying that you have to do AI training as a stand-alone option.
    When you're practising for a MP race, instead of using a practice session, use an adaptive AI race session without adding AI.
    Same amount of practice, plus the AI adapts to your pace.
     
    • Agree Agree x 2
    • Like Like x 1
  7. kamackeris

    kamackeris Active Member

    Joined:
    Dec 12, 2015
    Ratings:
    +31 / 0 / -0
    Someone mentioned this earlier... Do you actually need to have ai on the track to train? It's just lap times.... So run a ten lap race without ai and you have trained ai? Then do it again and they should be up to speed? Is that correct?
     
  8. CheerfullyInsane

    CheerfullyInsane Well-Known Member

    Joined:
    Oct 24, 2015
    Ratings:
    +402 / 0 / -0
    Depends on how far you are from the AI baseline.
    The AI adapts gradually, so the further you are from the baseline, the more races you'll need to run in order for it to catch up.
    But I did a test-run with FRJ @Zandvoort with no AI, and the times show up in the aiadaptation.xml, so it doesn't look like you actually need to have AI on track while training it.
     
  9. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    can you set the number of AI to zero then? Weird :)
     
  10. Gopher04

    Gopher04 Well-Known Member

    Joined:
    Mar 6, 2015
    Ratings:
    +237 / 0 / -0
    Personally I wouldn't worry about trying to work out the AI, it's so messed up right now, top speeds are extremely low on some tracks, braking and cornering is really bad, their clumsy, and have no awareness around them, so hopefully the Devs are working on the AI as it's the worst it's been.

    Adaptive AI I normally love, but right now it's a waste of time, their performance in certain area's on the track just doesn't allow them to compete with your times, for example, since the patch I'm straight off 10secs faster than the AI, run the adaptive for a couple of races, and their still 2/3secs off.
     
    • Agree Agree x 1
  11. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    fair enough, but the laptime data collected by the training mechanism should still be applicable after any game updates
     
  12. CheerfullyInsane

    CheerfullyInsane Well-Known Member

    Joined:
    Oct 24, 2015
    Ratings:
    +402 / 0 / -0
    You can.
    And yes, that one raised a few eyebrows on my end as well. :D
     
  13. Not Lifting Off

    Not Lifting Off Well-Known Member

    Joined:
    Dec 5, 2015
    Ratings:
    +368 / 0 / -0
    The test i did at Brands took the ai 5 10 min races (12-13 laps) to get competitive running with 1 ai car, after 5 runs i had ai that i was stuck mid pack with, i have a feeling it would be pointless altho not tried to run with 0 ai as they have to set baseline times with a % for speed which increases till they are on your level.
    <!-- Index:0 -->
    <key type="uint32">90</key> The ai started at 90%
    <custom>
    <custom type="float32">52.28863525</custom> First ai lap time.
    <custom type="uint32">1</custom>
    </custom>
    <!-- Index:1 -->
    <key type="uint32">105</key> Then 105%
    <custom>
    <custom type="float32">48.49121094</custom>
    <custom type="uint32">1</custom>
    </custom>
    <!-- Index:2 -->
    <key type="uint32">113</key>
    <custom>
    <custom type="float32">47.06024170</custom>
    <custom type="uint32">1</custom>
    </custom>
    <!-- Index:3 -->
    <key type="uint32">115</key>
    <custom>
    <custom type="float32">47.09455109</custom>
    <custom type="uint32">2</custom>
    </custom>
    <!-- Index:4 -->
    <key type="uint32">116</key> all the way to 116%, here they were competitive
    <custom>
    <custom type="float32">46.79758835</custom>
    <custom type="uint32">2</custom>
    </custom>
    </custom>
    </custom>
     
  14. kamackeris

    kamackeris Active Member

    Joined:
    Dec 12, 2015
    Ratings:
    +31 / 0 / -0
    could you not just run quali at say 100 %, end the session and check the times. if they are competitive to what you can do then thats the setting to use, if not change it up, run quali then end the session straight away till you are seeing competitive times....surely this will be quicker than 'training' the ai every time ??
     
  15. kamackeris

    kamackeris Active Member

    Joined:
    Dec 12, 2015
    Ratings:
    +31 / 0 / -0
    i just don't have the patience to laboriously go through this for every new track, car combo....surely then end result will be the same ??
     
  16. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +412 / 0 / -0
    it's not about training them, it's about adapting to YOUR performance. And your performance will vary with course and car and "daily" basis.
     
    • Agree Agree x 3
  17. CheerfullyInsane

    CheerfullyInsane Well-Known Member

    Joined:
    Oct 24, 2015
    Ratings:
    +402 / 0 / -0
    Sure you could, and by all means feel free.
    I'm not saying the adaptive AI is the be-all end-all, I'm just saying it's the one I prefer, and I'm trying to figure out how to get it trained the easiest way.
    My problem with set percentage AI is what happens when you start to improve?
    Then you have to go through all of it once more, whereas the adaptive AI...well, adapts. :D
    But if you prefer that option, that's entirely up to you. :)
     
    • Like Like x 1
    • Agree Agree x 1
  18. kamackeris

    kamackeris Active Member

    Joined:
    Dec 12, 2015
    Ratings:
    +31 / 0 / -0
    i get that...just seems long winded. can you set the initial baseline setting it adapts from...eg 107 for me at zolder in wtcc was competitive...if the adaptive could start from there then 'adapt' from that i wouldn't have to train them first which is the bit i don't have patience for !! lol
     
  19. CheerfullyInsane

    CheerfullyInsane Well-Known Member

    Joined:
    Oct 24, 2015
    Ratings:
    +402 / 0 / -0
    Well, in theory I suppose it would be possible to edit the XML-file, and simply hack in the desired lap-times.
    But I'd be REAL careful with e.g. typos, since they will probably crash the sim.
     
  20. Christian G

    Christian G Topological Agitator Beta tester

    Joined:
    Apr 8, 2015
    Ratings:
    +2,411 / 0 / -0
    Yea, all fair points you're making. I just recently realized the first lap does get counted in short races, thought it would be eliminated (and I was under the impression it did in the past). I'll put that one into the bug list and see if they can change that bit without too much hassle. On longer tracks, like Spa, this will have a bigger effect as, like you said, you won't be able to put as many laps in in 10 minutes as you can on Monza Jr.

    You don't need the AI to be there, that's just me being too lazy to change the race stup and also being bored by driving around completely alone, not seeing any other cars.

    AfaIk you don't even need to use adaptive AI for the system to collect the data. If you do races with a preset AI strength it should still gather your laptimes. So in theory you should be able to switch to adaptive after having done a couple races with fixed AI and they should already have adapted.

    The advantages are that you don't need to adjust the strength for every track, like CI said. But what I like about it even more is that it will offer a constant challenge. It's not like they match your times once they adapted, there is a spread so some of the AI drivers will be slightly faster than you, pushing you to improve even further to beat them. And I'm not sure about this but I think/assume adaptive AI doesn't cap out at 120%, though I haven't actually tested that.
     
    • Informative Informative x 2
    • Agree Agree x 1