Skip to content

About

No description, website, or topics provided.

Resources

Stars

14 stars

Watchers

0 watching

Forks

Repository files navigation

jev-game-lab

Experiments in driving real-time games with TypeSafe Jev: a fast System One model makes the every-frame decisions, and a slower strategist (Claude, through an MCP server / CLI) makes the long-term ones. The first target is Brotato.

How it works (Brotato)

Brotato (Godot 3)                          Python sidecar                      Strategist
┌─────────────────────────┐   TCP 8765    ┌──────────────────────────┐  ctl 8766  ┌──────────────┐
│ Zawarudo-JevLink mod    │ ───state───▶  │ movement.py: facts per   │ ◀────────▶ │ Claude via   │
│  • gathers player,      │               │   compass direction      │  pending / │  ctl.py or   │
│    enemies (+velocity), │ ◀──reply────  │ policy.py: Jev System    │  decide    │  MCP server  │
│    projectiles, loot    │  ~7 Hz        │   One picks a direction  │            │  (level-ups, │
│  • applies moves, shop  │               │ offers.py: shop/level-up │            │   crates,    │
│    buys/locks/sells     │               │   offers as text options │            │   shop)      │
│  • compass HUD overlay  │               │ sidecar.py: loop, logs   │            └──────────────┘
└─────────────────────────┘               └──────────────────────────┘
  • Python does the arithmetic, Jev does the judgement. Enemies, projectiles, loot and walls are binned into 8 compass directions with distance buckets, chargers are extrapolated along their measured velocity, and each direction becomes one Choice criterion in words (SAFE. Best escape route. 2 mid-range. Closest loot here.). Jev returns a probability per direction in ~250 ms; the mod pipelines two requests so decisions land at ~7 Hz.
  • The strategist sees offers, not pixels. Level-ups, crates and the shop pause the game until ctl decide <id> <answer> arrives (3, take, lock 1, sell w2, combine w0, reroll, go), with a timeout fallback to Jev.
  • The in-game compass shows what Jev sees: wedge colour = verdict, wedge length = probability, white rim = chosen direction, red dots = enemies (thick + tick = charging), short tags (escape, 3 near, DASH!, corner 210, loot) around the rim. F7 toggles it, F8 toggles the bot, F9 forces a mod reload.
  • Hot reload. The mod host compiles jev_link.gd from the checkout whenever it changes, so mod edits need no game restart; policy edits need a sidecar restart (do both between waves).

First full clear (20 waves, Danger 0) on 2026-09-19 with Jev moving and Claude strategising.

Layout

games/brotato/mod/        Godot mod (ModLoader) + deploy.py
src/jev_game_lab/
  brotato/movement.py     per-direction facts -> Jev criteria (+ hud_tags for the compass)
  brotato/policy.py       JevBrotatoPolicy: movement every frame, fallback level-up/crate/shop
  brotato/offers.py       strategist offers <-> mod replies
  brotato/sidecar.py      TCP server, pipelined combat frames, decision queue, jsonl logs
  brotato/ctl.py          CLI: eval GDScript in the live game, pending, decide, state
  brotato/mcp_server.py   the same four operations as MCP tools (project-scoped .mcp.json)
  brotato/screen.py       screenshot / click / key on the game window
  smoke.py                one Jev call over a toy state
docs/brotato.md           setup and operating notes
logs/                     run logs (jsonl) and screenshots (git-ignored)

Quick start (Brotato, Windows)

  1. uv sync, copy .env.example to .env and set TYPESAFE_API_KEY.
  2. Subscribe to the "[Modders] mode" workshop item and run uv run python games/brotato/mod/deploy.py, then start Brotato with mods enabled (see docs/brotato.md for why the placeholder item is needed).
  3. uv run brotato-sidecar --policy jev --auto-restart — or add --strategist claude and answer decisions with uv run python -m jev_game_lab.brotato.ctl pending|decide (or the brotato MCP server from Claude Code).
  4. Start a run; the character moves on its own. F8 hands control back to you.

About

No description, website, or topics provided.

Resources

Stars

14 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages