Inspiration

Twitch chat is already a place where communities gather, react, and create shared moments. I wanted to give those interactions a visible home.

That became Chatville: a cozy village where each viewer owns a little house, and a quiet stream can suddenly turn into a scramble to survive a meteor, acid rain, or a tornado. The idea was to make participation simple enough that someone could understand it, type a command, and immediately see themselves become part of the stream.

What it does

Chatville is a multiplayer village game played entirely through Twitch chat and displayed as an OBS browser overlay.

Viewers type !join to claim a house with their Twitch name. When the broadcaster launches a disaster, the bot announces what is coming and how to defend:

  • Meteor: !shield creates a glowing dome over your house.
  • Acid rain: !umbrella protects against damage at the 15- and 30-second marks.
  • Tornado: !anchor protects houses in the randomly selected danger row.

Each viewer protects their own house. Missed defenses cause damage, progressing from cracks to fire and eventually rubble. Between disasters, viewers can use !repair to patch up their home or !rebuild to restore a destroyed one.

Personal survival counts, streaks, and a crown give viewers goals beyond a single round. Every five personal saves automatically upgrades their house’s appearance, progressing from a cottage to more elaborate homes. These cosmetic upgrades survive rebuilding.

Viewers can check their progress with !stats and learn the commands with !help. They never need to leave Twitch chat to play.

How I built it with Codex

I built Chatville through an iterative workflow with OpenAI Codex, starting with a detailed game specification and developing it in stages.

First, we connected Twitch chat to a working village and verified that !join created a named house. Next came the original meteor-defense loop. After testing that experience, I expanded the design into personal house defense, multiple disasters, damage states, progression, and clearer viewer instructions.

The server uses Node.js, TypeScript, tmi.js, and WebSockets. It processes chat commands, owns the game rules and timing, and broadcasts village updates to connected overlays.

The overlay uses React, TypeScript, and Vite. Its artwork and effects are built with CSS, inline SVG, and canvas, including the houses, protection domes, rain, meteor trails, and tornado debris.

Codex helped implement the code, write tests, debug integration issues, and refine the visuals in response to my feedback. We also built a development-only simulation tool so multiple players and different outcomes could be tested without needing a separate real account for every house.

Challenges I faced

One challenge was making the disaster rules fair and predictable. The defender pool freezes when a disaster begins, so joining halfway through cannot change who is at risk. Duplicate defenses do not count, and the server resolves damage deadlines before accepting late commands.

Another challenge was presentation. The original fixed-size overlay put the countdown outside a smaller preview window. We fixed that by scaling the complete 1920×1080 scene to fit the viewport.

Visual iteration mattered just as much as the mechanics. A large banner initially obscured too much of the action, so it became a compact status strip. Each disaster gained its own lighting and atmosphere, and motion details were corrected so the meteor’s tail trails behind its movement and fragments spread from a shared breakup point.

Viewer onboarding also needed refinement. The first help response was too dense in Twitch chat, so I simplified it into one concise message with clear command labels.

What I learned

I learned how much work sits between a functional prototype and an experience that viewers can understand at a glance. Clear feedback, readable instructions, and visible consequences are central to making a chat-controlled game enjoyable.

I also learned to use Codex as an iterative development partner: define concrete rules, build a small working slice, test it, and use observed problems to guide the next change.

The project currently passes 26 automated tests, covering game rules, timing boundaries, progression, broadcaster permissions, help messages, and motion calculations. I tested live chat interactions on my Twitch channel and used local simulations to exercise multiplayer scenarios.

What’s next

Chatville currently supports 24 houses and keeps progress in memory for the running session. The next step is feedback from more streamers and communities to improve onboarding, balance the disaster loop, and make setup easier.

My goal is for Chatville to become a small, welcoming ritual on stream: claim a home, protect your progress, and give chat something memorable to experience together.

Built With

Share this project:

Updates

Submission history