diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2021-12-26 22:01:27 +0100 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2021-12-26 22:01:27 +0100 |
commit | 044e13940ed2fa8882fe39c5981fc4eb16efe69c (patch) | |
tree | 830ec934eae1b75fed1ea9d01989e96535b5e6aa | |
parent | 31b439ee313c9268ac338dd130390d4f7200e693 (diff) | |
download | planetwars.dev-044e13940ed2fa8882fe39c5981fc4eb16efe69c.tar.xz planetwars.dev-044e13940ed2fa8882fe39c5981fc4eb16efe69c.zip |
add general README
-rw-r--r-- | README.md | 56 | ||||
-rw-r--r-- | planetwars-cli/README.md | 11 |
2 files changed, 57 insertions, 10 deletions
@@ -1,3 +1,59 @@ # 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: +```bash +cd web/pw-frontend +npm install +npm run build-wasm +npm run build +``` + +Then build the backend: +```bash +cd planetwars-cli +cargo build --bin pwcli --release +``` + +You can install the binary by running +```bash +cargo install --path . +``` + +## Getting started +First, initialize your workspace: +```bash +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: +```bash +pwcli run-match hex simplebot simplebot +``` + +You can now watch a visualization of the match in the web interface: +```bash +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! diff --git a/planetwars-cli/README.md b/planetwars-cli/README.md index 763a3b1..db2a67b 100644 --- a/planetwars-cli/README.md +++ b/planetwars-cli/README.md @@ -1,10 +1 @@ -# planetwars-localdev - -Tools for developping planetwars bots locally. - -## Getting started - -1. Initialize your workspace directory: `pwcli init my_workspace` -2. Enter your fresh workspace: `cd my_workspace` -3. Run an example match: `pwcli run-match hex simplebot simplebot` -4. View your match in the web UI: `pwcli serve` +# planetwars-cli
\ No newline at end of file |