Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Competitive Self-play on Multi Snakes Game Environment

In this project, multi-snakes game environment and some famous Deep RL algorithms were implemented, and the agent was trained in this environment using self-play method. This project was proposed by OpenAI as one of the topics from 'Requests for Research 2.0'. The proposed research topic was as follows:

  1. Set up a reasonably large field with multiple snakes.
  2. Solve the environment using self-play with some RL algorithms, and observe what happens.
    e.g. train current policy against a distribution of past policies.
  3. Inspect the learned behavior.

Adding to this, inspired by '', I added a new action that can cut other snake's body, so that when snakes are too big compared to the size of the environment, they can cut each other's body to stay much longer and get higher rewards.

Multi-snakes OpenAI Gym environment was implemented based on this code. This link was only used as a reference since the code in the link was not fully implemented. Deep RL algorithms implementations were written in tensorflow.

This project is a result of DeepLearning Camp Jeju 2018.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.


You need tensorflow, gym and numpy to run this project. If you have your virtual env, please activate the env.

pip3 install -r requirements.txt


First, you need to install multi-snakes gym environment.

cd gym-snake
pip3 install -e .

Running the tests

First, you can run the test on several environments. Test codes are in 'test' folder.

source activate tf # don't forget to activate virtual env
cd test

Break down into end to end tests

Explain what these tests test and why

Give an example

And coding style tests

Explain what these tests test and why

Give an example


Add additional notes about how to deploy this on a live system

Built With


This project is licensed under the MIT License - see the file for details


  • Sounam An - My mentor at DeepLearning Camp Jeju 2018
  • Sourabh Bajaj - Mentor at DeepLearning Camp Jeju 2018
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.