I'm trying to evolve an AI for a game of 'continuous' snake.
Check this vid to understand the game:
Basically, the snake drives a bit like a car and the first one of the 2 players to crash into his trail or the other's trail loses the game.
What ideas would you have guys to design an AI for this ?
The state space is huge: ideally there'd be 60fps per second and every frame, the snake can steer from -1 (left) to +1 (right) including all the values in between.
So A* wouldn't cut it.
My current try is to use the NEAT algorithm (http://www.cs.ucf.edu/~kstanley/neat.html).
I have the framework working and the AI is starting to show some traces of intelligence.
The fitness value doesn't go up much though and it tends to converge toward the spiral pattern. It might be a good strategy though
The inputs I've chosen so far are:
- the opponent angle relative to us
- the opponent distance
- the opponent heading relative to us
I've attached the code to this post if anyone wants to try it.
You just need to install the SharpDX packages using nuget and hit F5.
Basically I'm interested in knowing what you think, and what other ideas you could give me for coding an AI for this game.
Added the exe
Numpad 4 and 6 : turn left and right
Space : Restart a game against the new champion
E : Pause/Unpause evolution. Useful to get a responsive UI. Pauses after the current iteration (8s on my machine)