Inspiration
I wanted to make Twitch chat really feel like part of the stream with an overlay that could be a main event, or a corner dock. Pixel Farm turns a stream into a shared, cozy farming space where viewers can plant crops, water them, and work together to harvest!
What it does
Pixel Farm is a pixel-art farming game that runs as a transparent browser overlay for OBS. Viewers use chat commands to plant potatoes, carrots, and onions, water crops to help them grow, and vote together to harvest them. Harvests add coins to a shared farm bank and points to the planter’s leaderboard score. Rare shiny crops and special unique modifiers add a little surprise to each harvest.
How we built it
I used Codex to built the overlay with Phaser 3 and connect it to a Node.js bot using Twitch EventSub and WebSockets. The bot handles chat commands, crop growth, shared farm state, and the leaderboard, with farm progress saved between sessions. Optional OpenAI or OpenRouter integration can generate special crop modifiers for endless combinations; local presets keep the feature working without an API key. I also had Codex develop a mock chat simulator that lets us demo the farm without a live Twitch channel.
Challenges we ran into
A busy chat can send many commands at once, so I had to keep the farm state consistent while commands, growth updates, and harvest animations happen together. I also worked through how to make harvesting collaborative: requiring votes from unique chatters gives viewers a reason to join in while scaling the challenge with chat activity.
Accomplishments that we're proud of
Codex and I brought chat commands, a persistent shared farm, and a custom animated overlay together into one playable experience. I'm especially proud that viewers can cooperate on harvests, discover valuable rare crops unique to their session only, and see the results reflected in the farm bank and leaderboard.
What we learned
I learned how to connect Twitch chat events to a live browser game, keep state synchronized across the bot and overlay, and design game rules that encourage group participation. Building a mock chat also showed just how useful a realistic demo tool can be when testing a live interactive experience.
What's next for Pixel Farm
I'd like to grow the farm with more crops, expanded island progression, and new ways for viewers to contribute together. I also want to keep refining the stream overlay and add more surprises that make each community’s farm feel like its own!
Built With
- codex
- eventsub
- node.js
- openai
- phaser.js
- twitch
- websockets