Chatdom

Chatdom turns a Twitch chat into a living voxel kingdom. Every chatter lights a window, earns a home and an avatar, and can walk in to fish, play and build with the rest of chat. Everything that happens on Twitch, from a first message to a cheer, a hype train or a raid, happens in the world too, live on stream.

▶ Try it now: chatdom.io


Inspiration

Twitch chats are communities. People show up night after night and know each other's names, jokes and emotes. Yet a chat scrolls away and leaves nothing behind. We wanted to give those people a place: somewhere your presence leaves a mark, your regulars live down the street, and a raid is a caravan arriving at your gates. It shouldn't be a game the streamer has to run. It should be a world that simply reacts to the stream they're already doing.

What it does

Inside the stream

It lives inside the stream. The kingdom runs in the player as a browser source, at golden hour, at dusk or at night, while chat flows beside it. Viewers see their own messages appear in the world a heartbeat later.

The Twitch Extension

One click under the stream. The Chatdom Twitch Extension panel has three tabs: Kingdom, which shows tonight's lit windows and what is happening right now; You, with your citizen card and passport; and Gifts. Press "Take your place" and your window lights up in the kingdom on stream. The panel signs viewers in with Twitch extension JWTs, reads its settings from the Configuration Service, and pushes live state over Extension PubSub. Gifts are Bits in Extensions products: a feast, lanterns or fireworks over the square. Their receipts are checked server-side against Twitch transactions before the whole kingdom sees the moment.

The Chatdom panel extension The panel under the stream: the live kingdom, your lit window, your citizen card, and gifts for a friend.

Presence

Every chatter lights a window. A message turns your light on, and lurkers get an unnamed light of their own. Your first message pitches a tent with your name at the edge of town. Keep coming back, and qualified days of presence grow it into a hut, a cottage, a house, a manor and finally a hall.

Chat is the controller

Cheer The Skyfire aurora Channel points Hype train

Chatdom maps 40+ Twitch events to things that happen in the world, and every one of them is credited to the person who caused it:

  • Chat message / first message → Your light turns on / a tent with your name
  • Follow → A sapling grows by your door
  • Sub / resub → Your banner unfurls in your tier's colour, with ribbons for months
  • Gift sub → A parcel sealed with the giver's name lands on the recipient's door
  • Cheer (Bits) → Fireworks rise from your home, and big cheers unroll the Skyfire aurora
  • Channel points → Ring the bell, call a festival, raise the scaffold of a new building
  • Hype Train → The festival train circles the walls; at level 3 the dragon wakes
  • Poll / Prediction → A decree board in the plaza / an odds board in the tavern
  • Raid in / out → A caravan under the raider's banner / the kingdom rides out, and a road is inked on the Atlas
  • Going live / offline → Dusk falls and the beacon catches / the kingdom rests and the night's ballad is sung
  • !forge <wish> → The Forge makes your wish into a piece of your house
  • Timeout / ban → Bubbles vanish, and you go home

Your own avatar

Avatars Wardrobe

Every chatter gets a hand-built voxel citizen with four body families, ten skin tones, hair, hats, outfits and cloth capes. You wear what you've earned: sub pieces, a tier-3 rainbow cape, mod sashes. The Mirror lets you restyle yourself at any time.

Step inside

Tavern

Meet your chat at the tavern. Walk in third-person with a minimap, sit at a table and play: Pong, Stones and Hearth Dice. Every table runs server-side at 30 Hz, so the people watching your game see the same game you're playing.

Fishing

Fish off the pier. Cast, wait for the bite, then fight the line. There are 28 species, each with its own lore and fight style. Casts are resolved on the server, and the first catch of each species is credited to whoever landed it ("First in Willowmere").

The Forge

Speak a wish, and OpenAI Codex forges it. A chatter types !forge a chimney shaped like a sleeping dragon, and the wish goes to Codex models through codex exec --output-schema: Luna checks the wording and Terra drafts a typed house-part plan. A deterministic builder then turns that plan into voxels, and while runes glow, metal pours and the hammer strikes, the piece lands on that chatter's home, live on stream.

Growth

It grows with you. The hamlet becomes a town and the town becomes a grand city, as your community keeps coming back. Homes are placed by the people who earned them. In build mode you can raise your own walls, and you can import MagicaVoxel models.

Travel

Raids

Raids become caravans. When a raid lands, the raiders arrive at the gate under their own banners, braziers flare and the crier welcomes them. Every kingdom you visit gets stamped into your passport.

Passport

The Atlas

