BLOG POST DOCUMENTATION : Consider reading our detailed blog posts about this project:
This project shows how to build and deploy an AI for the platform Battlesnake on AWS with Amazon Sagemaker!
It is ready to deploy and contains learning materials for AI enthusiasts.
What is Battlesnake? (taken from battlesnake.com):
Battlesnake is an autonomous survival game where your snake competes with others to find and eat food without being eliminated. To accomplish this, you will have to teach your snake to navigate the serpentine paths created by walls, other snakes, and their own growing tail without running out of energy.
This project contains a ready-to-use AI for Battlesnake as well as a development environment that can be used to modify and improve the AI. The included AI makes movement decisions in two steps:
Several pre-trained neural network models are provided within this project as well as some default heuristics. These pre-trained models (snakes) are not designed to win the Battlesnake competition, so you'll have to improve them in order to have a chance of winning. The training environment is provided for you to make modifications and to retrain the neural network models in order to obtain better results.
This project can be used in three steps:
If you use Steps 1-3, you will have the following deployed within your AWS account:
This project has been designed to run within the AWS free tiers for some time. Refer to each step above in order to understand the costs that may be incurred after the free tiers are exceeded.
The included Jupyter notebooks are bundled with a step-by-step Battlesnake visualizer:
With the Battlesnake visualizer, you can load any initial state and test how your snake will behave in various situations (See the Visualize your algorithm section for the full list of features.)
The source code of the project is organized as follows:
deployment # contains the templates and scripts to automate deployment
>
source
> MXNetEnv # training environment with the MXNet implementation (deprecated - for reference only)
> BattlesnakeGym # openAI gym to simulate the battlesnake environment
> RLlibEnv # contains the Jupyter notebook for model training and heuristics development
> training # contains source code for training
> inference # contains source code for inference
This project is licensed under the Apache-2.0 License.