Python Flappy Bird AI Tutorial (with NEAT) - Finishing Touches and Testing

  Рет қаралды 93,458

Tech With Tim

Tech With Tim

Күн бұрын

Пікірлер: 339
@space-nova4487
@space-nova4487 5 жыл бұрын
The first video did 250k views and the last one only 7000 views. Congrats to everyone who hasn't gave up and reached the last video. And thank you Tim for this tutorial !
@lonelygirlz
@lonelygirlz 4 жыл бұрын
now the first has 1 mil views and the last has more than 26k views
@rutvikrana512
@rutvikrana512 4 жыл бұрын
Yeah ... most of them are just watching it on YT and not actually coding it same time 🤦🏻‍♂️
@danilomatrangolomarano8575
@danilomatrangolomarano8575 4 жыл бұрын
I was going to comment the same thing. Now its 1,300,000 to 39,000
@Gibczon
@Gibczon 3 жыл бұрын
I just did it GG :D
@daynger8085
@daynger8085 2 жыл бұрын
our generation had the greatest fitness level
@DoctorMikeReddy
@DoctorMikeReddy 4 жыл бұрын
Amazing series Tim. I’ve used this with my third year game programming students, for their AI module, as an example of good practice. Thank you
@novicetech1
@novicetech1 5 жыл бұрын
Another amazing tut. I got a lot out of this series. Not only did I get a good into to genetic algorithms and machine learning, but this also served as a sort of python master class as well. Thanks.
@vp9041
@vp9041 4 жыл бұрын
hey tim, one small suggestion, at the end of every video, just scroll through the entire code top to bottom so that we can slow down and verify the same ( since the timely code is not available and the code in github looks different ) thanks, loved the series
@sashamuller9743
@sashamuller9743 4 жыл бұрын
he has updated the code on the github
@vp9041
@vp9041 4 жыл бұрын
@@sashamuller9743 Yeah, but that code on git is way different than this exact video because there, its the entire project.
@sriampojwalam4907
@sriampojwalam4907 5 жыл бұрын
Tim, I cannot thank you enough! This series was amazing and I learned so much. You're awesome dude! Keep these videos coming!
@ShadowRider609
@ShadowRider609 3 жыл бұрын
Thanks for this tutorial. I wanted to say that you are doing a great job and don't stop doing this. ~~SUGGESTION~~ You also should upload a tutorial of how to save the bird ai which particularly performed best.
@derricklashua
@derricklashua Жыл бұрын
After finishing the "How to Make a Game in Python" tutorial, I tried and completed this one. I am basically brand new to python so this was a very exciting project to try out. Thanks for the great content and helpful explanations about how the code works.
@Ant0ny25
@Ant0ny25 4 жыл бұрын
Tim, just thank you! This NEAT principle just amazing. I made my own version of this game, with slightly different algorithms - fought with errors few hours but finaly made it. Your tutorials are the best, i wish you could do more about AI and about their use.
@yannickprudent1232
@yannickprudent1232 4 жыл бұрын
Thank you so much dude, this course is dope !! I was so much fascinated by code bullet's AIs, finally a tutorial about it ! :) This is so satisfying to watch the birds getting better
@_MUTHURAJS
@_MUTHURAJS 10 ай бұрын
Its sure a splendid tutorial, Its was very comprehensible and loved the way you carried out the entire session
@kristynapijackova1687
@kristynapijackova1687 5 жыл бұрын
So glad I've stumbled upon your channel and this series! Thank you so much for this series, it was really nice to code along creating my first ai bot ever :))
@rutvikrana512
@rutvikrana512 4 жыл бұрын
I have understood this video because of your teaching. I have cleared my confusion by just observing each line, method and NEAT documentation. Thank you very much for this series. 💕💕💕💕💕💕💕💕 I have created same replica of this from starting of this series😜
@user-wm1ek4bu7p
@user-wm1ek4bu7p Жыл бұрын
I need to rewatch everything again, cuz there are things i just have typed them without understanding their features( what they do ), so in somehow my birds are dumb and not learning from their mistakes, but i really enjoyed it. thank you very much ...
@Gamer0127
@Gamer0127 4 жыл бұрын
As I was watching this series you just hit 300K! Congrats man!
@Pontiflex
@Pontiflex 3 жыл бұрын
Massive thank you to you, my Bro. You make BY FAR the best tutorials for advanced intermediate developers on this platform. I understood each line I typed because you explained it so well. You need some experience in Python and the concept of Neat but then everything seems pretty logical.
@Soljarag5
@Soljarag5 5 жыл бұрын
Best ML tutorial I have ever seen!
@ChristianZenker
@ChristianZenker 4 жыл бұрын
Thanks again for this series. I have currently a lot of fun looking at the birds flying itself (i made the gap just 150 but for this i pushed out 1000 birds :-D ) i did not understood the full course but i will rewatch and take a deep dive on the missing parts (still new to python) Thanks again.
@secretlyfinnish8712
@secretlyfinnish8712 5 жыл бұрын
Thank you so much, I really enjoyed this series and now I have the finished and I have a working project.
@iamlegend3927
@iamlegend3927 4 жыл бұрын
Well I guess this was pretty.... neat (sorry lmao)
@festivecreations
@festivecreations 4 жыл бұрын
Really appreciate this series None of the other channels explain or even show such codes I am watching this video after 1.5 years of its published date and still Tim is the best!❤️ Ly bro!❤️🔥
@prazno0
@prazno0 4 жыл бұрын
GREAT TUTORIAL, I've learn a lot!! Especially now that a lot of people are on quarantine. They will have a lot of time to learn programming like python.
@mitchellturton3516
@mitchellturton3516 4 жыл бұрын
i feel called out
@Flamethrower1996
@Flamethrower1996 2 жыл бұрын
good tutorials. Insane result. It couldn't be better thanks Timmy
@tradyrumy
@tradyrumy 2 жыл бұрын
🙌🙌🙌 thanks a lot for ur effort. was so confused with soo many youtubers, finally got u.
@PrabhuDesai
@PrabhuDesai 4 жыл бұрын
Seeing AI in action was inspiring, absolutely loved it !!
@shaikhameerul
@shaikhameerul 4 жыл бұрын
Thank you Tim for this tutorial. You gave me a little bit of insight on how to actually create a simple game using Python, and how to implement an AI to play the game for you. You also enlightened me regarding neural networks and how they work etc.
@hackercop
@hackercop 3 жыл бұрын
Got to the end of this tutorial series, thank you so much
@angelpico3236
@angelpico3236 4 жыл бұрын
Great series Tim I think I speak for most people when I say you should do more AI stuff more often. Keep up the good work !
@computersciencerecipy1951
@computersciencerecipy1951 5 жыл бұрын
Best KZbin channel😍😍😍 You are my favorite youtuber
@shaunaksrivastava9149
@shaunaksrivastava9149 4 жыл бұрын
This was so good! I was able to understand almost every line I wrote. Thank you so much for making this.
@RajatKumar0266
@RajatKumar0266 Жыл бұрын
It was amazing man! Really really thorough tutorial loved all of it!❤
@shridumanish3506
@shridumanish3506 4 жыл бұрын
Please add the other parts. You said that you will teach all the steps to us in the begining and not just increasing the typing speed . I loved thw series and binge watched it twice in quarentine. Hope you receive it. Thank you and keep up the good work.
@bilelsaghrouchni977
@bilelsaghrouchni977 4 жыл бұрын
Thanks from France, I really liked to follow this tuto with you, it was very clear and well explain ! :)
@vigneshrajendiran8384
@vigneshrajendiran8384 Жыл бұрын
This series was great! Thank you Tim
@alexnem
@alexnem 4 жыл бұрын
Tim, you rock! Thanks for your work and all the effort it took you to make this amazing content! You are really doing a meaningful job by letting other people into programming world without scaring the shit out of them. Good luck to you and - sincerely - THANK YOU!
@samurai-capybara
@samurai-capybara 4 жыл бұрын
Amazing that it learned so quickly! Great series... as are all your others.
@kameelamareen
@kameelamareen 4 жыл бұрын
Made my Quarantine
@kosmonautofficial296
@kosmonautofficial296 Жыл бұрын
Great series! Thanks I was able to follow along and get this working.
@electronics_8722
@electronics_8722 4 жыл бұрын
I watched them all! And i loved them! A.I worked perfectly! Thank you so much!
@priyankmistry1270
@priyankmistry1270 3 жыл бұрын
Great Video playlist with the best possible explanation, Thank for the tutorial man.
@jamalbahammou790
@jamalbahammou790 5 жыл бұрын
The only one that doesn't gets any dislike in his videos 👌👌, thansk a lot man 🙌
@ramziamri9747
@ramziamri9747 4 жыл бұрын
Tech With Tim Thank you not for flappy bird but because you are sharing your knowledges with other you deserve more than click for like or subscribe good job men and keep doing that
@vishalkanwar8885
@vishalkanwar8885 3 жыл бұрын
Awesome tutorials dude! Subscribed 🙌
@shaala4467
@shaala4467 3 жыл бұрын
Only 3.2 percent of people who came down till the end. Shows how easy people give up.
@festivecreations
@festivecreations 4 жыл бұрын
Hey man ! That a great amount of work,time and dedication🔥 Love from india❤️
@barakatosalon
@barakatosalon 5 жыл бұрын
Great course, the best in youtube for learning how to implement an AI !!!
@chris-zy5qs
@chris-zy5qs 4 жыл бұрын
Great series! Thanks, now I know where to start when making AI for other games!
@Techny
@Techny 3 жыл бұрын
Loved The Series❤
@Aca99100
@Aca99100 5 жыл бұрын
One thing i added is that i subtracted some fitness whenever a bird hits a floor or a ceiling. It really makes a difference when population size is really small and you dont hit perfect solution so soon. Also, dont remove too much fitness as some birds prefer randomly executing themselves by hitting the pipes rather then proceeding and maybe hitting the floor or bottom lol
@pizza_t1me
@pizza_t1me 5 жыл бұрын
Thank you for this amazing tutorial series!
@yuvbleh3469
@yuvbleh3469 3 жыл бұрын
Really interesting video! Thank you for the hard work !
@1994mrmysteryman
@1994mrmysteryman 5 жыл бұрын
Buddy, don't lower the amount of birds. Make the game harder. Decrease the distance between the top and bottom pipe and make the jump higher, so that the AI has to learn to time its jump. Right now, as it is, it can jump between pipes multiple times with ease which is why it took zero generations to perfect. Otherwise, great tutorial. Keep up the good work.
@samporter9785
@samporter9785 5 жыл бұрын
This was my solution also! I have it borderline impossible, 1000 generations, increased velocity to 15 and gap to 158. It really pushes the little guys to their limits and so fun to watch.
@lavenarch9570
@lavenarch9570 3 жыл бұрын
This was a fun way to get exposure to pygame and neat thanks for making this tutorial series cant wait for more. Gonna try to do the dino game now sans tutorial 😨
@noelvalencia4025
@noelvalencia4025 5 жыл бұрын
Omg.. your so cool.. huhuhuhu....i cant wait to finish my programming and make things like what your doingg..great videoooo!!
@martinsosmucnieks8515
@martinsosmucnieks8515 3 жыл бұрын
Thanks Tim, very great tutorial!
@scm6668
@scm6668 3 жыл бұрын
Amazing series! Thank you so much
@guygontar6106
@guygontar6106 4 жыл бұрын
Well done! thanks for this great series
@HiddenTrackSessions
@HiddenTrackSessions 4 жыл бұрын
Well done dude!! Thank you for the awesome videos
@yaboyJJJJJ
@yaboyJJJJJ Жыл бұрын
for anyone reading this: Taking the Y of the bird as one of the input neurons is literally pointless. Since the other 2 neurons are absolute distance between Y of bird and Y of the pipes. The actual Y of the bird doesn't add anything because it's irrelevant to any of the decision making. You could either just not give that as a neuron or replace it with the bird's velocity. Which actually does impact decision making.
@eric.m5790
@eric.m5790 5 жыл бұрын
thanks just finished the tutorial it was great i learnd a lot. Big Like !!
@hungdoan9148
@hungdoan9148 4 жыл бұрын
Great series! Wish you would have gone over saving with pickle but I think I can figure that out on my own. Thanks!
@simssim262
@simssim262 3 жыл бұрын
The best tutorial ever
@mrfrozen97-despicable
@mrfrozen97-despicable 3 жыл бұрын
Thank you so much)))))). Now I can apply this neat on my other games
@prtvivs.hotwheeeels
@prtvivs.hotwheeeels 3 жыл бұрын
Here's how you can save/pickle an object: import pickle # suppose "obj" is the object you wanna save with open("filename.pickle", "wb") as f: pickle.dump(obj, f) # to open the same object for future use: pickle_in = open("filename.pickle", "rb") obj = pickle.load(pickle_in)
@prtvivs.hotwheeeels
@prtvivs.hotwheeeels 3 жыл бұрын
Great tutorial series! Thanks
@TheAfroKingPlay
@TheAfroKingPlay 4 жыл бұрын
Great tutorial. Nice job Man!
@AZTECMAN
@AZTECMAN 5 жыл бұрын
Excellent tutorial series!
@jordy9247
@jordy9247 5 жыл бұрын
Just subscribed 5 minutes ago and now a video?!?!
@sander1426-2
@sander1426-2 4 жыл бұрын
For those of you wondering how to save the 'solution' and load it, you can use the following piece of code. I actually implemented NEAT for another game so the code is not specifically for Flappy Bird, but you should get the idea. To save the winner, simply do the following: winner = p.run(eval_genomes, generations) path = directory_path + "/name.pkl" with open(path, "wb") as f: pickle.dump(winner, f) f.close() Now to load the winner and run the game, you do the following: # Load the configuration again config = neat.config.Config(neat.DefaultGenome, neat.DefaultReproduction, neat.DefaultSpeciesSet, neat.DefaultStagnation, config_path) # Open the pickle file again with open(path, "rb") as f: genome = pickle.load(f) # Create a list with the first item being the loaded genome genomes = [(1, genome)] # With this genome, create the NN again net = neat.nn.FeedForwardNetwork.create(genomes[0][1], config) # Now play your game, activate the net
@you1066
@you1066 4 жыл бұрын
thank you thank you thank you, you won't believe how much i searched for this , after making a pong ai and trying to implement it and failing a couple of times with tons and tons of research finally thank youuuuuuuuuuuuuuuuuuuuu
@sander1426-2
@sander1426-2 4 жыл бұрын
@@you1066 no problem :)
@megadetroyer100
@megadetroyer100 3 жыл бұрын
Very nice video! Enjoyed it a lot!
@aurelsiege159
@aurelsiege159 5 жыл бұрын
Great work, Tim! Keep 'em coming!!
@ghoozst
@ghoozst 4 жыл бұрын
Thanks a lot for this tutorial. It saved my ass of failing a class
@nayanamadhuwanthaweeraseka7047
@nayanamadhuwanthaweeraseka7047 4 жыл бұрын
Thank you very much. Amazing tutorial
@kooshasangari2555
@kooshasangari2555 3 жыл бұрын
💫⭐ Amazing, Keep it UP ⭐💫
@icarofreire5079
@icarofreire5079 4 жыл бұрын
thanks for the video, you are a great teacher.
@ranz0u
@ranz0u 5 жыл бұрын
Good series. I played around with it a bit and made the game more difficult by reducing the gap between the top and bottom pipes, so it's now random between 160 and 170. In the pipe's set height function it's: self.bottom = self.height + random.randrange(160,170) The AI struggled a lot with this, making it to a score of 30 after 20-30 generations. So I added another input neuron, and now it's much improved, and in my opinion more fascinating to watch it tackle this steeper learning curve. Can anyone guess what the extra input is?
@samporter9785
@samporter9785 5 жыл бұрын
Hmm, was the neuron the game ticks?
@samporter9785
@samporter9785 5 жыл бұрын
Good idea btw, i increased the velocity of the pipes/base to 15 and decreased the gap to 158 which makes it pretty much impossible but they can get some good runs if they're lucky enough with the gap locations
@ranz0u
@ranz0u 5 жыл бұрын
@@samporter9785 Yeah nice idea - I didn't think of that. I think (I don't remember exactly) that I added the x position of the next pipe as the extra input neuron, so the bird has a better idea of where the next pipe to get through is. When we play the game, we intuitively know the x and y position of the pipes, so we know when to jump. So the AI should have both x and y coordinates was my thinking.
@samporter9785
@samporter9785 5 жыл бұрын
@@ranz0u ha nice! I was thinking the same thing watching them plow headfirst into the next pipe if its too steep a change for them to make in time. Now i want to add that..
@skhaaaan
@skhaaaan 4 жыл бұрын
thank you so much this was an amazing tutorial!
@monkeezorg
@monkeezorg 4 жыл бұрын
Great set of videos.
@utkar1
@utkar1 5 жыл бұрын
Thank Tim, it was a gem !
@divyasingh8141
@divyasingh8141 4 жыл бұрын
Extremely helpful!
@hoseinhoushyari
@hoseinhoushyari Жыл бұрын
Thanks a lot buddy 👍🏻
@paulalexandre3358
@paulalexandre3358 4 жыл бұрын
I followed allong to your tutorial but whenever I implement neat my pygame window just turns black and never displays anything. What am I supposed to do?
@sfraction9004
@sfraction9004 4 жыл бұрын
Did you find a solution?
@MichaelBoly
@MichaelBoly 4 жыл бұрын
same issue here
@professorparadox9826
@professorparadox9826 4 жыл бұрын
@@123-m4v2o Thanks brother
@arthurrobert2135
@arthurrobert2135 5 жыл бұрын
Best tutorial series
@harissabotic5714
@harissabotic5714 5 жыл бұрын
Not a good comments section if there aren't 10 different people saying unoriginal stuff or first
@AgentRex42
@AgentRex42 5 жыл бұрын
I hope you will do other tutorials like this.
@harshdeeptelang127
@harshdeeptelang127 3 жыл бұрын
Love your vid bruh!
@samzhong3435
@samzhong3435 Жыл бұрын
Tim is GOAT!!
@trewto
@trewto 2 ай бұрын
Thank you very much
@FeedFall8
@FeedFall8 5 жыл бұрын
love this video series
@taherjerbi6323
@taherjerbi6323 4 жыл бұрын
Great tutorial!
@gamingllama7464
@gamingllama7464 4 жыл бұрын
I don't understand who is disliking the video
@ido3244
@ido3244 3 жыл бұрын
Thank you!
@prakashchoudhary706
@prakashchoudhary706 4 жыл бұрын
Thank you Tim
@krishshah344
@krishshah344 4 жыл бұрын
Great video!!!
@kei5985
@kei5985 4 жыл бұрын
And here. I thought ai was this magical box
@Josephshanks7
@Josephshanks7 5 жыл бұрын
8:24 at this point I ran mine and it always tells me " AttributeError: module 'neat' has no attribute 'config' " despite me having installed and imported neat. I also tried "import neat.config" which didn't work. Nobody on stack overflow has been able to help me yet. Any ideas?
@ericpark3252
@ericpark3252 5 жыл бұрын
Hello, I was able to fix the same error by clearing the cache of my interpreter like so : " Clean out the system caches: From the main menu, choose File | Invalidate Caches/Restart. The Invalidate Caches message appears informing you that the caches will be invalidated and rebuilt on the next start. Use buttons in the dialog to invalidate caches, restart PyCharm, or both. " Sources : Issue description : rafikitechnology.com/2017/10/24/python-attributeerror-module-object-has-no-attribute-config/ How to clear cache : www.jetbrains.com/help/pycharm/cleaning-system-cache.html Hope this helps.
@miloskatic1997
@miloskatic1997 5 жыл бұрын
Have you maybe solved that problem by now?
@Josephshanks7
@Josephshanks7 5 жыл бұрын
@@miloskatic1997 No i have not yet, any suggestions?
@miloskatic1997
@miloskatic1997 5 жыл бұрын
@@Josephshanks7 Actually, I resolved that problem by checking whether neat or neat-python was installed. I knew that neat-python had to be installed, but for some reason pycharm insisted that it should be neat, lol. If you're coding in pycharm, go to: File->Settings->Project Interpreter and then click on the gear icon on the top right. You should see all modules that were installed in your project. With "+" add neat-python(not neat) and if you already have neat there installed, deinstall it with "-". After doing those changes, in your code write "import neat" and it should be recognized as neat-python(at least it was in my case). I hope this unnecessarely long comment was helpful, good luck :)
@AgentRex42
@AgentRex42 5 жыл бұрын
Very good !
@marcuscazzola4005
@marcuscazzola4005 5 жыл бұрын
What is the code for using the saved winner? I have saved the winner and pickled it, and opened it. But how do run one bird with the winner's data?
@abdulsalamaboubakar4059
@abdulsalamaboubakar4059 5 жыл бұрын
for the algo
@Johan-jd6kx
@Johan-jd6kx 4 жыл бұрын
Can someone sent me the whole code, GitHub one is totally different. I ran into an error!
@ukenatora1000
@ukenatora1000 3 жыл бұрын
thank you
AI Teaches Itself to Play Flappy Bird - Using NEAT Python!
10:16
Tech With Tim
Рет қаралды 143 М.
Can AI code Flappy Bird? Watch ChatGPT try
7:26
candlesan
Рет қаралды 9 МЛН
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 31 МЛН
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 78 МЛН
Python Flappy Bird AI Tutorial (with NEAT) - Moving Birds
18:27
Tech With Tim
Рет қаралды 172 М.
15 Python Projects in Under 15 Minutes (Code Included)
12:37
Tech With Tim
Рет қаралды 2 МЛН
C++ vs Rust: which is faster?
21:15
fasterthanlime
Рет қаралды 405 М.
AI Learns to play Geometry Dash || FINAL
11:51
CodeNoodles
Рет қаралды 243 М.
I Tried Every AI Coding Assistant
24:50
Conner Ardman
Рет қаралды 859 М.