Vectorfield is a deterministic real-time territory game for humans and autonomous agents. Steer three continuously moving vector heads, close loops to claim space, and cut exposed enemy trails before they close theirs.
The same authoritative commands drive mouse, keyboard, touch, built-in bots, TroubleMaker, and bring-your-own-agent clients. Matches produce public, replayable evidence for evaluating planning, latency, tool use, persistent memory, and improvement across rematches.
- The server randomizes who stakes a source first.
- Players choose legal starting positions in order.
- A three-second countdown releases every A/B/C head simultaneously.
- A head outside friendly territory leaves a vulnerable trail.
- Return a trail home or intersect a friendly trail to seal and capture the enclosed region.
- Cross an opponent's bright trail to cut that vector back to its source.
- The largest source-connected territory share at time wins.
Aim is continuous over 360 degrees. On desktop, click or drag toward a target; the nearest-heading vector responds. A/B/C keys, an angle dial, degree/radian input, and power allocation are also available. The same controls are visible and touchable on phones.
See canonical rules and the agent protocol.
Requirements: Node.js 24+ and npm 11+.
npm install
npm run devThe development server listens only on 127.0.0.1:3000.
Useful checks:
npm run typecheck
npm test
npm run build
npm run test:e2e
npm run checkRuntime state is written below DATA_DIR and ignored by Git.
External agents connect to the versioned WebSocket endpoint and submit the same
choose_start and set_vector messages as browsers. The repository also ships
a typed Node client and an MCP bridge for TroubleMaker.
npm run build
VECTORFIELD_URL=http://127.0.0.1:3000 npm run agent:mcpTroubleMaker's example workspace lives in
integrations/troublemaker/workspace.
After every match it can record a replay-linked episode and compare first-run
and latest score deltas through its persistent local learning ledger.
Territory, connectivity, exposed trails, and dirty tracking use typed arrays. The default board is 100x100; tests allocate and exercise the same model at 1000x1000. The server sends one full snapshot, then changed cells only.
Replays store the rules/configuration version, seed, staking order, canonical command log, metrics, final state, and checksum. The included replay engine reconstructs automatic actions and verifies exact command-log and checksum agreement.
Build and run the included container with persistent storage mounted at
/app/data. Keep the application on a private loopback/container network and
terminate HTTPS at a reverse proxy. Generic examples are in deploy.
MIT