Inspiration
What if Twitch chat did not control a character, but became the character? THE CROWD turns audience messages into a collective, shifting creature living inside an eerie city. The streamer faces a creature that can choose to defend, hunt or silently observe them.
What it does
Each participating viewer becomes a labeled particle in a larger animated body. Messages influence its trust and fear: encouraging the explorer creates a guardian; hostile language pushes the body toward a predator; indecision produces an ambiguous witness. The creature's eyes track interaction, tendrils grow with crowd activity, and a raid can dramatically enlarge it. A 60-second round resolves into one of three narrative endings. A no-account simulation mode lets judges experiment immediately.
How it works
A self-contained Canvas 2D experience runs in the browser. The optional Node.js backend validates a broadcaster-authorized Twitch user token and uses Twitch EventSub WebSockets to subscribe to channel.chat.message and channel.raid. Incoming notifications are deduplicated, bounded and forwarded to the browser via same-origin Server-Sent Events. User credentials stay on the server and are not shipped to viewers. The audience animation reacts to those messages and to actual raid viewer counts when the channel is connected.
How we built it with Codex
OpenAI Codex helped implement the deterministic three-ending resolution logic, with source in crowd-ending.mjs and its browser integration. The authenticated Codex session ID is 01a1818f-01b5-7591-8657-8173e60b027f. Supporting game UI, Twitch EventSub backend, OAuth device-flow helper and Node.js tests are documented in the repository. Automated tests use mocked Twitch notifications: they pass, but they do not replace a live Twitch test.
Challenges
Keeping OAuth secrets out of the client, handling duplicate Twitch notifications, and making each viewer visible in a collective creature instead of reducing participation to polls. The no-token demo is deliberately identified as simulated rather than impersonating a live broadcast.
Next steps
Complete a verified live-channel rehearsal, record a short Twitch demonstration, publish permanent project hosting and improve balancing/visual feedback based on spectator reactions.
Testing
Node.js 24+: run npm test and npm start. Open http://127.0.0.1:3107. To use real Twitch EventSub, create a Twitch developer application, run node twitch-login.mjs CLIENT_ID and authorize the broadcaster account directly with Twitch, then run node --env-file=.env server.mjs. No application secret should ever be pasted into a chat.
Built With
- canvas-2d
- javascript
- node.js
- oauth
- openai-codex
- server-sent-events
- twitch-eventsub
Log in or sign up for Devpost to join the conversation.