Skip to content

Added engine-side state introspection via WebMCP tools#10

Merged
celso merged 1 commit into
cloudflare:agentic-doomfrom
ruifigueira:webmcp
May 19, 2026
Merged

Added engine-side state introspection via WebMCP tools#10
celso merged 1 commit into
cloudflare:agentic-doomfrom
ruifigueira:webmcp

Conversation

@ruifigueira
Copy link
Copy Markdown

Adds WebMCP tools that let agents play Doom directly from the browser. The page now exposes a context-dependent toolset that swaps as the screen changes (home → IWAD picker → in-game), giving agents structured access to menus, HUD state, and input — no vision or DOM scraping required.

Tools

Home screen

  • start_game — Start a new game. mode: "solo" | "multiplayer". Advances to the IWAD picker.

IWAD picker

  • choose_iwad — Pick the game data. iwad: "doom1" | "doom2" | "tnt" | "plutonia" | "doomu".

In-game

  • press_key — Press and release a single key. key covers movement (forward, backward, strafeLeft, strafeRight, up, down, left, right), actions (fire, use, speed), menus (enter, escape, backspace, yes, no), weapons (17), and game keys (tab, pause, say, f2, f3, f6 quicksave, f9 quickload). Optional holdMs for held inputs (default 50 ms; use a few hundred for movement).
  • get_state — Structured engine state: screen (title | menu | playing | demo | automap | intermission | dead | finale), hud (health, armor, ammo, ammo_type, weapon, face_state, keys), enemies_visible (bearing + distance bins), in_combat, low_health, caption. screen: "demo" signals attract-mode playback — agents should call start_new_game or press_key('escape') instead of trying to play.
  • get_screenshot — Pixel-perfect 320×200 PNG read directly from the engine's framebuffer with the gamma-corrected palette applied.
  • get_menu — Engine-level menu read: { cursor_index, is_save_menu, is_load_menu, items: [{ index, label, enabled, cursor, hot_key }] }, or null when no menu is open. Known M_XXXXX lump names are translated to human-readable labels (e.g. M_NGAME"New Game"); save/load slots return user-typed names. Drive the cursor with press_key('up' | 'down'), activate with press_key('enter'), back out with press_key('escape').
  • start_new_game — Fast-path Esc → New Game. Works from the title screen and from attract-mode demos. Lands on the skill picker; Nightmare confirmation answered with press_key('yes').

@celso celso merged commit cc9de8d into cloudflare:agentic-doom May 19, 2026
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants