Population Stats

Highscore 0
Current score 0
Snakes alive 0
Next generation size 250
Generation number0

+ Statistics

Updates

Welcome to...

×

Evolution

Hold on.
This application might be confusing, if you don't take a minute to read this explanation.
Our goal here is to evolve an artificial intelligence that learns to play the snake game by itself. To do this, we will create a population of neural networks, where each one gets to control a snake in the classic snake game. Each neural net receives inputs about food distance and angle, as well as potential obstacles (it has no information about other snakes and their food).

an illustration of a snake receiving inputs and returning outputs

However, the snakes don't get told what to do with this information. At the start you will therefore see that the snakes have no idea how to play the game. At the end of each generation, when all snakes reached a score, a genetic algorithm selects snakes for reproduction. It will favor those, that performed better than their peers, by achieving a higher score. For every spot in the population, two snakes will be selected to leave an offspring. The child inherits one half of each parents characteristics and is subject to some random mutations.

an illustration of the genetic algorithm

Through this evolutionary process there will before long, emerge a snake that sees a pattern in the data and learns to interpret it. From there on, evolution takes its course...

Controls

Framerate:

+ Population Controls

+ Advanced Controls

+ Visuals