Master Snake AI with NEUROEVOLUTION: Build NEAT from Scratch in C++ π
Dive into Coding Quests Episode 1 as we implement the NEAT algorithm from scratch in C++, teaching a snake to learn through neuroevolution. Perfect for AI enthusiasts and programmers!

Tech With Nikola
39.7K views β’ Oct 4, 2023

About this video
π¬ Coding Quests Episode 1: Implementing the NEAT Algorithm from scrach in C++ π¬
π What's this video about?
I was reading a lot about genetics lately, so I got inspired to write code on that topic. I actually wanted to build a simulation with creatures that are evolving over time because I saw multiple videos on that topic and they looked fun. However, I ended up implementing the NEAT algorithm because I was very curious how it works in detail.
I also trained 2D snake AI and I got some surprising results that I'd like to share. For the end, I played a bit with "genetic engineering".
Full source code is available for Patreon supporters: https://www.patreon.com/posts/source-code-neat-91016984
Official NEAT whitepaper: https://nn.cs.utexas.edu/downloads/papers/stanley.cec02.pdf
π If you found this video helpful, don't forget to like, share, and subscribe for more tech tutorials!
π If you enjoy this video, please like, share, and subscribe!
π SiteGround: the hosting solution I like (affiliate link): https://www.siteground.com/index.htm?afcode=8260ed867c4f49ad77f397c6c58f9969
π Connect with me:
Support me on patreon: https://www.patreon.com/TechWithNikola
Join my discord: https://discord.gg/p9trmEVeaZ
Visit my blog: https://techwithnikola.com
Follow me on Instagram: https://www.instagram.com/techwithnikola
Follow me on Twitter: https://twitter.com/techwithnikola
Timecodes
00:00 Intro
00:56 Neural Networks
03:43 Genetic Algorithms
05:46 NEAT genotype and phenotype
06:18 NEAT Crossover + impl
08:35 NEAT Mutations + impl
11:16 NEAT implementation
15:32 Snake Engine
16:33 Snake UI
19:19 Fitness Function
20:33 Training (food)
20:59 Training (wall)
22:18 Training (snake body)
23:33 NEAT Species
25:44 Genetic Engineering
27:52 Outro
π What's this video about?
I was reading a lot about genetics lately, so I got inspired to write code on that topic. I actually wanted to build a simulation with creatures that are evolving over time because I saw multiple videos on that topic and they looked fun. However, I ended up implementing the NEAT algorithm because I was very curious how it works in detail.
I also trained 2D snake AI and I got some surprising results that I'd like to share. For the end, I played a bit with "genetic engineering".
Full source code is available for Patreon supporters: https://www.patreon.com/posts/source-code-neat-91016984
Official NEAT whitepaper: https://nn.cs.utexas.edu/downloads/papers/stanley.cec02.pdf
π If you found this video helpful, don't forget to like, share, and subscribe for more tech tutorials!
π If you enjoy this video, please like, share, and subscribe!
π SiteGround: the hosting solution I like (affiliate link): https://www.siteground.com/index.htm?afcode=8260ed867c4f49ad77f397c6c58f9969
π Connect with me:
Support me on patreon: https://www.patreon.com/TechWithNikola
Join my discord: https://discord.gg/p9trmEVeaZ
Visit my blog: https://techwithnikola.com
Follow me on Instagram: https://www.instagram.com/techwithnikola
Follow me on Twitter: https://twitter.com/techwithnikola
Timecodes
00:00 Intro
00:56 Neural Networks
03:43 Genetic Algorithms
05:46 NEAT genotype and phenotype
06:18 NEAT Crossover + impl
08:35 NEAT Mutations + impl
11:16 NEAT implementation
15:32 Snake Engine
16:33 Snake UI
19:19 Fitness Function
20:33 Training (food)
20:59 Training (wall)
22:18 Training (snake body)
23:33 NEAT Species
25:44 Genetic Engineering
27:52 Outro
Tags and Topics
Browse our collection to discover more content in these categories.
Video Information
Views
39.7K
Likes
1.7K
Duration
28:08
Published
Oct 4, 2023
User Reviews
4.7
(7) Related Trending Topics
LIVE TRENDSRelated trending topics. Click any trend to explore more videos.
No specific trending topics match this video yet.
Explore All Trends