π¬ 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
73 Comments