Inspiration
I wanted Twitch chat participation to leave a visible mark on the stream. In Last Banner, viewers own territories, challenge neighboring rivals, and watch the consequences unfold on a shared map. One duel can transfer an entire empire.
What it does
Last Banner is a Twitch chat-controlled territorial battle royale with a dedicated OBS view.
Viewers register with !join. The selected player attacks an adjacent territory using a command such as !attack A1 B1. The attacker rolls three dice and keeps the best two; the defender rolls two. The pairs are compared, with repeated sudden-death rolls if needed.
The winner absorbs the loser's entire empire. Owning more territory changes the stakes and available borders, but does not increase dice strength. Inactive players leave neutral territory; capturing a connected neutral region takes the whole component and ends the turn without rolling dice.
The streamer chooses a decision window of 15–120 seconds before the match. The OBS presentation includes battle focus, staged dice reveals, territory transfers, rankings and original synthesized audio.
How I built it with Codex
I developed Last Banner with OpenAI Codex using a written gameplay specification, an incremental plan and an evidence log.
The implementation uses TypeScript and Node.js, with a pure game engine and injectable randomness and time. Twitch integration uses OAuth and EventSub WebSocket. The browser presentation uses HTML, CSS, SVG and the Web Audio API.
Codex helped implement the engine, Twitch integration, automated checks, OBS presentation and audiovisual feedback. We worked through actual failures, inspected recordings and refined the implementation rather than treating generated code as proof that everything worked.
Challenges
Reliable chat-driven turns required coordinating notification delivery, command acceptance, timeouts, pauses and reconnection. The decision clock starts after the turn notice is successfully sent, and reconnection preserves the remaining time.
Another challenge was separating authoritative game results from their presentation. Dice are calculated once by the server. Animations reveal those recorded results without exposing future ownership changes or rankings prematurely. Every sudden-death pair has its own rolling and comparison phases.
Audio required checking browser activation and the recorded OBS output, not simply checking that an audio button existed.
What I learned
Correct rules are only part of a stream-ready game. Viewers also need to understand whose turn it is, what the dice mean and why the whole map changes after a battle.
I also learned to distinguish evidence carefully: automated tests, simulated participants, real Twitch messages and human audiovisual review answer different questions.
Validation and limitations
A clean installation passed 22 automated tests. The offline fixture runs without Twitch credentials and finishes after six turns with Diego owning all six territories. It includes a neutral capture that consumes a turn and repeated sudden death: 4–4, followed by 2–5.
Real Twitch play was checked with two accounts controlled by one human operator. The demo clearly separates that real integration from the simulated fixture and shows this project's authentic Codex session.
Larger populations, including 100 participants, were simulated. This is not evidence of 100 independent people playing together. Community-scale usability, retention and balance remain future playtesting work.
The project runs locally on Windows. Evaluators can use the offline fixture or connect their own Twitch application and channel. No developer credentials are required or distributed.
What's next
The next step is small live-community playtesting, focusing on turn comprehension, waiting time and clarity before adding more mechanics.
Log in or sign up for Devpost to join the conversation.