Inspiration
Streamers often struggle to keep passive viewers engaged without cluttering their main gameplay or webcam canvas. Most Twitch extensions either cover crucial UI elements or rely on clunky, resource-heavy overlays that stutter during chat storms.
We envisioned a living, bottom-border ecosystem crafted with crisp 2D retro pixel art: a vibrant garden where viewers can plant and nurture flowers (!water), while playful viewers can toss junkyard trash (!trash). Eco-conscious chatters can sweep away the mess (!clean), creating an engaging tug-of-war. Under high-traffic chat raids, our dedicated crowd-control engine prevents visual chaos. At stream sign-off, a pixelated recap card honors the top contributors of the day.
What it does
- Bottom-Band Bounded 2D Pixel Ecosystem: Operates entirely within the lowest 20% of the screen. Zero interference with center gameplay or webcam.
- 4-Stage Plant Lifecycle: Seeds germinate into Sprouts, bloom into vibrant Roses, flourish into Sunflowers, and radiate as majestic Golden Flowers.
- Dynamic Physics Junkyard: Crushed soda cans, banana peels, fishbones, potions, and weeds drop with gravity physics. Cleaning triggers ascending star-burst particles.
- High-Traffic Crowd Control: Protects the stream from chaos. Laughter reactions have a per-user 1.5s cooldown and a 1s global throttling window, while trash bounces are capped at 4 items to keep the broadcaster's view crystal clear.
- 24/7 Memory Capping (LRU 500): Automatically evicts inactive user records past 500 users, guaranteeing zero memory leaks during non-stop broadcasts.
- Floating Viewer Nameplates: Each flower sports a crisp, retro pixelated name tag displaying the owner's Twitch username.
- Zero-Dependency Web Audio Synth: Custom procedural sound synthesis for splashing water, windchime arpeggios, metallic clanks, sweep sweeps, and bouncy chimes.
- Instant Anonymous Twitch IRC: Connects directly via WebSocket without requiring complicated OAuth tokens—just type the streamer's channel name!
- End-of-Stream Daily Recap Card: Summarizes flowers grown, watering count, trash dumped/cleaned, and ranks MVP chatters in a card exportable as high-res PNG.
How we built it
- HTML5 2D Canvas Engine: 1:1 crisp pixel art with
imageSmoothingEnabled = false, zero external 3D engine overhead. - Native Web Audio API: Procedural sound generation bypassing external audio hosting and CORS pitfalls.
- Strict Separation of Concerns: Pure deterministic state engine (
garden.mjs), network adapter (twitch-irc.mjs), audio synth (audio.mjs), 2D renderer (renderer.mjs), and demo simulator (demo-sim.mjs). - OBS Studio Optimization: URL parameters (
?obs=1,?channel=name,?demo=1,?mute=1) and keybinds (H,D) provide one-click streamer readiness with zero background opacity.
How OpenAI Codex accelerated development
OpenAI Codex served as our real-time co-pilot across every layer of the stack:
- Mathematical Physics & Collision Modeling: Codex assisted in structuring vertical stacking, settling physics, and responsive viewport sizing.
- High-Traffic Crowd Control Architecture: Codex helped architect the per-user cooldowns, global throttling windows, and LRU eviction buffers.
- Web Audio Synthesis: Codex provided the frequency sweeps and gain envelope curves for procedural sound effects, eliminating external MP3 assets.
- Comprehensive Unit Testing: Generated 13 rigorous native
node:testassertions covering IRC fragmentation, crowd throttling, LRU memory caps, detached snapshots, and recap card lifecycle.
Bonus live demo (real Twitch stream + real chat, one take): https://youtu.be/0pPXX06M3Yg
Built With
- canvas-2d
- crowd-control
- javascript
- pixel-art
- twitch
- web-audio