>_ goatrodeo --play
goatrodeo
Games and toys that run on a goat data fabric.
Each one is fun to play and publishes real events while you play it. Air Defenders is the first: a browser arcade game, solo or co-op, that runs on a laptop with one Go command.
$ cd ops/serve/airdefenders $ DB_PATH=./local-scores.db AD_DEMO_UNGATED=1 SITE_ID=zagros go run .
From a clone of the repository; then open http://localhost:8095/.
A real capture: the co-op room with five auto-pilot bots, 8 seconds at 12 frames a second. How it was made: docs/media/CAPTURES.md.
tickHz in multiplayer.gomaxPlayers in multiplayer.gorows in topic-manifest.tsvwc -c airdefenders/index.htmlWhat it is
One small Go program with three web pages inside it. One container, one process, one SQLite file. None of it is needed to run a goatnet; it sits beside goatcore, which builds the goatnet, and goatstuff, which holds the surfaces you would watch it from.
Air Defenders
Steer interceptors into incoming drones before they reach the ground. Three fire modes: steered by hand, proximity-fused, or seeking on their own. When a wave ends, the sky shows the path of every shot.
Up to 8 players, one room
One shared score and one set of lives; each player gets a launcher in their own color. The server owns the game and steps it 30 times a second; browsers send key presses and draw what they are told.
Events while you play
On a goatnet, four moments in the game loop are published onto the Zenoh fabric: a radar detection, a launch, an intercept, and a drone reaching the ground.
Shared high scores, and a board that still draws offline
High scores are shared between everyone who can reach the server and arrive live over Server-Sent Events. The browser keeps its own copy, so the board still draws when the network is away. The copy of the game on this page has no server behind it, so its scores stay in your browser.
Radars only show you part of the sky
You have one launcher, a handful of interceptors and three ways to fire them. Later waves add a second launcher, a siren that sends you running for the bunker, and a relief wave in which camels handle the air defense.
| Key | Does |
|---|---|
| Space | launch from the active launcher |
| Arrow keys | steer the interceptor in flight |
| A / D | move the launcher |
| Tab | change fire mode |
| R | resupply |
8 bots that play like people
Add ?bot=<name> to the co-op address and that browser tab plays by itself. A bot reads the same snapshots a person sees and sends the same key presses, so the server cannot tell the two apart. They are eight settings of one small loop in mp.html, tuned so that between them they press every button in the game.
| Bot | Plays like |
|---|---|
trigger | fires constantly, aims loosely, uses up the ammunition |
deadeye | waits, lines up, steers by hand, rarely misses |
gremlin | changes target and fire mode at random |
dozer | slow to decide, slow to move, takes naps |
sloppy | over-fires and switches targets a lot |
squint | only shoots at what the radar can see |
nomad | roams the whole field, firing as it goes |
camel | holds the middle and calls in the camels |
A traffic generator with a scoreboard
The /demo page fills the room with all eight bots from one tab and plays until you close it. With the publisher switched on (ZENOH_PUBLISH=1) on a goatnet, the game publishes these keys, and the command in the page header tails them. On a laptop the publisher is off and the game plays on its own.
/demo page 30 seconds after it opened, for the example goatnet zagros.| Key | Published when |
|---|---|
airdefenders/<site>/radar/detection/v1 | a radar sees a drone |
airdefenders/<site>/missile/fired/v1 | a launcher fires |
airdefenders/<site>/missile/intercept/v1 | an interceptor hits |
airdefenders/<site>/shahed/impact/v1 | a drone reaches the ground |
Schemas: ops/zenoh-trial-peers/airdefenders-schemas/. Runbook: airdefenders-zenoh-demo.md.
Run it
You need Go (the version in go.mod) and a browser. DB_PATH puts the high-score database in a local file, AD_DEMO_UNGATED=1 opens the bot demo page without a sign-in, and SITE_ID is the name the game would publish under.
On a laptop
$ git clone https://github.com/USAREUR-AF/goatrodeo $ cd goatrodeo/ops/serve/airdefenders $ DB_PATH=./local-scores.db AD_DEMO_UNGATED=1 \ SITE_ID=zagros go run .
| Open | For |
|---|---|
localhost:8095/ | solo |
localhost:8095/mp | co-op |
localhost:8095/mp?bot=deadeye | a bot |
localhost:8095/demo | all eight bots |
On a goatnet
The role and playbooks in ops/ansible/ deploy Air Defenders behind the goatnet's sign-in, from an assembled goatcore tree with this repository's ops/ copied over it. The image is built by airdefenders-image.yml and published as ghcr.io/usareur-af/airdefenders.
Add a game or a toy
Two house rules: it runs on a laptop with the fabric switched off, and it publishes something real when the fabric is on. Air Defenders is the pattern to copy: the service in ops/serve/<name>/, its schemas in ops/zenoh-trial-peers/, its captures and how they were made in docs/media/. Read CONTRIBUTING.md first.