goatrodeo

>_ 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/.

Air Defenders in play: five launchers along the ground fire interceptors up at incoming drones while radar rings sweep the night sky and a player list shows five bots in the room

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.

30simulation steps a secondtickHz in multiplayer.go
8players in one co-op roommaxPlayers in multiplayer.go
4event keys publishedrows in topic-manifest.tsv
104 KiBthe solo game, one HTML filewc -c airdefenders/index.html

What 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.

Solo

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.

Co-op

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.

Fabric

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.

Air Defenders title screen: the game name in green, an empty high-score table with daily to all-time tabs, the key bindings, a press-space-to-start prompt and a co-op multiplayer button
Real capture, 800 × 700: the solo title screen.

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.

Design: airdefenders-leaderboard.md

Air Defenders solo play in wave 1: score 450, autopilot fire mode, a radar beam sweeping from the launcher across two orange drones and two gray aircraft among radar rings
Real capture, 800 × 700: solo play in wave 1, autopilot fire mode.

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.

KeyDoes
Spacelaunch from the active launcher
Arrow keyssteer the interceptor in flight
A / Dmove the launcher
Tabchange fire mode
Rresupply

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.

BotPlays like
triggerfires constantly, aims loosely, uses up the ammunition
deadeyewaits, lines up, steers by hand, rarely misses
gremlinchanges target and fire mode at random
dozerslow to decide, slow to move, takes naps
sloppyover-fires and switches targets a lot
squintonly shoots at what the radar can see
nomadroams the whole field, firing as it goes
camelholds 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.

The Air Defenders fabric demo page: a header with a goat sub command for the example goatnet zagros, and a four-by-two grid of game views labeled trigger, deadeye, gremlin, dozer, sloppy, squint, nomad and camel, all playing in the same room
Real capture, 1440 × 810: the /demo page 30 seconds after it opened, for the example goatnet zagros.
KeyPublished when
airdefenders/<site>/radar/detection/v1a radar sees a drone
airdefenders/<site>/missile/fired/v1a launcher fires
airdefenders/<site>/missile/intercept/v1an interceptor hits
airdefenders/<site>/shahed/impact/v1a 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 .
OpenFor
localhost:8095/solo
localhost:8095/mpco-op
localhost:8095/mp?bot=deadeyea bot
localhost:8095/demoall 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.