An machine learning battlesnake written in rust.
This AI is not designed and potentially incapable of running on Royale and Constrictor game modes. It is only intended to run in Standard and Duel mode, as well as whatever alterations the simulation may offer.
cargo run --bin simulate
cargo run --bin server
I have programmed a simulation of the real game's Standard and Duel versions with inspiration from the wonderful snork codebase. It is intended to run fast to train machine learning models, while offering optional benchmarking and visuals.
This section assumes you are using a self-hosted solution, such as from your own computer
- private IP address should go in Rocket.toml > address
- forwarded port should go in Rocket.toml > port
- keep_alive should probably be set to 0
- Server URL should be the following:
http://[public IP]:[forwarded port]/
Example: http://75.156.58.23:4576/
cargo run
You should see the following output once it is running
🚀 Rocket has launched from http://0.0.0.0:8000
Open localhost:8000 in your browser and you should see
{"apiversion":"1","author":"","color":"#888888","head":"default","tail":"default"}
Install the Battlesnake CLI
- You can download compiled binaries here
- or install as a go package (requires Go 1.18 or higher)
Command to run a local game
battlesnake play -W 11 -H 11 --name 'Rust Starter Project' --url http://localhost:8000 -g solo --browser
Continue with the Battlesnake Quickstart Guide to customize and improve your Battlesnake's behavior.
Note: To play games on play.battlesnake.com you'll need to deploy your Battlesnake to a live web server OR use a port forwarding tool like ngrok to access your server locally.