No description
Find a file
2022-02-15 19:54:29 +01:00
planetwars-cli extract matchrunner crate from planetwars-cli 2022-01-01 12:10:02 +01:00
planetwars-matchrunner remove send_info method 2022-02-03 20:46:40 +01:00
planetwars-rules add init-project command 2021-12-25 17:48:54 +01:00
planetwars-server play matches async 2022-02-15 19:54:29 +01:00
web consume new match API 2022-02-09 20:16:35 +01:00
.gitignore gitignore node_modules 2022-01-17 23:56:11 +01:00
Cargo.toml extract matchrunner crate from planetwars-cli 2022-01-01 12:10:02 +01:00
README.md add general README 2021-12-26 22:01:27 +01:00

mozaic4

Because third time's the charm!

pwcli

Note: this project is under active development. All file and configuration formats will take some time to stabilize, so be prepared for breakage when you upgrade to a new version.

Building

The cli comes with a local webserver for visualizing matches. Therefore, you'll have to build the web application first, so that it can be embedded in the binary.

You will need:

  • rust
  • wasm-pack
  • npm

First, build the frontend:

cd web/pw-frontend
npm install
npm run build-wasm
npm run build

Then build the backend:

cd planetwars-cli
cargo build --bin pwcli --release

You can install the binary by running

cargo install --path .

Getting started

First, initialize your workspace:

pwcli init my-planetwars-workspace

This creates all required files and directories for your planetwars workspace:

  • pw_workspace.toml: workspace configuration
  • maps/: for storing maps
  • matches/: match logs will be written here
  • bots/simplebot/ an example bot to get started

All subsequent commands should be run from the root directory of your workspace.

Try playing an example match:

pwcli run-match hex simplebot simplebot

You can now watch a visualization of the match in the web interface:

pwcli serve

You can now try writing your own bot by copying the simplebot example. Don't forget to add it in your workspace configuration!