Hey everyone,
I was just playing around with Neural Networks for the first time when I read about this Jam and immediately had the idea to make a snake game that teaches itself. I used a javascript library ( https://github.com/zefman/Brainwave/blob/master/bu... ) for the Network but the rest was done in the last 4 days.
The current version is already playable at https://bewelge.github.io/HowToTrainYourSnake/ .
I think it turned out alright. The game field is 3x3 and for each tile an input is given to the neural network (either food/ snake-body/ snake-head/ empty Field). The network has 1 hidden Layer with 10 Neurons and gives 3 Outputs (Turn Left, Turn Right or Go Straight).
In the beginning there are 4 Snake-Games. When all of the snakes have died, the two best performing snakes will continue into the new generation. The two other new snakes will be a crossing/offspring of the best performing snakes. Finally theres a chance for mutation, meaning something in the snakes brain (the neural network) will be randomly changed.
Due to this randomness some games may be significantly shorter than others but on the 3x3 grid my snakes always eventually learn to play a "perfect game" (fill the entire board).
Still planning to add:
- More options so you can configure the neural network yourself after you've unlocked everything.
- Possibility to play on larger Maps than 3x3.
- Some chiptunes for when the snakes eat :)
Let me know what you think. Especially if the upgrade-progress is too slow.
Also, I'm unsure if publishing my game here is final. That's why I put it on github first because I'm not quite done yet. Anyone know if you can edit your game after publishing/submitting it here?