Deep Q-learning for the Multiplayer Snake Game

I wrote a Q-learning implementation for the multiplayer snake game in 2021 because it was on OpenAI's Requests for Research 2.0. A tensorized RL environment for the game was written by my friend Ende Shen and I in PyTorch to generate training data. The GIF below shows two trained agents interacting (environment rendering by Ende).

renderer

In the GIF, a snake was lured by a fruit before it was cornered and died. We also see the snakes learned to avoid other snakes. Instead of the private GitHub repository, here is a Colab notebook that trains the Q-learning agent.