AI Plays Snake Using Pathfinding

  Переглядів 26,628

Greer Viau

Greer Viau

5 років тому

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 роки тому
"The path isn't very elegant" It's the coolest thing I've ever seen.
@Rostol
@Rostol 5 років тому
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.
@GreerViau
@GreerViau 5 років тому
Thanks!
@Ramash440
@Ramash440 4 роки тому
3:05 - And the snake thought "Screw this square in particular".
@angrycoder
@angrycoder 4 роки тому
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 Рік тому
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 років тому
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 років тому
It's really a great pleasure to see your video, keep doing your stuff cause I love it
@ericsheng4043
@ericsheng4043 4 роки тому
The music makes me feel so comfortable
@indivarmishra6119
@indivarmishra6119 5 років тому
Amazing work dude loved this video
@autismo1969
@autismo1969 3 роки тому
That's actually fucking sick my dude 👏👏 great job
@gongjiaji2489
@gongjiaji2489 4 роки тому
amazing improvement.
@fovlsbane
@fovlsbane 5 років тому
This is awesome.
@mengyetlanborn6948
@mengyetlanborn6948 4 роки тому
Excellent !
@Matteo_dev
@Matteo_dev 4 роки тому
AMAZING!!!!!!!
@diogeneslantern18
@diogeneslantern18 4 роки тому
Mind blowing :)
@achievers-thoughts
@achievers-thoughts 4 роки тому
This video inspired me 😍
@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.
@mikoajczajkowski7799
@mikoajczajkowski7799 4 роки тому
Dude thats genius
@larryteslaspacexboringlawr739
@larryteslaspacexboringlawr739 4 роки тому
thank you for ai playing game video
@Hitori_FtoL
@Hitori_FtoL 4 роки тому
Awesome
@ourflagismined4129
@ourflagismined4129 4 роки тому
Now this is Snake played right!
@aayamshrestha9084
@aayamshrestha9084 5 років тому
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 4 роки тому
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.
@luky5112
@luky5112 4 роки тому
Wow amazing work dude. Do I find your AIs also on your github? I want to understand how this works
@shoyoHxC
@shoyoHxC 4 роки тому
Asombroso
@mihaept822
@mihaept822 4 роки тому
Wow!)
@astrelcoff
@astrelcoff 4 роки тому
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.
@JesterTheCrazy
@JesterTheCrazy 5 років тому
wow
@muhammadehsan7409
@muhammadehsan7409 5 років тому
Hi you done a great job I want learn AI where I start
@GreerViau
@GreerViau 4 роки тому
UKposts tutorials and online lectures are where I started
@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.
@m6tmeizu790
@m6tmeizu790 4 роки тому
круто
@sir_slimestone3797
@sir_slimestone3797 4 роки тому
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.
@fiyenyan5534
@fiyenyan5534 4 роки тому
I wonder if this snake also uses the AI algorithm similar to your last snake but just changes the pathfinding method?
@aimanfaris2118
@aimanfaris2118 4 роки тому
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 4 роки тому
UKposts 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.
@kikawet
@kikawet 5 років тому
Is there any link to the code?
@GreerViau
@GreerViau 5 років тому
Just linked it in the description. Code is pretty gross though
@Hollyweed1
@Hollyweed1 4 роки тому
What do you code this in... java?!
@GreerViau
@GreerViau 4 роки тому
Ya
@bluemax6668
@bluemax6668 5 років тому
1st
@tejonBiker
@tejonBiker 4 роки тому
Beatiful video, I think this version (compared to the neuronal network + genetic algorithm) it's better and more elegant with the solutions
@creativecraft_mc
@creativecraft_mc 2 роки тому
20,000th
@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...
@ranam
@ranam 4 роки тому
Do you like to apply genetic algorithm for this
@SergeCao
@SergeCao 5 років тому
+
@raghavaggarwal9095
@raghavaggarwal9095 4 роки тому
is the whole game syncing itself with the music or is it just me?
@tapoolkeer
@tapoolkeer 4 роки тому
Wow! Can that ai win this game?
@CariHelstrom
@CariHelstrom 4 роки тому
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
@Hitori_FtoL
@Hitori_FtoL 4 роки тому
You are so beautiful)
@null3081
@null3081 4 роки тому
Codebullet
@hoangminh6899
@hoangminh6899 4 роки тому
not as fun as your old one but you did it Great. Always love this snake: ukposts.info/have/v-deo/snmcdo-um6GmtZ8.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 Рік тому
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.
AI Learns to Escape (deep reinforcement learning)
8:18
AI Warehouse
Переглядів 7 млн
AI Battle Royale of 100 SNAKES in C++ - SFML Gamedev - Devlog
13:51
Їжа Закарпаття. Великий Гід.
1:00:29
Мiша Кацурiн
Переглядів 639 тис.
Level 1 to 100 Mystery Buttons
00:46
A4
Переглядів 7 млн
How to get a FREE HYPERCHARGE SKIN!
02:07
Brawl Stars
Переглядів 15 млн
The World's Fastest Cleaners
00:35
MrBeast
Переглядів 95 млн
What is the CUBE CENTER? | Cube Runners THEORY
5:12
The Cube Theorist
Переглядів 24
Neural Network Learns to Play Snake
7:14
Greer Viau
Переглядів 4,5 млн
AI learns to play Asteroids
10:01
Code Bullet
Переглядів 1,2 млн
How to Win Snake: The UNKILLABLE Snake AI
17:05
AlphaPhoenix
Переглядів 2,2 млн
4 Experiments Where the AI Outsmarted Its Creators! 🤖
3:28
Two Minute Papers
Переглядів 1,9 млн
OpenAI Plays Hide and Seek…and Breaks The Game! 🤖
6:02
Two Minute Papers
Переглядів 10 млн
But what is a neural network? | Chapter 1, Deep learning
18:40
3Blue1Brown
Переглядів 16 млн
We should use this amazing mechanism that's inside a grasshopper leg
19:19
MarI/O - Machine Learning for Video Games
5:58
SethBling
Переглядів 11 млн
Bot Plays Snake Perfectly | Wall All Apples
6:01
Hoever
Переглядів 10 млн
Why spend $10.000 on a flashlight when these are $200🗿
0:12
NIGHTOPERATOR
Переглядів 16 млн
Компьютер подписчику
0:40
Miracle
Переглядів 206 тис.
Broken Flex Repair #technology #mobilerepair
0:55
ideal institute aligarh
Переглядів 16 млн
Первые продажи Ryzen на Ozon и первый возврат! 😱
13:17
Герасимов Live
Переглядів 27 тис.
Which Phone Unlock Code Will You Choose? 🤔️
0:12
Game9bit
Переглядів 6 млн