Inspiration

The best moments on Twitch happen when viewers help create what happens next. RuleShift Live gives chat a creative role while keeping the streamer in control: viewers propose a twist, the streamer approves it, and the game makes the consequence visible.

What it does

RuleShift Live is a neon pixel-art browser game connected to real Twitch chat.

A viewer sends: !rule Every third coin flips gravity for 4 seconds

The proposal enters a bounded queue with its author attached. The streamer reviews it, approves or vetoes it, and starts a 75-second round.

Every third coin reverses actual gravity, sending the player toward the ceiling. Four seconds later, normal gravity returns automatically. Repeated triggers refresh the effect timer. Completed results are saved in PostgreSQL with rule attribution.

The current constrained parser supports triggers from 2 to 10 coins and durations from 1 to 6 whole seconds. Unsupported proposals cannot be approved, and chat is never executed as code

How we built it

The interface uses React, TypeScript, Vite and Tailwind CSS. Canvas 2D handles player movement, collisions, coin collection and temporary gravity changes.

A Go backend manages validated proposals and round transitions. Twitch OAuth and EventSub WebSocket connect the application to real channel messages. PostgreSQL 18 stores proposals and completed results.

OpenAI Codex assisted with architecture, implementation, Twitch integration, game behavior, startup tooling, tests and debugging. Domain logic stays separate from HTTP, Twitch and persistence adapters. The demonstration includes actual Codex development footage and verification commands.

Codex was used to build the application. Runtime rule interpretation currently uses a constrained parser and requires no AI inference service.

Challenges we ran into

Making audience-driven changes predictable required explicit streamer approval, a bounded proposal queue, message deduplication and viewer cooldowns.

Gravity effects needed reliable expiry and repeat-trigger handling. Repeated triggers refresh the timer without stacking permanent changes, and gravity returns to normal when the effect or round ends.

Another challenge was making verification clear: local rehearsal, real Twitch-source gameplay and public broadcast footage are identified separately.

Accomplishments that we're proud of

A verified real Twitch-source round completed with 12 coins and four gravity shifts. The downloaded controller trace recorded the first gravity effect expiring after 4,002 milliseconds. The saved result matched backend state and a read-only PostgreSQL check.

Recorded Go race tests, static checks, web tests and the production build passed.

The demo includes a separate actual public Twitch broadcast excerpt showing the app idle, plus gameplay close-ups from the verified Twitch-source round. The proposal was approved before the gameplay recording. Scores and effect timestamps remain controller-reported observations.

The result is a complete interaction loop: chat proposes, the streamer decides, the game changes, and the result is saved.

What we learned

A small, understandable rule can create a visible audience-driven moment. Streamer control, clear feedback and automatic restoration matter as much as the rule itself.

Separating game behavior and domain logic from external integrations made testing and iteration easier. Recording the message, rule and result together also made the experience easier to explain and verify.

What's next for RuleShift Live

Explore more bounded rule types, clearer viewer onboarding and playtests with streamers to evaluate entertainment value and usability.

The current milestone supports one local streamer, one backend process and one arena. Future development will build on that verified foundation. Engagement improvements have not yet been measured.

Built With

Share this project:

Updates

Submission history