Replicate You, a game where you train a neural net to play
In this game, your goal is to train a neural net to copy your gameplay behaviour. The game is a simple pick up the coins and avoid the enemies game, to keep things simple. The neural net determines which move to do by looking at a 9x9 area around the player. Its output is what move to make: up, down, left, or right. Every time you make a move, a datapoint is added to the training set. Once you think you have enough data, you can summon a replica and see how well it plays.
I wasn't sure this was going to work at all, so I concentrated on making the neural net work. With a few major bugfixes and tweaks, it ran reasonably well. It isn't too difficult to create a replica that completes most levels. The biggest problem is when it keep running around in circles. Usually this can be remedied with more data, sometimes it's best to clear the dataset and start again. You can also try making the replica misbehave, for example by deliberately ramming enemies.
Context area around the player is shown in red.
This is definitely an experimental game. It's rather simple and could use some polish. Sometimes it generates levels where you have to ram enemies to get all the coins. Movement can be a little odd, because you always move from one tile to another. The neural net is limited, because it has to be simple enough train in the browser without long wait times. Nevertheless, I definitely consider this a success, because the replica works well with so little data. The result could be used to create all sorts of interesting variations. For example (and this includes suggestions made by raters, thank you so much for the feedback):
- Make it easy to run the replica multiple times, so you get proper stats
- Load/Save replicas
- A coop game where you cooperate with your replica
- A pvp style game where the replicas are enemies
- incremental training during the game to avoid wait times
- Give access to dataset and neural net hyperparameters, so the game becomes something of a neural net tutorial. You could even have upgrades allowing more neurons.
- A more complex game that makes training the replica more challenging