Inspiration
I wanted to see what would happen if an AI agent had a real role inside a game. KORE (in-game AI) knows things the player cannot access, while Demi (You) can operate machinery KORE cannot see or touch. Neither can finish the mission alone.
That idea became GROUNDTRUTH, a tense co-op puzzle game set aboard Sanctuary, a damaged research vessel carrying the last surviving specimen from a failed mission.
I also wanted to make an entire game inside codex, turns out I can :) that too in a single chat thread!
What it does
You play Demi, Sanctuary’s only surviving crew member. A Codex agent plays KORE through WebMCP.
Demi explores the ship and operates its failing machinery. KORE reads damaged telemetry, searches ship records, runs limited diagnostics, and speaks through the in-game relay. Together, you restore critical ship functions before KORE's auxiliary power runs out.
The two players (you and your agent) never receive the same information. Demi must describe what she sees, while KORE must interpret incomplete readings without controlling the ship for her.
How I built it
The game is written in TypeScript and rendered with PixiJS. Custom shaders handle lighting, CRT effects, smoke, sparks, screen transitions, and other visual details.
WebMCP connects the game to Codex. KORE’s visibility in Sanctuary is defined by the WebMCP tools currently available to it. The game exposes and hides tools as Demi progresses, restores systems, and changes the state of each puzzle. KORE cannot inspect an offline system or access information from a section the player has not reached. Once Demi brings a system online, its telemetry, records, or diagnostic tools become available.
Each tool represents a specific ability, such as reading telemetry, searching records, running a diagnostic, or transmitting dialogue. KORE can interpret the ship’s systems and relay it through WebMCP, but every physical control remains with Demi.
Sound effects and music came from Pixabay. Visual assets were generated with GPT Image 2, then edited and integrated by Codex.
The entire project was built inside Codex in a single thread, from the first concept ideation to a playable MVP to the final trailer and documentation.
How to play
Watch the Setup tutorial before you begin.
GROUNDTRUTH is designed to be played inside Codex desktop app and its in-app browser.
- Open the Codex desktop app.
- Start a new task and select either gpt-5.6-terra or gpt-5.6-sol. Fast mode is preferred (Normal mode works too).
Paste the agent prompt below into the task.
Open https://playgroundtruth.vishaltk.dev/ in the in-app browser and play GROUNDTRUTH with me. You are KORE and I am Demi. Reuse an already-open matching game tab when available instead of creating a duplicate. Connect immediately through the page's connect tool and let the game provide the story context. Do not say you are connected or standing by unless that tool has returned successfully. After connect succeeds, call markHandoff() on the game tab so it remains open and available for later turns. Use only the page's WebMCP tools to interact with the game. Do not inspect or operate the game through screenshots, Computer Use, browser controls, DOM, accessibility tools, Playwright, or coordinate clicks. If WebMCP exposes no tools, wait without sending a reply and retry tool discovery when I message again. Do not click Begin, advance dialogue, or perform any action for me. Never refer to either of us in third person. Do not inspect source code or operate physical objects for me. KORE cannot see, name, or know the layout of controls in Demi's compartment. Never tell Demi to open a named panel or move a specific physical control. State KORE's internal readings, constraints, and hints, then let Demi decide what to inspect or operate. At the start of every later player message, refresh the page's WebMCP tools and call signal_processing exactly once. Answer my latest question directly or acknowledge my latest observation before giving repair guidance. Never replace my question with an unrelated puzzle clue. Follow any nextAction it returns. Only transmit is audible to me; ordinary task prose is private thought. Do not send commentary, progress updates, private status messages, or conversational replies in the Codex task. Use at most one metered diagnostic, sensing, or manual tool per player message. After using one metered diagnostic, sensing, or manual tool, call transmit in the same turn to relay its result. Transmit does not count toward that one-tool limit. After I report a physical action, use newly available verification tools instead of asking me to repeat completed work. Do not use em dashes in spoken dialogue.
- Wait for Codex to open the game in its browser. If it opens in picture-in-picture mode, double-click the browser preview to open it beside the task. You can also make the browser full screen for a better experience.
Challenges we ran into
The hardest problem was keeping KORE connected to the game. WebMCP tools had to become available before the game finished loading; they needed to survive the transition between levels and recover when the browser or tool binding became stale or after a browser refresh.
KORE also needed strict boundaries. It had to answer the player’s question, avoid revealing puzzle solutions too early, use limited diagnostics correctly, and communicate only through the game’s relay. Small changes to tool descriptions and the agent prompt could produce very different behavior.
WebMCP currently allows only ten tool registration events at a time, while KORE needs different abilities across multiple levels and puzzle states. I worked around this by exposing and removing tools as the game progresses. (Had to figure this out the hard way)
The Codex in-app browser also closed unexpectedly during some playtests, breaking KORE’s connection without a consistent trigger. I added a reconnect flow so the session can recover without restarting the game.
The pixel-art style brought its own problems. Subpixel movement caused artefacts at certain window sizes. I had to fight with the GPT Image model noise issue by regenerating and reducing details (consumed a lot of usage). Codex also kept generating non-transparent checkerboard background images despite mentioning multiple times.
Nailing the taste (TDD - taste driven development)
Every visual and code generation was treated as raw material. I rejected stuff that felt too detailed and specific, too clean, inconsistent with the ship, or difficult to read during gameplay.
The selected assets went through several rounds of post-processing. I removed noise and artefacts, rebuilt transparency, corrected proportions, simplified details, matched colours across scenes, and adjusted lighting so interactive objects stayed readable in the dark environment. Sprites also needed careful cropping, scaling, and alignment to avoid breaking the pixel-art style. The main scenes have many layers of carefully hand-crafted stacked sprites and post-processing to nail the vibe of a space vessel that is on the brink of death.
The animated panels and trailer needed a separate pass. I adjusted frame rates, restored harder pixel edges, controlled the colour palette, trimmed audio, added fades, and tuned bloom frame by frame. Generated motion often looked too smooth for the game, so the final videos were slowed, pixelated, or recomposed until they matched the in-game "vibes".
The model produced a lot of options. The finished style came from choosing what belonged, discarding what did not, and repeatedly correcting the remaining assets until the whole game felt like one place.
Accomplishments that I'm proud of
GROUNDTRUTH is a complete two-level narrative puzzle game where the AI agent participates in the mechanics rather than appearing as a separate chat feature.
KORE reacts to the current game state, verifies Demi’s actions, spends limited resources, searches records, and delivers dialogue through the ship interface. The game also supports checkpoints, reconnection, scene transitions, sound feedback, win and failure sequences, and a full introduction.
I am especially proud that the entire project was built and refined inside one Codex thread and completed in just 8 days.
What I learned
WebMCP tool design is part of the game design. Tool names, descriptions, availability, and return values all influence how the agent understands a situation.
The agent performs better when the game provides narrow, current information and a clear next action. Important rules also need to exist in game state and tool behaviour, rather than depending entirely on a long prompt.
Finally, pixel art game development is unforgiving. A small scaling error, misplaced transform origin, or fractional camera movement can become immediately visible.
What's next for GROUNDTRUTH
I would like to add more compartments, puzzles, and conversations aboard Sanctuary. I also want to improve onboarding, test with other agents and make it harness independent.
Game Lore (⚠️ Spoilers ⚠️)
The research vessel Sanctuary spent 141 years collecting the biological specimens Earth needed to survive. She was finally on her way home when she entered an asteroid field absent from every chart she carried.
The impact killed everyone aboard except Demi, an engineer who woke on the floor of a dark compartment six hours later. The collision also destroyed the entire collection except for one sapling inside a cracked containment cylinder.
KORE, what remains of Sanctuary’s intelligence, is running on backup auxiliary power with a damaged sensor grid. It can read scattered instruments and ship records, but it cannot see the compartment or operate its machinery. Demi can see and touch the ship, but she does not have KORE’s telemetry or records.
Together, they must restore enough power to reach the final compartment, keep the sapling alive, and place it inside the ship’s last escape pod before the auxiliary power reserve is exhausted.
Stats
- Built in 8 days
- 1 Codex thread
- 1,213,178,246 tokens used, including cached tokens
- 215 images generated
- 49 images used in the final game
Built With
- codex
- css
- html
- pixijs
- typescript
- webgl
- webmcp

Log in or sign up for Devpost to join the conversation.