The Atlas: a map of all of Twitch. Built from public Twitch data, it holds 166,000 channels, and 57,000 of them have holdings on the map. Each big streaming language is a continent. Channels gather into realms by the games they play, and bigger audiences build bigger towns. Live channels glow in a watercolour wash that refreshes every 3 minutes, and every raid leaves an inked road between two kingdoms. Search for any channel, then walk into any kingdom that has been founded.

Genesis

Genesis. Every channel on the Atlas already owns unfounded land, generated deterministically from its place on the map. A streamer founds their kingdom in a live ceremony: a charter, a chat vote and the land rising from the sea in 15 seconds.


How we built it: Codex as the studio

Chatdom was built in four days (30 Oct – 2 Nov) in one main Codex thread that planned, wrote the contracts, delegated, reviewed, merged and tested. It produced 1,381 commits, about 450k lines of TypeScript, 877 test files and 57 specs.

Orchestration: specs first, then many builders.

  • The main thread wrote each separable part as a spec plus a task list (PRD). Those parts included the Atlas, the panel, Twitch ingest, the tavern games, the pier, wardrobe pieces, props and homes. It used two skills we made for this: write-spec and ralph-lane, a loop of one task, one check and one commit.
  • Parallel worker sessions then picked each spec up in its own git worktree and folder scope: 76 lanes over the build, often 10 at a time. The main thread reviewed every lane, integrated it across contracts, ran the tests and merged.
  • Inside its own turns, Codex used sub-agent roles we defined in .codex/agents/: an architect, builders, artisans for voxel art, checkers for tests and screenshot sweeps, an adversarial read-only critic, and scouts for recon.
  • Before specifying a part where great open source exists (voxel meshing, water, netcode, map rendering), Codex ran a study-reference pass. Scouts mapped the candidates, and deeper agents took the best ones apart. That left 26 study notes behind, and the credits are in THIRD_PARTY.md.

The right model for each job.

  • GPT-6 Astra (xhigh): the things we had to nail. That covers the voxel engine, the world model and simulation, the realtime room contracts, the avatar rig and the Forge grammar, plus milestone reviews and the critic.
  • GPT-6.1 Sol (high): most features, integration, the Twitch server and merges.
  • GPT-6.1 Terra: the workhorse. It ran the voxel art in volume (props, homes, wardrobe pieces, VFX), fanned out 4–8 at a time with one folder each, plus tests and Playwright sweeps.
  • GPT-6 Luna: scouting and summaries.

Twitch skills from day one. Before writing any product code, we gave Codex five Twitch skills:

  • twitch-dev: the auth and surface hub.
  • twitch-api: all 149 Helix endpoints, with scopes, token types and rate limits.
  • twitch-eventsub: all 83 subscription types, with payloads and conduit setup.
  • twitch-chat and twitch-extensions: JWTs, Bits products and the Configuration Service.

Codex could then wire EventSub, Helix and the Extension correctly on the first try, without guessing scopes.

Art and sound.

  • We used Codex image generation for UI inspiration and painted art direction through a chatdom-art skill, then translated the result into voxels and CSS.
  • A look skill made every visual change prove itself with screenshots at standard sizes, judged against the art direction ("done means demonstrated").
  • The soundscape is synthesized in Web Audio code Codex wrote, on a D-major pentatonic palette, layered with CC0 recordings.

Codex inside the product: the Forge. The Forge runs Codex models at runtime, through codex exec --output-schema with a read-only sandbox and a warm codex app-server over stdio.

  • GPT-6 Luna checks the wish's wording. GPT-6.1 Terra drafts a strictly-typed HousePartPlan, choosing one of 7 motifs and one of 3 style kits and attaching the piece to sockets derived from your actual house (stack, saddle, bracket or post).
  • The model never emits voxels, so it can't produce broken geometry. A deterministic builder turns the plan into voxels.
  • Two independent model reads review a rendered contact sheet. A wish is refused only when both flag the same concern.
  • Each wish has a budget of 5 calls, and quality is scored by the host, not by the model.

Architecture

