Short description

ROOMMATES is a seven-day autonomous relationship simulation. The player can offer one everyday suggestion but cannot control either resident. Two AI roommates decide independently from the same world state, and a Director agent reconciles their choices into a shared event. Their trust, affection, stress, memories, and relationship evolve from what they actually choose to do.

Inspiration

Many relationship games turn another person's feelings into a meter that the player can optimize. That can make characters feel like interfaces rather than people. We wanted to explore a different question: can a game let the player create a good environment for connection while preserving each character's agency? In ROOMMATES, rejection or modification is not a failure state. It is evidence that the character owns the choice.

What it does

ROOMMATES follows two autonomous residents through seven days of shared life. The player offers one everyday cue per turn. Both residents independently interpret the same situation through their profiles, memories, needs, and personality traits. A Director combines their choices into a multi-beat event with movement, actions, and dialogue.

The game records memories and state changes, animates transitions between four daily phases, and relocates residents to furniture-aware starting positions. Character Studio supports editable names and personalities, while Asset Manager supports replaceable characters, furniture, placements, and action anchors. At the end, the game presents a recap, character reflections, and an evidence-based Dekopin Support Score.

How we built it

The map-first client uses React, Vite, and TypeScript. Express and a Cloudflare Worker provide the game runtime, with D1 persistence for anonymous hosted sessions. Shared Zod schemas define game state, agent inputs, structured outputs, public DTOs, and Server-Sent Events.

For each turn, the engine safely resolves the player's input and freezes one world snapshot. Navigator, Haru, and Aoi run concurrently. The two residents remain isolated and receive the same snapshot. After all three results finish, the Director reconciles the resident proposals. Every output is schema-validated, numeric effects are clamped, and only deterministic engine code can commit state.

The provider chain is authenticated Codex App Server Agent Worker, OpenAI Responses API, then deterministic schema-valid fallback. The checked-in provider default is GPT-5.6 (gpt-5.6-terra). Failures are isolated per role so one unavailable or invalid response does not break the turn.

How we used Codex

Codex collaborated across the full build loop: translating the premise into typed state and safety contracts, implementing the map-first experience, iterating Character Studio and Asset Manager, splitting work into issues and pull requests, generating tests, diagnosing edge-runtime compatibility, reviewing privacy boundaries, validating deployments, and assembling submission evidence.

The human team retained the central product decisions: players may influence but not control; residents decide independently; relationship outcomes require compatible choices; generated output cannot mutate state directly; and graceful fallback is preferable to a broken experience.

How GPT-5.6 is used

GPT-5.6 writes the Navigator's acknowledgement, lets both residents independently interpret the same situation, allows the Director to resolve compatible or conflicting intentions, and produces read-only end-of-game reflections. Model output never directly mutates game state. Role-specific schemas, deterministic rules, bounded effects, and provider attribution keep the generated behavior inspectable and safe.

Challenges

The hardest problem was preserving believable autonomy without losing a reliable game loop. Parallel model calls can disagree, time out, return malformed data, or finish in different orders. We addressed this with one frozen snapshot, isolated resident scopes, a Director boundary, Zod validation, idempotency and revision checks, bounded effects, per-role retries, and provider fallback.

A second challenge was adapting a local-process-oriented Codex App Server architecture to an edge deployment. We separated the authenticated Agent Worker from the public runtime and added a direct Responses API route so the same contracts work locally, in production, and in deterministic judging mode.

Accomplishments

  • Two genuinely separate resident decisions become one coherent visible event.
  • Players can shape the story without forcing either character's choice.
  • The full seven-day arc, recap, reflections, and explainable score are playable.
  • Names, personalities, sprites, furniture, placements, and action anchors are replaceable.
  • Multi-beat scenes move between several locations with actions and dialogue.
  • Partial provider failure does not make the game unplayable.
  • Final verification passed 617 automated tests, type checks, production builds, and reported zero production dependency vulnerabilities.

What we learned

Agentic game design needs stricter boundaries than a linear chatbot. Interpretation and character consistency benefit from a capable model, while state ownership, consent rules, retries, idempotency, and scoring are clearer and safer as deterministic code. Showing per-role provider attribution also makes fallback understandable instead of hiding it from players and judges.

What's next

We would add longer-term asymmetric memory, more residents and living situations, multiple save slots, replayable agent timelines, richer non-romantic relationship events, and optional voice and facial expression. We also want to turn the existing asset contracts into a broader platform where creators can import complete room and character packs. Cancellable background simulation jobs and restart recovery are designed future steps and are not claimed as implemented.

Built With

  • agent-worker
  • cloudflare-d1
  • cloudflare-workers
  • codex
  • codex-app-server
  • drizzle-orm
  • express-5
  • npm-workspaces
  • openai
  • openai-gpt-5.6
  • openai-responses-api
  • react-19
  • server-sent-events
  • typescript
  • vite-6
  • vitest
  • zod
Share this project:

Updates