Inspiration

Twitch chat already shapes a stream’s energy. We wanted to let it shape the game’s reality, too. Reality Glitch turns viewers into collaborators who can bend physics while the streamer tries to complete a mission.

We also wanted the experience to work without paid hosting, AI services, or even a Twitch connection.

What it does

Reality Glitch is a local-first 2D physics game with three missions: deliver a crystal, rescue an explorer, and collect beacons before reaching the exit.

Viewers propose mutations using commands such as !glitch moon gravity, then vote on what happens next. Twelve allowlisted mutations change gravity, movement, friction, platforms, and more. Compatible effects form named combinations, while rising chaos can trigger a bounded Reality Collapse.

The streamer retains pause, reset, moderation, and Emergency Stabilize controls. An OBS overlay presents public game state, and an offline showcase simulates audience participation.

How we built it

We used strict TypeScript across a modular application:

  • React and Vite for the dashboard and overlay.
  • Phaser 3 for rendering server-owned snapshots.
  • Matter.js for authoritative physics at 30 simulation ticks per second.
  • Fastify and WebSockets for authenticated controls and live state updates.
  • Zod for runtime validation.
  • SQLite for session metadata, sanitized events, and moderation settings.
  • Twitch OAuth and EventSub for the chat integration.

Vitest, fast-check, and Playwright support automated testing, with GitHub Actions configured for continuous checks.

Challenges we ran into

Temporary effects needed predictable rollback. We solved this by recomputing world properties from baseline and the remaining active rules each tick.

The original round timing also prevented combinations: effects expired before the next mutation could activate. Our explicitly accelerated showcase uses shorter rounds to demonstrate overlapping effects while preserving standard timing for ordinary sessions.

Other challenges included keeping physics replayable, separating operator controls from public overlays, and fitting the complete overlay into a 1080p frame.

Accomplishments that we're proud of

We built a playable offline experience with all three missions, twelve mutations, four named combinations, and Reality Collapse.

The project passes 20 automated tests and two browser tests, alongside formatting, lint, TypeScript, production-build, and dependency-audit checks. Replay export and verification also work through the tested browser flow.

The game remains usable without Twitch credentials or external services.

What we learned

Deterministic gameplay requires more than a fixed timestep. Event ordering, physics initialization, and wall-clock rate limits all affect replay behavior.

We also learned that demonstration design needs its own validation: individually sensible effect durations and voting windows can prevent the most interesting interactions when combined.

Keeping simulation authority on the backend made voting, safety, and replay easier to reason about.

What's next for Reality Glitch

Next, we’ll validate authentication and chat delivery against live Twitch, capture the overlay in OBS, and measure real-time load and latency.

We’ll also refine gameplay difficulty, visuals, accessibility, and the streamer onboarding experience. Optional natural-language proposals can follow once the core release gates pass, with every request still constrained to validated, allowlisted mutations.

Built With

Share this project:

Updates

Submission history