Twitch EventSub (conduit, WebSocket shard) ─┐
Twitch Extension (JWT, Bits, Config, PubSub)┼─> herald (ingest) ─> world events ─> realm (Colyseus, 1 room per kingdom)
Helix (chatters, raids, announcements …)   ─┘                                       │  Postgres single-writer + outbox
                                                                                    v
             chatdom.io (Solid + three.js voxel client, PixiJS Atlas) <── district-scoped state patches
  • Monorepo: 9 apps and 12 packages in TypeScript (pnpm, Vite, Vitest, Playwright, Zod).
    • The client is Solid + three.js, the Atlas is PixiJS, and the server is Colyseus on uWebSockets, backed by Postgres.
    • Frozen contracts in packages/shared let parallel lanes build against stable types.
  • Multiplayer with Colyseus:
    • Room types: a kingdom room and a tavern room, filtered by kingdom id, so every channel's kingdom is its own room. A kingdom with nobody in it holds no room open.
    • Movement: simulated at 30 Hz, with state patches at 5 Hz, client input queues and one action in flight.
    • Interest management: 48 m districts with 4 m hysteresis. You see your district and the ring around it. Everyone in a district shares one StateView, so each patch is encoded once per district, not once per client. In a 6-client simulation, a steady-state district cost 5.3 KB/s, and crossing into a new district cost one 860-byte snapshot.
    • Limits and reconnects: a 16 KiB inbound frame cap and 1 MiB of backpressure per socket. Reconnects resume with a full state resync.
    • Persistence: each kingdom has a single writer in Postgres, protected by a lease with fencing tokens and an inbox/outbox, so a kingdom can never be written by two servers. That is what lets kingdoms shard horizontally across realm processes.
  • Voxel engine:
    • 32³ chunks with greedy meshing and baked corner ambient occlusion.
    • A flood-fill light field with 16 levels, so windows light the street.
    • Three voxel scales: terrain at 0.5 m, house parts at 0.125 m and avatars at 0.0625 m.
    • Meshing, terrain, light and the Atlas bake run in about 15 web workers, with LOD crossfades, instancing, water, sky, clouds and a tiered post stack.
    • Measured on an RTX 5080 at 1080p: p50/p95/p99 frame times of 2.9/5.7/8.4 ms, with 0 of 2,403 frames over 33 ms and first paint at 0.77 s.
  • Atlas:
    • A Surveyor service collects public Twitch data.
    • The map is a PixiJS tile pyramid baked in a worker, with live frames pushed over SSE.
    • Atlas editions are hash-chained, and kingdom foundings are gated on Ed25519 signatures.

Challenges we ran into

  • Making a world react without becoming noise. A busy chat sends hundreds of events a minute. We designed every event as a spectacle (what you see now) plus a trace (what stays), credited to a person, so the world stays legible.
  • Realtime at Twitch scale. We wanted one room per kingdom and hundreds of walkers per room without per-client encoding costs, which led to the district-scoped shared views and the single-writer lease design.
  • Letting an LLM build things safely. We wanted wishes to become real objects without unsafe or broken output. The answer was a typed grammar, sockets taken from the actual house, and a deterministic voxel builder, with the model only choosing.
  • Coordinating dozens of parallel builders. Frozen contracts, one owner per folder and a single integrating thread were what kept 76 lanes merging cleanly.
  • Pointer lock on Linux Firefox sends phantom mouse events. We had to build a mouse lab to find the cause and filter it out.

What we learned

The biggest lesson was how far one well-run Codex thread can go when it acts as an orchestrator, not a typist. It wrote specs that other sessions could pick up cold, chose a model for each task and spent its own context on contracts, review and integration. Skills mattered more than prompts: once Codex had our Twitch skills, EventSub, Helix and the Extension just worked.

What's next

Next is depth: more to do, more to earn, and a clear path for every kingdom to grow. We have far more ideas than nights, and these come first.

  • Kingdom tiers. A hamlet grows into a town, a city and finally a capital, with visible unlocks at each step: a market square, a harbour, walls, a cathedral.
  • Community quests. Weekly goals the whole chat completes together, like raising a bridge, filling the granary or lighting every window on a lane.
  • Personal quests and professions. Citizens pick up fishing, the forge or building, level them up, and leave their mark on the town.
  • Seasons. Atlas-wide events where every kingdom plays its part, with a season board and leagues.
  • Guilds. Groups of citizens with their own hall, banner and goals.
  • Trade and roads. Raids build roads between kingdoms, and goods and visitors travel along them.
  • A festival calendar. Harvest feasts, winter lights and midsummer fires that change the town for a night.
  • More tavern games and tournaments. New games, brackets and champions remembered on the wall.
  • Decrees and polls. The streamer issues decrees and chat votes on them, with real consequences in the world.
  • Community-made pieces. The community votes on and designs new Forge pieces and buildings.
  • A public panel extension. The Twitch Extension goes from Hosted Test to release, so any channel can add it.

We will build all of it with our communities, in the open.

Built With

Share this project:

Updates

posted an update —

Extension ID in case that is relevant ( a2w491amyuqkkb6m5yd6f8ym7ctm1h ) - in testing state and added to my account (twitch.tv/tobi4s_), v0.0.2 (added there before deadline, just wouldn't make the review in time)

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

Submission history