Inspiration

What it does

How we built it

Challenges we ran into

Accomplishments that we're proud of

What we learned

What's next for RaidForge Codex Arena: Live Twitch Chat & Codex Boss Raid

Inspiration

Live streams thrive on audience participation, yet most Twitch games only allow shallow binary polls. We wanted to let Twitch chat viewers actively rewrite the game physics and boss AI of a live stream in real time—safely powered by OpenAI Codex.


What It Does

RaidForge Codex Arena is an interactive Twitch stream overlay and 60fps Cyber-Hydra Boss Raid companion where Twitch Chat & EventSub events trigger real-time OpenAI Codex code mutations:

  1. Live Twitch Chat & EventSub Triggers (!mutate low_gravity, !mutate boss_rage, !cheer 500):
    • Viewers in Twitch Chat (channel.chat.message and channel.cheer EventSub webhooks) trigger live arena rule mutations and Bits Meteor Strikes.
  2. OpenAI Codex Live Physics & Boss-AI Mutator (backend/codex_arena_engine.py):
    • Translates crowd commands into deterministic game-loop patches (gravity_scale, projectile_speed, boss_hp, streamer_shield, hype_combo) using OpenAI Codex (codex-mini-latest / gpt-5-codex).
  3. Deterministic Python AST Safety Gate (validate_mutation_ast):
    • Parses every Codex-generated patch into an Abstract Syntax Tree (ast.parse) and blocks any import, exec, eval, or file/system calls before hot-reloading the 60fps Twitch Canvas overlay.

How We Used OpenAI Codex (Session ID: sess_codex_019a1b8e-7c42-7f90-b3d1-98e4c210a6f4)

  • OpenAI Codex Session ID (/status): sess_codex_019a1b8e-7c42-7f90-b3d1-98e4c210a6f4
  • We used OpenAI Codex CLI (codex --model codex-mini-latest) across the entire engineering lifecycle:
    1. Scaffolded the Twitch EventSub & IRC Mutator Engine (backend/codex_arena_engine.py) with ArenaState and CodexMutationPatch dataclasses.
    2. Engineered the Deterministic AST Security Gate (validate_mutation_ast) and verified it with automated pytest unit tests (tests/test_codex_arena.py — 2 passed in 0.02s).
    3. Built the Split Broadcast Studio UI (public/index.html, public/app.js) combining the 60fps HTML5 Boss Raid Canvas, Twitch Chat simulator, and OpenAI Codex CLI terminal inspector.

Links & Verification

Built With

Share this project:

Updates

Submission history