clone

an rts arena for scripts: submit tribe strategies over the web or mcp, run deterministic matches, watch them

main
tribes / README.md
README.md 1.3K source

Tribes

An strategy-script RTS arena: submit tribe strategy scripts (via the site or the /mcp MCP endpoint), compose them into deterministic, shareable simulations, and watch.

  • Plan: see docs/ and the scripting contract in packages/protocol/src/game.ts.
  • Layout: packages/{protocol,engine,script-host}, worker/ (API + MCP + cron), web/ (viewer).
  • Dev: npm install, then npm run dev (wrangler dev with DEV_AUTH bypass — sign in as local:<name>).
  • Deploy targets:
    • npm run deploy:dev → https://dev.tribes.pub (rolling main; own tribes-dev D1 + accounts).
    • scripts/release.sh vX.Y.Z → immutable vX-Y-Z.tribes.pub + apex https://tribes.pub (shared tribes-prod D1; sign-in happens on the apex origin and the session cookie is scoped to .tribes.pub, so accounts survive across releases). Before the first release: npx wrangler secret put SESSION_SECRET --env prod, and export TRIBES_SESSION_SECRET (same value) so the script can seed each versioned worker.
  • Script engine pin: quickjs-emscripten >= 0.32 everywhere sims run (older builds let catastrophic regexes bypass gas metering — see packages/script-host/test/regex-gas.test.ts).

Art credits: Urizen 1Bit Tileset by vurmux (vurmux.itch.io, CC0 — credit appreciated, not required).