StreamForge AI — Your Chat. Your Choices. Your Adventure.

An AI-powered interactive storytelling experience where Twitch viewers collectively shape the story through live chat voting.

Inspiration

Twitch is built around communities, but most streams still have a clear separation between the creator and the audience. Viewers can react, comment, and suggest ideas, but they rarely have a direct impact on what happens next.

I wanted to explore a different approach: What if Twitch chat could become the director of an evolving adventure?

That idea became StreamForge AI, an interactive game director that combines Twitch chat, real-time audience decisions, and AI-generated storytelling.

What It Does

StreamForge AI transforms a Twitch stream into a collaborative storytelling game.

The streamer chooses an adventure genre, such as Fantasy, Sci-Fi, or Mystery, and starts a game. An AI Director generates a story scene with three possible choices.

Viewers vote directly in Twitch chat using simple commands:

  • !vote A
  • !vote B
  • !vote C

The application collects votes in real time, displays the results on the stream overlay, and determines which choice wins when the voting period ends.

The AI Director then continues the story based on the selected outcome.

Each adventure progresses through three chapters, allowing the audience to collectively influence the narrative from beginning to end.

Key Features

Real Twitch Chat Integration

StreamForge AI uses Twitch OAuth and EventSub to receive actual chat messages. Viewers participate directly from their Twitch channel without installing a separate application.

AI-Powered Storytelling

The AI Director uses Groq's API with the openai/gpt-oss-20b model to generate structured story scenes, choices, and narrative progression.

Fair Audience Voting

Each viewer has one active vote per round. Viewers can change their choice during voting, but repeated messages do not increase their voting power.

Real-Time Stream Overlay

A dedicated overlay displays the current chapter, story, available choices, voting results, and countdown. It is designed for integration with streaming software such as OBS.

Streamer Control Dashboard

The streamer can select a genre, start an adventure, pause or resume gameplay, skip, end, or reset the game, and monitor audience decisions.

Adventure History

Completed choices are recorded in an adventure log, allowing the streamer to review how the community shaped the story.

Mock Mode and Resilience

A local simulator supports development without connecting to Twitch. The AI Director also includes deterministic fallback behavior when AI generation is unavailable.

How We Built It

StreamForge AI was developed using OpenAI Codex as the primary AI coding assistant.

I used Codex to turn the initial concept into an implementation plan, build the game engine, integrate Twitch authentication and EventSub, develop the real-time dashboard and overlay, and implement the AI Director.

Development followed an iterative process: implement a feature, test it, identify issues, and refine the implementation.

One of the most important challenges was getting real Twitch chat voting working end to end. After configuring the developer application and resolving local-origin issues, I successfully tested live Twitch voting, including vote replacement and three-chapter game completion.

Codex also helped implement automated tests, browser regression tests, type checking, and production-build verification.

Technologies Used

  • OpenAI Codex — AI-assisted development
  • Next.js, React, TypeScript — Web application
  • Node.js — Backend services
  • Twitch OAuth and EventSub — Twitch authentication and chat integration
  • Socket.IO — Real-time updates
  • Groq API / GPT-OSS 20B — AI story generation
  • Zod — Structured output validation
  • Prisma / SQLite — Application persistence
  • OBS-compatible browser overlay — Stream visualization

Challenges We Faced

Twitch Developer Authentication: Setting up Twitch 2FA and registering a developer application required troubleshooting account verification and OAuth configuration.

Real-Time Event Processing: Twitch chat messages needed to travel reliably through EventSub, the voting engine, and the dashboard without counting repeated votes from the same viewer.

AI Output Reliability: Story generation needed a predictable structure with exactly three choices while maintaining narrative continuity.

Frontend and Backend Communication: A localhost-versus-loopback origin mismatch initially prevented session initialization. Resolving the mismatch restored the dashboard connection.

Testing Real Interactions: Mocked tests were useful during development, but the most meaningful validation came from sending actual messages in Twitch chat and watching the game respond.

Accomplishments We're Proud Of

  • Built a functioning interactive Twitch storytelling game.
  • Successfully integrated real Twitch chat voting.
  • Verified one active vote per viewer.
  • Completed a three-chapter adventure with audience-selected outcomes.
  • Built a synchronized streamer dashboard and stream overlay.
  • Integrated a working AI storytelling provider with structured-output validation.
  • Achieved 69 passing automated tests and two Chromium browser regression tests at the latest reported verification point.

What We Learned

This project reinforced the importance of separating simulated functionality from real-world integration testing.

It also demonstrated how AI coding tools like Codex can support an iterative engineering workflow involving architecture, implementation, debugging, testing, and documentation.

Most importantly, StreamForge AI showed how generative AI can become part of a shared live experience rather than simply generating content for an individual user.

What's Next

Future improvements could include longer adventures, customizable story worlds, viewer-driven events, multiplayer streamer collaborations, voice narration, and additional community interaction modes.

The long-term vision is to make StreamForge AI a reusable interactive entertainment platform for Twitch creators of different sizes.

StreamForge AI turns Twitch chat from an audience into a co-creator.

Built With

Share this project:

Updates

Submission history