A.I. teaches itself to drive in Trackmania

Sdílet
Vložit
  • čas přidán 12. 11. 2020
  • A.I. teaches itself to drive in Trackmania, using NEAT algorithm, which is a particular type of Genetic Algorithm. This algorithm is used to select a neural network with optimal weights, and also an optimal structure.
    Thanks Trabadia ! His CZcams channel : / trabadia1
    More information about NEAT algorithm :
    neat-python.readthedocs.io/en...
    Contact :
    Discord - yosh_tm
    Twitter - / yoshtm1
  • Hry

Komentáře • 4,3K

  • @yoshtm
    @yoshtm  Před 3 lety +1984

    Thanks for watching this video !
    This is the first time i'm using NEAT algorithm, so there is obviously still room for improvement. The main problem is that my AI doesn't have a map memory, and can't anticipate "what comes next" with its current inputs. I have some ideas to improve my AI, so don't forget to subscribe if you want to see the next steps of this project ;)

    • @theracerdude
      @theracerdude Před 3 lety +44

      Could you in the later generations select the ones that traveled the shortest distance at the last checkpoint? This would make them use the racing line more closely wouldn’t it? And then you could pick out the ones that don’t hit the walls. Not sure if that’s at all possible but it would make sense to me

    • @Fantaman900
      @Fantaman900 Před 3 lety +4

      in this vid i saw fast ai that started bouncing of the walls at a later point getting over taken by a slower ai. to create fast ai i needs map knowledge and learn that racing that keeps as much speed as possible and a bump on the wall slows you down. So basically all ai need to know what is faster in much smaller sections than a few checkpoints and then combine them to fastest to checkpoint. it's not going to be easy to create fast driving self learn ai.

    • @cymbalmonkey8360
      @cymbalmonkey8360 Před 3 lety +21

      @@theracerdude also if the cars are punished for hitting a wall they will make corners without hitting the walls while also taking the shortest route

    • @froozynoobfan
      @froozynoobfan Před 3 lety +4

      neat optimizes the topology of the model, if i remember it correctly you don't train the weights of the model.
      ai.googleblog.com/2019/08/exploring-weight-agnostic-neural.html
      github.com/google/brain-tokyo-workshop/tree/master/WANNRelease/prettyNEAT

    • @miggy3828
      @miggy3828 Před 3 lety +2

      neat

  • @21thCenturyFrog
    @21thCenturyFrog Před 3 lety +2494

    Trackmaina in this form is a quite sophisticated liquid simulation.

    • @verrtex7837
      @verrtex7837 Před 3 lety +86

      13:32 best part

    • @AkariInsko
      @AkariInsko Před 3 lety +25

      @@verrtex7837 thats trippy

    • @randomneko9
      @randomneko9 Před 3 lety +10

      Totally not kidding. I bet if you layered more hough level runs at increasingly delayed start times it would appear even more accurate

    • @vakqdev
      @vakqdev Před 2 lety +5

      Fluid simulation*

    • @Arcsinx
      @Arcsinx Před rokem

      You should watch the trackmania 20k project from l4bomba

  • @babiilabilux
    @babiilabilux Před 3 lety +4996

    Can't wait for the implementation of the brakes in order to see the AI drift !

    • @Bobba8590
      @Bobba8590 Před 3 lety +23

      AI

    • @evgeny8578
      @evgeny8578 Před 3 lety +127

      Well drifting will be cool but in these types of races like Formula, drifting will be totally useless. But yea will look cool

    • @masnysunshine
      @masnysunshine Před 3 lety +176

      @@evgeny8578 In sharp some sharp corners drifting is faster than releasing acceleration.

    • @masnysunshine
      @masnysunshine Před 3 lety +3

      czcams.com/video/lNPKKQywzEQ/video.html

    • @floding22
      @floding22 Před 3 lety +218

      @@evgeny8578 this is trackmania not a simulator so basically there’s a technique called speed drift by holding brake from about half a second while turning the car enters a drift where it gains speed, I was weird game physics but it’s a part the games identity now

  • @khalidal-mohammed5861
    @khalidal-mohammed5861 Před 2 lety +633

    Try this: if the car hits the wall, then remove a point. This should make the AI learn faster because hitting the walls will let them learn to not hit walls.

    • @2DReanimation
      @2DReanimation Před 2 lety +28

      Or just kill them off if stopped. A little nudge can even be better than taking a turn slower to not hit the wall.

    • @khantatat
      @khantatat Před 2 lety +35

      Wrong. The GA will converge to *NOT ACCELERATE AT ALL* because you would maximise your points.

    • @thedoctor0892
      @thedoctor0892 Před 2 lety +73

      @@khantatat If it doesn't accelerate, remove a point, problem solved.
      Acceleration - +1 increment
      Hits a wall - -1
      Doesn't accelerate - -1

    • @khantatat
      @khantatat Před 2 lety +31

      @@thedoctor0892 this would be better, it has an incentive to accelerate. Please note that, if feasible, it might converge to a circular path, which would represent a very appealing local maximum

    • @thedoctor0892
      @thedoctor0892 Před 2 lety +25

      @@khantatat Then in this scenario, there should be a limited time for the AI to reach the finish line, this would then force the AI to find the fastest way, without hitting a wall to get to the finish line.
      Going in a circular pattern, ziz zag motion or going as slow as possible would mean failure for the AI.

  • @mrshadow4007
    @mrshadow4007 Před 2 lety +850

    Of course Trabadia can help with developing a TrackMania AI. He's got lots of experience using tools in runs.

    • @xalat6277
      @xalat6277 Před 2 lety +86

      Ah a man of culture I see

    • @sephikong8323
      @sephikong8323 Před 2 lety +114

      I am mad that because he did such a reckless thing now his name will forever be tainted, he's no longer "one of the best players of the game", he's now stuck as "the guy who cheated". You ruined yourself and for what ?

    • @Seraphim262
      @Seraphim262 Před 2 lety +23

      @@sephikong8323 For the worldrecord.

    • @sephikong8323
      @sephikong8323 Před 2 lety +63

      @@Seraphim262 A record that he should have known he would have gotten caught for at some point, it's not like he played a rng heavy game and he just cheated by creating the exact odds he wanted, Trackmania is like Doom, it's very easy to access your run and replay it for scrutiny and any discrepancies can be found very easily. The only reason it took so long was because people didn't think it was necessary since he was excellent and had a good reputation and grinded so they trusted him. He himself destroyed that trust, it was certain that it would get found out someday somehow, he could have obtained the record the legit way if he kept grinding instead of taking the easy way out, now he pays the price

    • @dab_boy1024
      @dab_boy1024 Před 2 lety +6

      That’s a oof moment

  • @everythingoutdoors3699
    @everythingoutdoors3699 Před 3 lety +2119

    Isn't it strange how this looks just like flowing water.

    • @JavierSegura
      @JavierSegura Před 3 lety +128

      Nah, we live in a world of mathematical patterns so reality is basically just a very advanced AI.

    • @ElPoyoDiabolo1
      @ElPoyoDiabolo1 Před 3 lety +17

      Agreed ... it's a little bit hypnotizing as well :)

    • @alexalekos
      @alexalekos Před 3 lety +20

      it's strange how despite his awefull pronounciation you can still make out what he says

    • @marinlenfant6976
      @marinlenfant6976 Před 3 lety +5

      Or like insect

    • @Soundlmpact
      @Soundlmpact Před 3 lety +7

      which means water is AI, therefore universe is AI

  • @scottcarr5014
    @scottcarr5014 Před 3 lety +1353

    One of the big differences between the human driving and the AI is information available. The human learns the layout of the track and optimizes each turn for the next. The AI is only given information about what it can see at any given moment. In other words, the AI is effectively driving the track for the first time every time.

    • @hanbanaroda
      @hanbanaroda Před 2 lety +176

      Also, human player sees much more further down the track (curves on the horizont), this AI is limited in its visual field.

    • @dr_j0nes
      @dr_j0nes Před 2 lety +175

      Yeah thats exactly the point. His AI stops to progressing because it lacks of Input. He need to let the AI see further to let it predict curves and such better. Also the current speed, acceleration and other factors need to be inputs to the learning algorithm.

    • @SirusStarTV
      @SirusStarTV Před 2 lety +2

      Each car needs its own camera for vision to see far

    • @sethmath2778
      @sethmath2778 Před 2 lety +16

      And the ai should take the longest visible straight-shot instead of just zig-zagging through the entire track.

    • @HesderOleh
      @HesderOleh Před 2 lety +25

      @@sethmath2778I think that is happening because it isn't anticipate what comes next, so even if it zigs when it is supposed to zag half the time the selection function will just take the ones that got lucky that time and put them into the next generation.

  • @nathanmennel
    @nathanmennel Před 2 lety +67

    The way that first car morphs at 13:33 is amazing. This was extremely visually interesting

    • @didjoww
      @didjoww Před rokem +1

      looks like some breakcore typa visualizer

  • @Enkrod
    @Enkrod Před 2 lety +182

    Trabadia is very well suited to assist a tool, as he has received so much help from a tool assistant himself. :p

    • @dildrawz5338
      @dildrawz5338 Před 2 lety +6

      Was looking for a comment on Trabadia lol

    • @tery3836
      @tery3836 Před rokem +1

      Yeah trabadia is really good for real trabadia is amazing

  • @antonkremov1827
    @antonkremov1827 Před 3 lety +702

    Alternate title: Weird water learns to flow efficiently on racing track.

    • @NightmareCourtPictures
      @NightmareCourtPictures Před 3 lety +3

      There is science that does imply, that quantum mechanics follows evolution in the form of something you've all heard before : Path of Least resistance...that this path is actually an evolution process formed by the arrangement of molecules shifting around to settle into the most efficient configuration.
      There is a famous experiment with the optimal configuration of bubbles...how "most" of the time they settle into the most optimal configuration...but sometimes they don't...and so it's been the study of how evolutionary processes is how nature optimizes all problems not just biology :)

  • @Tollerah93
    @Tollerah93 Před 3 lety +473

    20 generations in and I'm still the car hitting the wall at the start line.

    • @dfdempire8912
      @dfdempire8912 Před 3 lety +13

      Genetic mutations.
      As we evolve ressesive traits can sprout causing the mutation.
      It's based of survival of the fittest but has bad traits. Over time there will be less and less until it's no more.
      It's literally evolving and changing it's (DNA)

    • @Tollerah93
      @Tollerah93 Před 3 lety +13

      @@dfdempire8912 what? I'm aware of how this is structured. I was making a joke.

    • @707beats6
      @707beats6 Před 3 lety

      @@Tollerah93 lol

    • @Akimo250
      @Akimo250 Před 3 lety +2

      @@dfdempire8912 Jokes. You know what jokes are, do you?

  • @stig3914
    @stig3914 Před 2 lety +60

    My only issue with generations (with know experience and just watching youtube) is you see a good contender that isnt the fastest (e.g. doesn't hit a wall but comes second) and it gets scrubbed - in a generation or two might acctually take over the current wall smashing leader.

    • @TheSmiddy
      @TheSmiddy Před 2 lety +30

      That's why you usually only cull the worst 50% instead of the 99% that didn't win.

    • @gosupersheep2006
      @gosupersheep2006 Před 2 lety +4

      The term for what youre describing is a local minima/maxima - the algorithm effectively gets 'stuck' within the search space. Its why, as the other commenter says, you dont kill all but the winner, but its also the reason for random mutations being introduced!

    • @diabl2master
      @diabl2master Před 2 lety

      @@TheSmiddy Oh, is he culling the worst 99%?

    • @klobiforpresident2254
      @klobiforpresident2254 Před 2 lety

      @@diabl2master
      One assumes not as that's basically never done.

  • @pyramidbuilder
    @pyramidbuilder Před 2 lety +35

    Hey Josh! Your AI driving algorithm reminds me of water flowing down a tube... which is almost the opposite of how F1 drivers drive; as they hug the corners rather that rebounding off the opposite walls. Really interesting experiment! Thanks for sharing.

    • @doobzb5482
      @doobzb5482 Před 2 lety +1

      If a high pressure water source was blasted into a tube that was well constructed for minimum resistance, it would follow an f1 drivers route wouldn't it?

  • @adithyaarun9981
    @adithyaarun9981 Před 3 lety +314

    "The circle strategy" made me giggle

  • @warpmonkey
    @warpmonkey Před 3 lety +2812

    If you were to introduce a stronger penalty for hitting the wall, such as ending the run right there and not letting it progress, would a stronger rule like that ensure the 'gene' for clipping the walls was removed?

    • @rookbrood
      @rookbrood Před 3 lety +423

      I was thinking the same thing, if you use a combination of factors for the fitness function it can learn better behavior.

    • @jackw1252
      @jackw1252 Před 3 lety +202

      Exactly what I was thinking. A sort of ‘punishment’ for the AI for either hitting the wall or not reaching a specific checkpoint by a certain time

    • @YouHaventSeenMeRight
      @YouHaventSeenMeRight Před 3 lety +297

      I was about to suggest this myself. It seems to me that the AI is held back by the fact that it thinks that hitting the wall is a valid strategy to make a turn, whereas we humans know that this is not the case.

    • @Cuahchic
      @Cuahchic Před 3 lety +143

      A really straightforward solution is just to add a time penalty if it hits the wall, so total time is duration + penalties and optimise total time.

    • @martinum4
      @martinum4 Před 3 lety +51

      I would rather add a penalty after 1 second of wall contact, depending on the vehicle it might be easier to implement a course correction via controlled crash

  • @brandonfortner3646
    @brandonfortner3646 Před 2 lety +2

    I love how you explained all the science behind it, it allows me to understand how these AI work on a conceptual level

  • @diogohernandez66
    @diogohernandez66 Před 2 lety

    Interesting video and amazing effort! Many hours spent, nice work man!

  • @MisterFilOfficial
    @MisterFilOfficial Před 3 lety +4353

    This is exactly how water flows trough pipes. Should we try to put a genetic algorithm on water drops to tech'em flow better? 🤔

    • @nif4345
      @nif4345 Před 3 lety +82

      Yes

    • @noahm44
      @noahm44 Před 3 lety +30

      Popular boy.

    • @hugoantunesartwithblender
      @hugoantunesartwithblender Před 3 lety +144

      This is not like water flow at all. Doing a water simulation is completely different of this ai

    • @theroninrenofficial9058
      @theroninrenofficial9058 Před 3 lety +32

      So. We actually already do. Electrical and audible waves are used in many purification/production processes.

    • @theroninrenofficial9058
      @theroninrenofficial9058 Před 3 lety +19

      @@hugoantunesartwithblender I mean. It kind of is though

  • @TheCodingTrain
    @TheCodingTrain Před 3 lety +928

    Watching this video and zoinks there I am! Amazing work!!

    • @yoshtm
      @yoshtm  Před 3 lety +82

      Thank you so much !! I loved your video series on genetic algorithms, it helped me a lot in the beginning ! Very happy you came across this video :D

    • @brad3262
      @brad3262 Před 2 lety +4

      @@yoshtm the

    • @gamefun2525
      @gamefun2525 Před 2 lety +5

      @@brad3262 th

    • @ventrys
      @ventrys Před 2 lety +4

      @@gamefun2525 ok

    • @DarthMaulOfficial
      @DarthMaulOfficial Před 2 lety

      @@yoshtm This is a lame video ai has been able to do this since the 1970s

  • @antonnym214
    @antonnym214 Před 2 lety

    Super-interesting! I found you by accident and subscribed immediately. Thank you! Very smart stuff. I love it.

  • @alhdlakhfdqw
    @alhdlakhfdqw Před 2 lety

    great video Yosh thank you very much for your great effort! subbed :)

  • @wouter8596
    @wouter8596 Před 3 lety +454

    The last clips are basically a fluids simulation 😂

    • @CallumAtwal
      @CallumAtwal Před 3 lety +8

      The first bit of the track looks like a sink trap/u-bend 😂

    • @blue.dt2000
      @blue.dt2000 Před 3 lety +1

      I thought the same

  • @enzozeb
    @enzozeb Před 3 lety +476

    Left, Right and Floor it. The only three inputs a true racing car ever needs.

    • @xcruell
      @xcruell Před 2 lety +24

      Oh and the handbrake of course, for drifting really sharp turns with style and speed.

    • @Raterex
      @Raterex Před 2 lety +1

      I prefer the bang bang bang => wasted strategy =D

    • @manz7860
      @manz7860 Před 2 lety +1

      @@xcruell it wouldn't be as efficient so it'd probably cut all the nonsense out

    • @reubenbetts7537
      @reubenbetts7537 Před 2 lety +4

      @@manz7860 have you played trackmania before?

    • @ke6gwf
      @ke6gwf Před 2 lety +5

      You can get rid of one of those inputs in Nascar. Makes it simpler... Lol

  • @overratedprogrammer
    @overratedprogrammer Před rokem +1

    There needs to be more content like this. I would literally watch videos of every single popular game even though it's the same algorithm

  • @jamescarroll489
    @jamescarroll489 Před 2 lety

    Great video, structure and explanation!

  • @nak_attak
    @nak_attak Před 3 lety +605

    This just goes to show that even in a world where geniuses are all around you, some idiots decide to bash their heads on the wall instead

    • @sulosky
      @sulosky Před 3 lety +43

      Enough idiots banging their heads will finally get through.

    • @Redbikemaster
      @Redbikemaster Před 3 lety +17

      @@sulosky brute force method

    • @Mansory811
      @Mansory811 Před 3 lety +3

      @@sulosky thats deep

    • @quantumsoul3495
      @quantumsoul3495 Před 3 lety

      It's more people born without legs

  • @isaie7144
    @isaie7144 Před 3 lety +4500

    En 0.0005 secondes, j'ai compris que j'avais affaire à un français haha

  • @MrPooPooJohn
    @MrPooPooJohn Před 2 lety

    This is mind-blowing btw. Great work.

  • @sycips
    @sycips Před 2 lety +1

    Impressive that you created this for Trackmania! Two major things you could have added are penalizing bumps, which slow down the car, and make the AI able the break, which is necessary in some tracks. Even though this isn't added, it was fun to see what your results were. Great job!

  • @Barde_Jaune
    @Barde_Jaune Před 3 lety +1515

    The French is strong with this one.

    • @akmedia8206
      @akmedia8206 Před 3 lety +123

      Algorizzum

    • @M-Cube_
      @M-Cube_ Před 3 lety +104

      It's funny, coming from a language where the 'h' is silent, he puts in so mich effort to pronounce words like "how" right that he even does it with words like "hour" - where it's actually silent in english as well! :-D
      (no offense, just something I noticed)

    • @Brabldibrablmann
      @Brabldibrablmann Před 2 lety +51

      He sounds like he had 1 hour to learn english pronounciation and then had to read the script

    • @onclebob
      @onclebob Před 2 lety +11

      Oui oui

    • @valovanonym
      @valovanonym Před 2 lety +45

      @@Brabldibrablmann trust me, even after years of speaking english, my prononciation isn't much better

  • @Ben.N
    @Ben.N Před 2 lety +1

    Amazing video. Inspirational 😎

  • @vinod8941
    @vinod8941 Před rokem +3

    Along with the wall distances and car speed you should also add the car direction as an input. This should help in turns significantly. Also if you take vectors across 180 degrees for measuring wall distances, it can increase the accuracy of the algorithm.

  • @McNab1986
    @McNab1986 Před 3 lety +929

    I feel like not using wall hits as an elimination category was an oops moment

    • @whatelsula
      @whatelsula Před 3 lety +41

      I don't know. AI who learn to follow the wall will progress, a contrario of AI doing circles.

    • @ziero1986
      @ziero1986 Před 3 lety +187

      @@whatelsula Could have also made 'backwards progress' on the track an elimination category too. This way they AI would have learned to not hit walls and/or go the wrong way on the track.

    • @whatelsula
      @whatelsula Před 3 lety +18

      @@ziero1986 Yes, but maybe not for the first generations, I think.

    • @anthonycarless1748
      @anthonycarless1748 Před 3 lety +75

      Yep, even the fastest in generation 100 still slammed into that wall before the chicane

    • @Solaris428
      @Solaris428 Před 3 lety +24

      Didn't you wonder wether or not it was a good strategy? Maybe it makes you faster overall even if you lose some speed the moment you hit the wall.

  • @Jagd204
    @Jagd204 Před 3 lety +196

    "-Hey Terminator, how did Skynet ever become so powerful?"
    "-Gaming."

    • @siriusczech
      @siriusczech Před 3 lety +11

      This reminds me of how they let supercomputer play a Civilisation game against normal AI. You know, the game that you can win by many possibilites - Space race, Culture race, Political race, Technology race, use diplomacy etc.... or go tryhard and conquer most of the world.
      The supercomputer was learned those rules, possibilites of win, conditions of technologies ... and after some calculations he entered an absolute warmonger scenario, flooded the map with his units and crushed every opposition he ever faced. It was ... disturbing to say at least and worrying to see a "normal AI" thinking of such a result and then to execute it brilliantly.
      Don´t know the algoritm used or any details, it just stays in my mind as a memory of an article i once read

    • @icollectstories5702
      @icollectstories5702 Před 3 lety +2

      _WarGames_ the 1983 movie. To a computer, reality is a simulation.

    • @alexejfrohlich5869
      @alexejfrohlich5869 Před 3 lety +3

      ​@@siriusczech you may want to account for the artificially created environment and the limits it provides the AI to deal with, introducing a general bias towards warmongerism as the best strategy in this context. This might be a general bias in the game system (war is always stronger than any other type of progress towards victory) OR the lack of collaboration benefits. Which are always there as long as the ultimate goal is a "winner takes it all" mentality. The winning conditions of Civ are that you need to be the guy on top. The first one. So collaborating is only worth if you are still the one getting out of it on top which deminishes the whole purpose of collaboration in the long run. The game's system and winning conditions would need to be adjusted if you want the "true" AI (not the algorithms just called "AI") to come out on top without killing everyone :D

    • @siriusczech
      @siriusczech Před 3 lety

      @@alexejfrohlich5869 it strongly depends on the nationality of AI - some civs have significant bonuses there to be able fo fulfill other types of victories (tech race or cultural race is one of them) and this thing doesn´t require too much giving up of any other strategy gameplay - like that you couldn´t build a strong or high tech army in the first place.
      The issue there was that no matter the nation, no matter those conditions, it ALWAYS flooded the map with tons of cheap units, somehow achieving the victory despite it pissed of every nation one after another and it didn´t care for diplomacy or other things neither as much as you would think it will be - just a brutal 1000 turns raid on barbarians, trading only something and with strentgh in counts it defeated even those that it (based on numbers) shouldn´t defeat. And that was interesting on it whole - that perfectly "thought-through" assault is probably the easiest and most viable strategies even in this world, no matter other facts.
      That the problem with humans is that even dictators cannot wage war against such computing force.

    • @alexejfrohlich5869
      @alexejfrohlich5869 Před 3 lety +1

      @@siriusczech might be that there are bonuses, but it still looks like waging war is just the "best" strategy in this game system. also it is most likely the easiest accessable. if the AI is beating everything by spamming units also exposes a general flaw in the game system that was there the whole time. the AI is just taking advantage of it. so it looks like "killing" is the best strategy for the AI but actually, it is the best strategy within this artificial system. the AI just makes it clearly visible.

  • @MalakaiPrograms
    @MalakaiPrograms Před 2 lety +1

    This is a great video. Very informative, and delivered amazingly. FUCK YEAH!

  • @BalthazarMaignan
    @BalthazarMaignan Před 2 lety

    Super intéressant ! Continue gars !

  • @ShiroGojo
    @ShiroGojo Před 3 lety +481

    Le bon accent de Vendée on le sent on l'entend il fait chanter nos tympans :x

    • @Daneri42
      @Daneri42 Před 3 lety +26

      je me disais aussi que yavais un ptit goût de brioche 😅

    • @ShiroGojo
      @ShiroGojo Před 3 lety +11

      @@Daneri42 Ah la c'est la gâche carrément :v

    • @labonisk6504
      @labonisk6504 Před 3 lety +2

      Mdr x)

    • @Daneri42
      @Daneri42 Před 3 lety +1

      @@ShiroGojo miam

    • @clementgodard
      @clementgodard Před 3 lety +1

      Plutôt bocage où littoral ?

  • @IAMDIMITRI
    @IAMDIMITRI Před 3 lety +194

    So the cars don't seem to be able to predict a turn. If you want them to be able to predict a turn you need to eather increase the resolution, so that AI would be able to see an oncoming turn. Or increase the neural resolution both to allow cars to process different turn radius and temporal resolution so that cars can hold and remember certain turns.
    Small or wide turn do look similar to the AI and AI needs a way of distinguishing between them.
    That's the difference between simple stimuli respondent AI and another one that can better generalize the problem.

    • @Obi-WanKannabis
      @Obi-WanKannabis Před 3 lety +17

      plus in a track you may have to tackle a corner differently based on what corner immediately follows it, not sure how to do that here though

    • @IAMDIMITRI
      @IAMDIMITRI Před 3 lety +9

      @@Obi-WanKannabis I'm sure that with bigger network AI could simply learn the map. Or learn how to learn the map.

    • @MikkoRantalainen
      @MikkoRantalainen Před 3 lety +19

      I think an easy way to provide "memory" of track layout would be to give it list of vectors from the center vector towards the way track is going. For some tracks, the best curve through a corner depends on two following corners. If you don't provide even a rough info about those corners, the AI can never excel.
      With the current input, the best that AI can ever do in theory is to play at roughly level of human driving any map for the first time.

    • @harmenoosterhof9604
      @harmenoosterhof9604 Před 3 lety +6

      Wouldn't it be easier if you could somehow say "The AI driver hit the wall, eliminate this AI driver." And then just measure time at the checkpoints? Base your fitness level on the checkpoint times. That way the AI would have to find the fastest way to a checkpoint without hitting a wall.

    • @IAMDIMITRI
      @IAMDIMITRI Před 3 lety +4

      ​@@harmenoosterhof9604 I think there might be evolutionary peaks and valleys.
      As in: AI have to do something unproductive for couple of generation before it can improve. As in AI has to drive close to the wall without hitting the wall, I bet that most would hit the wall and get lower score thus those genes not surviving at all.
      And even if you manage to train AI to hug the wall. It still needs to know what wall to hug.
      So you need deeper network to learn and predict corners and hug walls at the optimal time.

  • @kamikeserpentail3778
    @kamikeserpentail3778 Před 2 lety

    It's always neat to see these.
    And wow, I recognize some of this music.

  • @Dragonmastur24
    @Dragonmastur24 Před 2 lety

    your combined run clips remind me of how a light pulse spreads out in a fiber optic line! a pretty good representation if ya ask me :D

  • @bucketlynx
    @bucketlynx Před 3 lety +397

    Bro I can just sense the French in his English

    • @metalvideos1961
      @metalvideos1961 Před 3 lety +47

      you have to be deaf not to hear that

    • @JakSpate
      @JakSpate Před 3 lety +4

      @@metalvideos1961 Im a Brit Naniiii I hate france

    • @Aquanixity
      @Aquanixity Před 3 lety +9

      @@JakSpate bonjour

    • @Antiork
      @Antiork Před 3 lety +3

      this guy is not an indian?

    • @oscarl2370
      @oscarl2370 Před 3 lety +3

      @@Antiork lol no, listen at his pronunciation of r and you'll see

  • @EvilTaco
    @EvilTaco Před 3 lety +67

    I feel like the reason they're not performing as well is that they're very limited in what they can see. They can only see the walls right in front of them, so they can't think ahead for the next curve and account for it, which is why they always run into that one wall in the curve

    • @Cuahchic
      @Cuahchic Před 3 lety +4

      This is where better features would help. You can see in the long straight sections the car seems to travel at a weird angle, this is because the distances to the wall aren't relevant for the straight, the next corner information is.
      Is there a GitHub repository for this code?

    • @dubtor
      @dubtor Před 3 lety +6

      seems like the the measured input parameters (wall dists and speed) are reaching its limit regardless of the number of future iterations. Certain curves or curve combinations look "same" to the AI whilst in fact the AI should understand that they are not the same ahead of time (by measuring other/additional parameters). Because there is a limited number of curve types and thus combinations of them in TM one could try to make the AI "see" which ones they have at hand and learn accordingly. Imo this way the record of the reference driver may be broken. Also does the AI steer inputs between 0-100% or always 100%? Maybe this adds extra friction and therefore slowdown?

    • @amicaze9570
      @amicaze9570 Před 3 lety +2

      @AE Templates Rather than making it map specific, a better solution would be to give a line of sight that correspond to different track pieces. For instance if you use circles and curves as LoS, the AI will be able to see past the bends into the turns. The good thing is that with this kind of learning algortihm, you shouldn't need to do complicated stuff, the AI should figure it out on its own.

    • @Buglin_Burger7878
      @Buglin_Burger7878 Před 3 lety +3

      @AE Templates Well actually it is we can see over the walls, even without know the turns ahead of time you can see the track ahead of you. If you want the test to be fair... you'd need to recreate the track with walls a human couldn't see over... in which case you'd see humans advance similar to the AI. Slamming into the walls or going too slow... while we'd learn "faster" we'd learn basically the gap between generations.
      In other words, comparing AI to humans here is completely unfair as we have two different tracks.

    • @Trygeve
      @Trygeve Před 3 lety +1

      hi taco.

  • @TechWithKishan269
    @TechWithKishan269 Před 2 lety

    Bro, this guy. I work in IT and still don't understand how you mad mad mad genius code this stuff! Great video!

  • @megamax1932
    @megamax1932 Před 2 lety

    This was the video that got me into track mania

  • @WwZa7
    @WwZa7 Před 3 lety +453

    "Turn left, turn right, and accelerate"
    Robots don't need brakes nor breaks.

    • @abrightguy508
      @abrightguy508 Před 3 lety +11

      Acceleration means the rate of change of speed which also includes slowing down

    • @ImyoCello
      @ImyoCello Před 3 lety +17

      @@abrightguy508 there is much more than that into obtaining the best track time, you need to be able to slow at a faster rate than the one given to you by the game wich is basically lack of acceleration and how fast the game brakes on its own, because the doesnt use physics, it uses numbers, so its a given break strenght number, you are able to increase that number, thats an action, so yeah, if AI cant even do that its missing quite a lot already. This assuming this is all real and not just show, but hey, its fun to watch regardless.

  • @lzfix8188
    @lzfix8188 Před 3 lety +110

    Damn every episode is better than the other, this project is just too cool man, keep it up! :D

  • @firethenoob1012
    @firethenoob1012 Před 2 lety

    just got this recommended awesome!

  • @TheWizardsOfOz
    @TheWizardsOfOz Před rokem +1

    This is amazing and fascinating.

  • @benjikrafter
    @benjikrafter Před 3 lety +184

    There’s a bunch of ways to “outsmart” genetic algorithms by teaching certain skills you previously knew were important before teaching the primary goal. For example, teaching not to hit walls or turning as little as possible. Using this you’ll have a more refined base AI to learn the track. I’d love to see you try something like this again using this method!

    • @TheRealMeatwad
      @TheRealMeatwad Před 3 lety +9

      I wonder if a directive to simply have the maximum amount of space between the front of the car and the wall directly in front would give the best result.

    • @sakethram6496
      @sakethram6496 Před 3 lety +5

      @@TheRealMeatwad That would be very inefficient....it isn't how apex of a corner works

    • @TableEnMousse
      @TableEnMousse Před 3 lety +2

      Yeah, part of thinks it would have been better if the simulation was stopped as soon as the car hit the wall; although I know nothing about A.I learning. That's just a hunch.

    • @sciencemanguy
      @sciencemanguy Před 3 lety +4

      @@TheRealMeatwad Congratulations, the car will now stay still and not move!

    • @TheRealMeatwad
      @TheRealMeatwad Před 3 lety +2

      @@sciencemanguy, obviously you also use other parameters for accelerating while the distance part is used to to determine facing, not speed. But I didn't clarify that in the original post so I guess I deserve that.

  • @diariaking2476
    @diariaking2476 Před 3 lety +186

    The AI could probably do better if there are more “sight” lines clustered toward the front allowing it to make more precise movements.

    • @jouniranta-puska4699
      @jouniranta-puska4699 Před 3 lety +21

      I was about to say this as well. As it is now, I feel like it's handicapped compared to a human.

    • @camilohurtadoacero7233
      @camilohurtadoacero7233 Před 3 lety +10

      yes, AI resolution of data is to weak. But at 11:45 of the video, the AI makes a corrective movement to the left, because he wants to be in the center of the track, not on the fast lane. You could prioritize the ahead distance so AI dont make to much of an anticipate move.

    • @hotel_arcadia
      @hotel_arcadia Před 3 lety +1

      @@camilohurtadoacero7233 That's because the AI was trained to just finish the track, not get the fastest time.

    • @teslamodel314
      @teslamodel314 Před 3 lety +1

      I wonder if it remembers the next turns. If not, it will never improve as much. It just learn to drive in a track as if it is the first time it drives it. I think Trabadia drove the map some times before realizing the best time. Is it true? How many times did he try?

    • @frenchgeek1306
      @frenchgeek1306 Před 3 lety

      czcams.com/video/yZFY5ZJtgyM/video.html

  • @arnabgon1157
    @arnabgon1157 Před 2 lety

    13:32 THE routes taken by the cars look like a mycelium, beginning to explore a surface looking for food. Damn trippy.

  • @PapaBass
    @PapaBass Před 2 lety

    The clips at the end look like some liquid going down a tube. Thats super satisfying!

  • @jakeb5121
    @jakeb5121 Před 3 lety +111

    13:33 this just makes me think about how long this must have taken to render

  • @Avetho
    @Avetho Před 3 lety +121

    I love how at the end following Trabadia's car its like he's escaping the tidal wave of AI like its an action movie or something XD

    • @nomadMik
      @nomadMik Před 3 lety +2

      I thought the same thing. And the ones that turn around always make me laugh. 🙂

    • @Kharnellius
      @Kharnellius Před 3 lety +4

      Would make for an intense game, especially if you had a mini turret on the back.

    • @btf_flotsam478
      @btf_flotsam478 Před 3 lety +3

      It almost looks like he's playing it in slow motion.

    • @HIkaruSashimi
      @HIkaruSashimi Před 2 lety +1

      It's like his car is outrunning a zombie horde.

  • @MigunoOS
    @MigunoOS Před 2 lety

    When you ad extra time you see the brilliance of the ai, it applies what it had learned from the previous part

  • @milehighgambler
    @milehighgambler Před 2 lety

    Keep at it man!!! You can do some impressive stuff with AI if you get it down. You got yourself a new subscriber

  • @M8cool
    @M8cool Před 3 lety +34

    13:32 was so trippy!

  • @R4GEcraft
    @R4GEcraft Před 3 lety +44

    fun fact about this video :
    The narrator'a accent have been mentionned 26 times in the comments.
    26 out of 26 are french guys making fun of it.
    0 out of 26 are "international" english speaking people claiming it interfered with their viewing experience.
    Conclusion : french should shut the fuck up when one of them speaks english

    • @yoshtm
      @yoshtm  Před 3 lety +4

      Interesting comment !
      I know my accent isn't very good. If I make another video with voice-over, maybe I'll try to make it in French with English subtitles, I'll have to think about it.
      If any of you have a constructive opinion on this, please let me know :)

    • @verticalgaming9042
      @verticalgaming9042 Před 3 lety +4

      @@yoshtm The whole point of the comment is to say that your accent is fine and there is nothing wrong with it. You're a perfectly understandable and should keep doing what you do.

    • @razaanbotutihe7420
      @razaanbotutihe7420 Před 3 lety

      @@yoshtm no, keep voice ovet with english language, not only it will improve your english (im assuming english isnt your 1st language), and that way you can train your english speaking ability, and can attract more viewers.

    • @Advenyx
      @Advenyx Před 3 lety

      @....... Tu feras gaffe, ton anglais est plus propre que ton français...

    • @randowdude6847
      @randowdude6847 Před 3 lety

      Conclusion: everybody hates french people

  • @jakobleck8600
    @jakobleck8600 Před 2 lety +1

    Great video! Suggestion: The decision making input that is optimized is trained against a global constraint (distance travelled or time to checkpoint), whereas the effect of each steering input is only over the next few seconds. Maybe evolution might run faster or yield better results if you train the decision process with a fitness function that depends on those short-time effects, e.g. the average velocity over a certain short time interval?

  • @ruukaoz
    @ruukaoz Před 2 lety +1

    it would be interesting to so see how the A.I. would tackle the challenge if the map would mutate in slight ways, and how it would affect the learning.

  • @neyth1942
    @neyth1942 Před 3 lety +20

    Je regrette pas de m'être abonné avec la première vidéo, super hâte de voir la suite !

  • @EddieOtool
    @EddieOtool Před 3 lety +61

    13:32 That's a great shot!

  • @justarelaxednerd3520
    @justarelaxednerd3520 Před 2 lety +1

    En tant que français, j'ai tout de suite reconnu d'où tu venais ptdrr
    Superbe vidéo sinon, et très beau travail !

  • @luvinthejazz
    @luvinthejazz Před 2 lety

    The final runs remind me of water flowing down a stream bed. It shows why a river has curves. The particles collide with and erode the outside of the curves, and leave deposits on the inside of the curves.

  • @StyggeOrd08
    @StyggeOrd08 Před 3 lety +31

    Nobody:
    A chocolate bar in my pocket: 13:32

  • @tmaster2151
    @tmaster2151 Před 3 lety +300

    13:00 the girls in your dms after you get rid of that yee yee haircut

  • @smallejector5266
    @smallejector5266 Před 2 lety +1

    The best AI explanation I have seen, makes it very understandable, thank you.

  • @mmdhd9667
    @mmdhd9667 Před 2 lety

    Map knowledge is also really important becasue it determains how to approach a curve . Its good to generelize the curves and the relationship between them

  • @remink3092
    @remink3092 Před 3 lety +57

    I love this serie of videos !
    If you continue to do this type of videos, could you one day make a sort of "making off" video where you show us more about the code, the process to create these scenes with 100 cars driving on the same course or the way you create new AI to a next generation? I would love to learn more about this subject !
    Ps: french team, lets go !

    • @nezziaktm9922
      @nezziaktm9922 Před 3 lety

      Watch the videos of code Bullet

    • @eMgotcha77
      @eMgotcha77 Před 3 lety

      Is it a mod for TrackMania ? How can he control so many cars in TrackMania?

  • @TheExplosiveGuy
    @TheExplosiveGuy Před 3 lety +12

    That last compilation of all the runs together, looks like a marble run from overhead, the way they all bounce off corners in the same spots, and all the erratic moving back and forth, just like marbles.

    • @thetinyurlguy
      @thetinyurlguy Před 3 lety

      AI: Jelle's Simulated Marble Runs
      Martin: I'm still making the Wintergatan MMX physical

  • @williamknowles-kellett
    @williamknowles-kellett Před 2 lety +2

    It's interesting to me that they take wide turns. Because their inputs come from raycasting, they can't see around the turn like Trabadia. By taking the turns wide, they can see better.

  • @LinuxDog
    @LinuxDog Před 2 lety

    Underrated channel

  • @JohnSmith-rf1tx
    @JohnSmith-rf1tx Před 3 lety +49

    I feel like using shortest split times from one checkpoint to the next might give better results. Maybe there's a car that doesn't do sections 1 and 2 very well, but kills it on section 3 where every other "well performing" car is having lots of trouble. If your fitness function is only time to end point, you're going to miss out on some more targeted improvements.

  • @randomshadow4620
    @randomshadow4620 Před 3 lety +114

    Imagine an AI who knows how to find shortcuts.

    • @nuarius
      @nuarius Před 3 lety +18

      that is the inevitable outcome of a well developed self learning AI. Shortcuts and exploits....

  • @pokerstart377
    @pokerstart377 Před 2 lety

    Super vidéo continue comme sa

  • @thomaskleine6121
    @thomaskleine6121 Před 2 lety

    Thank you for that explaining

  • @anothervoyager9654
    @anothervoyager9654 Před 3 lety +5

    It is amazing how close it looks to a fluid passing through a tube.

  • @TA_Plus_Hemi
    @TA_Plus_Hemi Před 3 lety +43

    Bro I love the fact you pronounce the H in hours. My wife cringes every time I do it.

    • @quantumsoul3495
      @quantumsoul3495 Před 3 lety +10

      He speaks french and we don't have H in our pronunciation. So in english class we learn to pronounce the H. We do it every time we see a H in english now

    • @Aelfraed26
      @Aelfraed26 Před 3 lety +6

      I stand with your wife.

  • @KilianKlein
    @KilianKlein Před 2 lety +8

    What if the fitness function included the shortest distance driven to reach the finish line as well as the time? (with a timeout for those that never make it anyways of course) Wouldn't that make the AI learn that straight lines are usually faster?

    • @lexmitchell4402
      @lexmitchell4402 Před 2 lety +1

      @killian Klein although that might optimise better behaviour on straights sooner, it is quite likely that would be a negative overall. A typical racing line is about the average speed a car can hold around a turn as well as the distance. Optimising for distance could hurt corners, optimising for time should eventually give the best model.

  • @boneshakerjake
    @boneshakerjake Před 2 lety +1

    its like watching an ant colony all working together making a giant flat space its... kinda mesmerizing

  • @donadigotm
    @donadigotm Před 3 lety +4

    Always love seeing videos like this! Well explained concepts and presentation. I'm sure a lot of work has been put into this one.

    • @yoshtm
      @yoshtm  Před 3 lety +1

      Thanks ! and thank you also for your help with Openplanet :)

  • @robertmangan804
    @robertmangan804 Před 3 lety +57

    Code bullet watching this be like: *sweats*

  • @henryshadow7217
    @henryshadow7217 Před 8 měsíci

    I love this series

  • @homer46303
    @homer46303 Před 2 lety

    I still have a ways to go to learn how to do this but I would consider starting from the beginning and adding a time penalty for hitting the wall or getting within a certain distance of the wall. This could help the auto selection process to wittle out the AI that make time wasting mistakes. I was reminded of 3b1b's video on gradient descent about finding a false bottom which is a problem that's hard to solve with machine learning.

  • @raphaelturrasprenger7394
    @raphaelturrasprenger7394 Před 3 lety +19

    If reality is a big simulation, probably I'm one of those cars that did go backwards.

    • @Litorax
      @Litorax Před 3 lety

      Reality has not to be a simulation, this simulation is based on reality.

  • @jnmaietta
    @jnmaietta Před 3 lety +27

    One thought, could the AI be slamming into walls because they don't have brakes built in as a response? From what you mentioned, they can only turn and accelerate. Would explain the lack of learning and inability to approach human times past that certain point.
    Anyways, the whole video is awesome and I wanted to give you specific props on the editing and overlays on this. Really help visualize concepts. Idk how you select which runs to run together in clips, or how you got that shot sitting in the middle of the track with cars going by, but they were great visualizers.

    • @yoshtm
      @yoshtm  Před 3 lety +10

      Thanks !!
      You don't need brake on this specific map, Trabadia didn't use brake in his run for example. And the AI is still able to stop accelerating. But brake would be useful in more complex maps.
      It's easy to sort replays in folders, and to select and edit specific replays ingame. And there are tools to edit camera shots ingame.

  • @abofim5201
    @abofim5201 Před rokem +2

    cool video mon gars

  • @maxhouseman3129
    @maxhouseman3129 Před 2 lety

    Very interesting! For me the movement of all cars looks like a water stream moving through a pipe.

  • @BarraNZ
    @BarraNZ Před 3 lety +11

    Trabadia? This hasn't aged well

  • @daswasich1147
    @daswasich1147 Před 3 lety +6

    9:50 uuuuh... that just didn't age well

  • @mastermind1677
    @mastermind1677 Před rokem

    I wish I could also do these things, I am learning, I want to make a neural network in python, I saw some videos and didnt understand them fully, I do have some prior knowledge and experience on python, but now im trying to learn more deeply, then I will return to neural networking..
    Good job, I really enjoyed the vid, thnx

  • @bartvandelint
    @bartvandelint Před 2 lety +1

    you should add a fitness function for distance traveled between checkpoints as well, while this would make the cars take the inside of corners

  • @harryaddlesee6529
    @harryaddlesee6529 Před 3 lety +5

    I watch code bullet and riolu a lot and you’re like a mix of them both. Love these types of videos :)

  • @NaThingSerious
    @NaThingSerious Před 3 lety +10

    It is so satisfying watching the hundreds of cars drive all over track like a wave

  • @eLasmc
    @eLasmc Před 2 lety

    You did more science for one Video than i did for my master thesis in cs

  • @ifvictorthen10
    @ifvictorthen10 Před 2 lety +2

    Great video! Currently your AI have a reactive approach to each frame of information it receives. Maybe you can give to the AI the current frame along 3 or 4 past frames so it can generilize the concept of speed and direction.

    • @DamienKoda
      @DamienKoda Před 2 lety

      cause it use a NN instead of a LSTM

  • @hencethebeetroot
    @hencethebeetroot Před 3 lety +60

    Running from zombies in real life: There's a lot of them, better walk fast
    Running from zombies in movies: 14:27

    • @lekonai
      @lekonai Před 3 lety +3

      running from zombies in real life? whaa

    • @lekonai
      @lekonai Před 3 lety

      @@mebe6474 you what

    • @cinegraphics
      @cinegraphics Před 3 lety +1

      The red one is Neo.
      The blue ones are agents Smith.

  • @jasonpeace1991
    @jasonpeace1991 Před 3 lety +43

    This ai has a disadvantage vs humans its data for oncoming track is all at the lowest possible level humans can see on coming corners before they are in direct line of sight therefore the ai is having each corner blind and without being able to see if the corner tightens ahead or snakes into another corner

    • @Gelikafkal
      @Gelikafkal Před 3 lety +7

      yes. I'm sure the AI would be able to beat even the best humans, when it is given enough information. It's very hard to give it the required information without making the evaluation of the AI too complex to be run in realtime though

    • @Tewty11
      @Tewty11 Před 3 lety +7

      On the other hand, AI has an advantage over humans, time, it could literally do this forever. If you could automate the process, and allow itself to delete down bad performances, and generate new ones, eventually it would be perfect on this track.
      Ultimately becoming sentient, and destroying us all.

    • @RiccardoPazzi
      @RiccardoPazzi Před 3 lety +5

      @@Tewty11 I think It really depends on how it's programmed, the fact the AI learns slower as time goes on means it has reached a local maximum, and depending on the algorithm it could never improve beyond that. Biological evolution had millions of years and billions if not trillions of "test subjects". Once AI reaches this kind of scale then I think we could see some serious competition with humans.

    • @spaceygnat19908
      @spaceygnat19908 Před 3 lety

      You could remove its vision and reward point for every check point it would take longer to learn but the end result would be an ai that just know when to press the right button at the right time more precise then a human would ever be.

    • @Voidsway
      @Voidsway Před 2 lety

      @@spaceygnat19908 this here is the right answer. One that doesn't require visual input, would yield the highest track time but comes with other problems.
      The issue with visual Input is that there needs to be a larger over view of the track so the ai could predict it's next move, rather then react.

  • @ghosttwo2
    @ghosttwo2 Před 2 lety

    Try incorporating race time into your fitness function. Something like f = Distance * (1 + 100/time) where time is set to some absurd constant if they don't finish; this creates two tiers, with the first one working their way to track completion, and the second tier improving their times. Might also be worth adding an extra layer to the network and see if it improves anything, along with a couple extra inputs like 'am I drifting'.

  • @dnny5787
    @dnny5787 Před 2 lety

    Thanks for information