This no longer under development because of outdated/stale code which uses an older version of the battlesnake API. Another version can be viewed here. For other projects like this one see the awesome-battlesnakes repository or check out my profile.
A reinforcement learning Battlesnake AI written in Python by a Physics, 2 Software Engineering, and 2 Computer Science undergrads.
Currently a 3 layer nn is used for prediction. While 8 layers are derived from the input, AlphaGo is not being utilized, need to do this.
Visit https://github.com/BattlesnakeOfficial/community/blob/master/starter-snakes.md for API documentation and instructions for running your AI.
This AI client uses the bottle web framework to serve requests and the gunicorn web server for running bottle on Heroku. Dependencies are listed in requirements.txt.
- a working Python 2.7/3.7 development environment (getting started guide)
- pip to install Python dependencies
- Fork (optional) and clone the repo.
Using SSH
git clone [email protected]:miroesli/pssscs.git
Using HTTPS
git clone https://github.com/miroesli/pssscs.git
- create the virtualenv
python -m venv env
source env/bin/activate
- Install dependencies using pip:
pip install -r requirements.txt
- Run local server:
cd app
python main.py
- Test your snake by sending a curl to the running snake
curl -XPOST -H 'Content-Type: application/json' -d '{ "hello": "world"}' http://localhost:8080/start
Visit https://github.com/BattlesnakeOfficial/engine for installing the engine to run the AI.
If you have problems running the engine, make sure you have run make install
make install
and built the board
./build_board.sh
If both ./engine dev
and engine dev
still do not work, build the engine executable locally
go build -o engine cmd/engine/main.go
Then try running ./engine dev
- Create a new Heroku app:
heroku create [APP_NAME]
- Deploy code to Heroku servers:
git push heroku master
- Open Heroku app in browser:
heroku open
or visit http://APP_NAME.herokuapp.com.
- View server logs with the
heroku logs
command:
heroku logs --tail