Example Rust AI for Screeps: World, the JavaScript-based MMO game.
This bot aims to provide a relatively capable Screeps bot, but with an emphasis on RTS-style manual unit control, enabled via scripts injected into the Screeps client via log messages.
This uses the screeps-game-api
bindings from the rustyscreeps organization.
Instead of cargo-screeps
, this example uses wasm-pack
, rollup
, and the
screeps-api
Node.js package for building and deploying the code.
# Install rustup: https://rustup.rs/
# Install wasm-pack
cargo install wasm-pack
# Install nvm: https://github.com/nvm-sh/nvm
# (Windows: https://github.com/coreybutler/nvm-windows)
# Install node at version 20
nvm install 20
nvm use 20
# Install deps
npm install
# Set up for upload
cp .example-screeps.yaml .screeps.yaml
# (edit file, add API key etc)
# deploy to a configured server
npm run deploy -- --server mmo
# local benchmarking server under docker
cp .example-env .env
# edit .env, add steam api key
# install docker compose
# starts containers, resets server then deploys code, runs until target RCL or tick
npm run benchmark -- --steamid your-steam-id