TORCHLINE

The stream ends. The world doesn't.

Inspiration: every raid is a small extinction

Every night on Twitch, thousands of communities build something together: a comeback, a running joke, a world. Then the streamer raids out. The audience moves on, and everything they built that night vanishes. Tomorrow starts from zero.

I asked a simple question: what if the world came with them? What if a raid handed the next channel more than viewers, and passed on consequences? Decisions made by people they have never met. Scars from games they never played. A debt that comes due on their watch.

TORCHLINE is my answer: a living world that outlives the stream and travels between communities. World one is ARK-001, a generation ship carrying 216 sleeping passengers through five chapters.

A night aboard ARK-001

Picture one evening:

  • Chat keeps it alive. A radiation storm hits. Viewers don't just vote; they solve it. !scan A uncovers a clue, !route S A C T reroutes power around a failing relay, and the shields come back: +15 hull, saved to the ship.
  • The captain makes the hard call. Sacrifice navigation and all 216 survive, but the ship flies blind next chapter. Or seal the rear habitat and lose 48 people. Chat advises; only the captain commits. The choice is permanent.
  • Your game scars or repairs it (LIVEWIRE). Before a risky attempt in whatever you are streaming, chat stakes one ship system with !stake 2. The stake locks before the attempt. The streamer confirms what happened, and one bounded repair or scar is written to the same Ark. It is labelled streamer-attested, never "detected".
  • A raid passes it on. At a chapter boundary the captain prepares a handoff to a consenting channel, then raids them. The new crew opens an inheritance dossier: who handed the Ark on, every decision aboard and which community made it, what other games did to the hull, and which debts are now theirs.
  • The world remembers. The Chronicle links every consequence to the decision that caused it, across communities. What if they had chosen differently? replays every option of a past decision from the exact saved state.

Every rule that changes the ship is deterministic, so any history can be checked by replaying it:

$$\text{SHA-256}\big(\text{replay}(e_1, e_2, \dots, e_n)\big) \stackrel{?}{=} \text{SHA-256}\big(S_{\text{saved}}\big)$$

That is the Verify this record button.

How I built it: a world that can't lie

  • A pure, deterministic engine with versioned rules: no clock, network or randomness inside a transition, so every saved world replays exactly.
  • PostgreSQL is the authority. State, events, custody and the outbox commit in one transaction, with optimistic versions and idempotency keys.
  • Signed Twitch. OAuth for broadcaster and bot, EventSub webhooks with HMAC verification, and at-least-once delivery handled with deduplication.
  • Custody that can't be faked. An Ark moves only when three things line up: a prepared handoff, Twitch's signed channel.raid notification and the receiver's explicit acceptance, all in one transaction. A chat message, a screenshot or a simulator can never move a world.
  • Fair LIVEWIRE economics. Opening a mission costs one supply, and there is one mission per chapter boundary, five per voyage at most. A success adds at most 3 and a failure takes at most 6:

$$\Delta_{\text{success}} = \min(3,\ 100 - v) \qquad \Delta_{\text{failure}} = -\min(6,\ v - 1)$$

A destroyed system never comes back.

  • The ship you see. React 19 and React Three Fiber render the Ark, the cockpit and the LIVEWIRE scenes from my own Figma design. Server-sent events drive the dashboard and a read-only OBS browser source.
  • Proof, not promises. 164 Vitest tests against real PostgreSQL, 25 Playwright browser journeys, and GitHub Actions CI that also boots the Docker preview and the hosted demo image on every push.

How I used OpenAI Codex

Codex was TORCHLINE's lead engineer. It worked in VS Code, mostly in one continuous thread, from my first planning prompt on 26 October to 30 October. Codex session ID: 01a176fc-1e4a-7e83-b21e-1043aa17e8bc

  • A standing brief, not one-off prompts. AGENTS.md (in the repo) is Codex's operating contract: a pure deterministic engine, PostgreSQL as the authority, idempotent Twitch delivery, private inputs never committed, small reviewable commits, and every claim labelled implemented, simulated or unverified.
  • Plan before code. Codex turned my idea into requirements, game rules, an architecture and a decision stress review, then built the engine and the Twitch foundation on day one.
  • Build and verify. Over the next days it built episodes, crew cooperation and allocation, encrypted backups, live HTTPS, the ten-screen interface from the Figma design, and LIVEWIRE, writing tests against real PostgreSQL as it went.
  • Honest live checks. Codex wrote credential-safe scripts that checked real Twitch traffic and recorded what each one proved, including a problem it caught: Twitch accepted my bot's replies, but viewers never saw them.

Team and tools: OpenAI Codex (lead engineer) · Claude Code (reviewer and checker; it also built the relay rehearsal, Chronicle replay tools, Docker preview and hosted demo) · Claude Design and Figma (UI/UX).

Challenges: three things tried to sink the Ark

  1. Fake raids. If anything but a real raid could move a world, the whole game would collapse. Custody needs a prepared intent, Twitch's signature and the receiver's consent, atomically. Late in the build I found that Twitch returns an empty field in raid subscriptions that my strict check rejected. I reproduced it in tests and fixed it.
  2. Farming wins. Self-reported results could print repairs forever. Supply costs, finite allowances, caps and no resurrection make every LIVEWIRE mission a real risk.
  3. The invisible bot. Twitch accepted every bot reply (is_sent: true), but no viewer ever saw one. I traced it to Twitch filtering my brand-new bot account, not my code, and fixed it by making the bot a channel moderator; its token still has no moderation powers. Gameplay never depended on replies: every acknowledgement already lived on the overlay and dashboard.

Keeping a live, multi-community game deterministic enough to replay byte-for-byte was the quiet challenge underneath all three.

Accomplishments I'm proud of

  • Real Twitch, not a mock-up. On a live broadcast on 2 November, chat commands arrived as signed EventSub notifications, solved the ship's relay puzzle and updated the overlay on the stream. A LIVEWIRE mission locked a stake from chat before a streamer-attested attempt, and the bot answered in chat. On 30 October, three genuine viewer commands had already changed a live Ark.
  • The two-minute relay. In the Judge Arena, two communities in two different games change one Ark, and the second crew inherits the first crew's sacrifice as its crisis. Only the raid proof is simulated, and it says so.
  • Every decision is checkable. Replay any choice against its alternatives, or verify an entire history.
  • Try it yourself: with nothing installed at https://torchline-demo.onrender.com, or on your own Twitch channel with the judge guide.

What I learned

Persistence alone isn't interesting; attribution is. Once a crew can see who made a decision, in which game a hull was scarred, and why a debt exists, saved data becomes a story the next community cares about. I also learned to label everything honestly: real, simulated or not yet verified.

What's next

  • The first live raid between two consenting broadcasters, the moment the relay leaves rehearsal.
  • Permanent live hosting, so the Ark never sleeps.
  • More worlds beyond the Ark, more LIVEWIRE scenes, and seasons that remember which communities carried a world furthest.

The in-app game scenes are original illustrations and never read game data.

Built With

Share this project:

Updates

Submission history