AI Plays Snake Using Pathfinding

Поделиться
HTML-код
  • Опубликовано: 29 май 2019
  • Thanks for 2000 subscribers! I really appreciate it.
    I'm still working on putting together the video for my GAN project, I want to make it as in depth as I can which is taking a while.
    In the meantime this project was made over a year ago and I just thought I'd share it in light of the SnakeAI videos boom in popularity.
    GitHub Repo: github.com/greerviau/SnakeAI-...
    Twitter: / greerviau
    Support me on Patreon: / greerviau
    Song: Ode to Her - Josh Cominelli
    Soundcloud: / josh-cominelli
  • НаукаНаука

Комментарии • 63

  • @Guinea.Pig-Gaming
    @Guinea.Pig-Gaming 4 года назад +52

    "The path isn't very elegant"
    It's the coolest thing I've ever seen.

  • @Rostol
    @Rostol 5 лет назад +112

    i think you misunderstood, you got 2k subs beacuse you make interesting videos and put the code up on github for us to fool around. congrats and keep it up.

  • @Ramash440
    @Ramash440 4 года назад +12

    3:05 - And the snake thought "Screw this square in particular".

  • @angrycoder
    @angrycoder 4 года назад +17

    It's really a cool video. I am amazed with the fact that your algorithm can do some predictions of which path it should follow even though there's a snake body present at the moment 3:31

    • @sidheshwartiwari9834
      @sidheshwartiwari9834 Год назад +1

      If I am not wrong, he basically calculates the total length of the body and the total number of blocks needed to reach the food and then calculates how many wraps around the body would be needed to reach the point where the body is exactly when it moves out.

  • @blemone7481
    @blemone7481 5 лет назад +16

    Love it! And I love your videos. Just discovered your channel from that snake video (hehe) but it’s really enjoyable to watch. Keep up the great work :)

  • @telenezthon2.094
    @telenezthon2.094 5 лет назад +8

    It's really a great pleasure to see your video, keep doing your stuff cause I love it

  • @ericsheng4043
    @ericsheng4043 5 лет назад +9

    The music makes me feel so comfortable

  • @autismo1969
    @autismo1969 4 года назад +4

    That's actually fucking sick my dude 👏👏 great job

  • @indivarmishra6119
    @indivarmishra6119 5 лет назад +3

    Amazing work dude loved this video

  • @gongjiaji2489
    @gongjiaji2489 4 года назад +1

    amazing improvement.

  • @fovlsbane
    @fovlsbane 5 лет назад +2

    This is awesome.

  • @achievers-thoughts
    @achievers-thoughts 4 года назад +1

    This video inspired me 😍

  • @mengyetlanborn6948
    @mengyetlanborn6948 5 лет назад

    Excellent !

  • @Matteo_dev
    @Matteo_dev 5 лет назад +1

    AMAZING!!!!!!!

  • @diogeneslantern18
    @diogeneslantern18 5 лет назад

    Mind blowing :)

  • @qsmfoui
    @qsmfoui 4 года назад

    Wow amazing work dude. Do I find your AIs also on your github? I want to understand how this works

  • @gxost_off
    @gxost_off 3 года назад

    Broo... Keep doing videos, I need your help! You are motivationg me. I'am recent on your channel, but I interested in AI too. Also don't forget it, never give up, because everything is possible.

  • @Hitori_FtoL
    @Hitori_FtoL 5 лет назад

    Awesome

  • @mikoajczajkowski7799
    @mikoajczajkowski7799 5 лет назад +1

    Dude thats genius

  • @larryteslaspacexboringlawr739
    @larryteslaspacexboringlawr739 4 года назад

    thank you for ai playing game video

  • @aayamshrestha9084
    @aayamshrestha9084 5 лет назад +3

    Awesome work! I was just wondering if the evolutionary algorithm could be used for better heuristics, Is there even a perfect snake agent?

    • @GreerViau
      @GreerViau  5 лет назад +1

      The heuristic in this case is simply Manhattan distance to the food. I dont think using an evolution algorithm to model a heuristic would be beneficial.

  • @ourflagismined4129
    @ourflagismined4129 4 года назад

    Now this is Snake played right!

  • @mihaept822
    @mihaept822 5 лет назад

    Wow!)

  • @shoyoHxC
    @shoyoHxC 5 лет назад

    Asombroso

  • @fiyenyan5534
    @fiyenyan5534 4 года назад +1

    I wonder if this snake also uses the AI algorithm similar to your last snake but just changes the pathfinding method?

  • @JesterTheCrazy
    @JesterTheCrazy 5 лет назад

    wow

  • @sir_slimestone3797
    @sir_slimestone3797 4 года назад +3

    Ok, two things, number one, how the hell did you get A* to account for the fact that certain blocks may not be there by the time it gets to a location. All implementations I've seen of A* assume the map is static and don't account for movement so please explain. I'm really curious as to how you did this!

    • @nnvskh8269
      @nnvskh8269 3 года назад

      did anyone find an answer for this?

    • @sir_slimestone3797
      @sir_slimestone3797 3 года назад

      I haven't, I'd love to know how he got A* to account for movement

    • @markphan179
      @markphan179 2 года назад

      I think this can be achieved by 3-dimensionalizing the map. In particular, let's say a[x][y][z] is the square (x, y) at the time z. You can realize that a square can only be either occupied / unoccupied at a unit of time. So by doing that we created a 3D map that is static, thus we can do A* on it like normal maps.
      The only flaw I could think of this approach is the z dimension is infinitely expanding, so we'll reach a point when we run out of memory.

  • @douradesh
    @douradesh 2 года назад

    maybe you can minimize a function that measures the energy taken by the snake to reach the red dot. maybe it should be able to create more elegant paths.

  • @astrelcoff
    @astrelcoff 5 лет назад

    I think that such an algorithm will be useful for driving unmanned vehicles in a future automatic traffic control system.

    • @lamelo3998
      @lamelo3998 4 года назад

      Андрей Стрельцов too much work. Sensors are much more efficient.

  • @m6tmeizu790
    @m6tmeizu790 4 года назад +1

    круто

  • @aimanfaris2118
    @aimanfaris2118 5 лет назад

    Hey ..may I know how do you learned all of this? Any sources/references?.. I just know the basics of AI, but never knows how to develop this kinda thing

    • @GreerViau
      @GreerViau  5 лет назад

      RUclips tutorials are a great place to start if you have a project in mind. If you want to look into the academics of different algorithms I'm a big fan of mit open coursesware. Mit 6.S094 is a great course on deep learning.

  • @muhammadehsan7409
    @muhammadehsan7409 5 лет назад

    Hi you done a great job I want learn AI where I start

    • @GreerViau
      @GreerViau  5 лет назад

      RUclips tutorials and online lectures are where I started

  • @kikawet
    @kikawet 5 лет назад +1

    Is there any link to the code?

    • @GreerViau
      @GreerViau  5 лет назад +2

      Just linked it in the description. Code is pretty gross though

  • @creativecraft_mc
    @creativecraft_mc 3 года назад

    20,000th

  • @ranam
    @ranam 4 года назад

    Do you like to apply genetic algorithm for this

  • @sir_slimestone3797
    @sir_slimestone3797 4 года назад

    Why java damn it, I can't even run it because the damn javac.exe doesn't exist and refuses to with the download...

  • @bluemax6668
    @bluemax6668 5 лет назад +1

    1st

  • @Hollyweed1
    @Hollyweed1 5 лет назад

    What do you code this in... java?!

  • @SergeCao
    @SergeCao 5 лет назад

    +

  • @tapoolkeer
    @tapoolkeer 4 года назад

    Wow! Can that ai win this game?

  • @tejonBiker
    @tejonBiker 5 лет назад

    Beatiful video, I think this version (compared to the neuronal network + genetic algorithm) it's better and more elegant with the solutions

  • @null3081
    @null3081 4 года назад

    Codebullet

  • @Hitori_FtoL
    @Hitori_FtoL 5 лет назад +1

    You are so beautiful)

  • @raghavaggarwal9095
    @raghavaggarwal9095 5 лет назад +2

    is the whole game syncing itself with the music or is it just me?

  • @CariHelstrom
    @CariHelstrom 5 лет назад

    after a day of crying in the corner and 17 energy drinks ive done it... also why is this comment section so wholesome lol

    • @nnvskh8269
      @nnvskh8269 3 года назад

      would you please share your code. this youtuber does amazing projects but no comments in his code. some parts of the code i just cant understand.
      would be really nice of you to share it

  • @hoangminh6899
    @hoangminh6899 4 года назад

    not as fun as your old one but you did it Great. Always love this snake: ruclips.net/video/zIkBYwdkuTk/видео.html (give him more Neuron, and more random, more senses to see himself with his body)

  • @superhussein
    @superhussein 3 года назад

    this is a cheating algorithm

  • @Max_Jacoby
    @Max_Jacoby 2 года назад

    It's not AI, it's a clickbait.

  • @yaroslavpanych2067
    @yaroslavpanych2067 Год назад

    Ah, A*, one of overrated, and in top most stupid algorithms to use guide Snake. Really, waste of everyone's time.