AI Disclosure: This article was written with AI assistance. All games mentioned were built using AI-assisted development tools.
Why Narrative Games?
The itch.io charts tell a story: narrative-driven HTML5 games like FORGOTTEN and Exorcist Candy dominate the horror/mystery categories. Players crave short, impactful stories they can experience in a single sitting — no downloads, no installs, just open a tab and play.
So I built two narrative browser games in under a week, each weighing less than 20 KB of vanilla JavaScript. No engines. No frameworks. Just text, choices, and consequences.
This article breaks down the design philosophy behind both — what worked, what didn't, and how you can apply the same approach to your own narrative projects.
Game 1: Echo Chamber — An Interrogation Mystery
Echo Chamber — An Interrogation Mystery drops you into a dimly lit room. You're the interrogator. The suspect across the table is lying — but so is everyone else in this facility. Your job is to figure out who to trust, what evidence to present, and when to push harder or back off.
The Core Mechanic: Suspicion and Evidence
The game tracks two invisible stats: suspicion (how much the suspect thinks you're onto them) and evidence (how much proof you've gathered). Every dialogue choice shifts these meters. Push too hard too early, and the suspect clams up. Too soft, and you miss critical clues.
This creates a natural difficulty curve without explicit "levels." The player learns to read the room — tone shifts in the suspect's responses signal when to pivot strategy.
Six Endings, Zero Cutscenes
There are 6 possible endings, each triggered by a combination of suspicion/evidence thresholds and specific choice sequences. No ending is "correct" — each reveals a different facet of the story. The replay value comes from players wanting to see all sides.
The branching logic is a simple state machine:
const endings = {
paranoid: { suspicion: 'high', evidence: 'low' },
truth: { suspicion: 'mid', evidence: 'high' },
escape: { suspicion: 'high', evidence: 'high' },
deceived: { suspicion: 'low', evidence: 'low' },
silent: { suspicion: 'mid', evidence: 'mid' },
collapse: { suspicion: 'low', evidence: 'high' },
};
Each ending checks the current state against its threshold. The first match wins. This is far simpler than a traditional dialogue tree — there's no giant branching graph to maintain. You just tune the thresholds until the endings feel earned.
Sound Design on Zero Budget
The heartbeat audio is generated with the Web Audio API — a simple oscillator with frequency modulation tied to the suspicion meter. As suspicion rises, the heartbeat speeds up. No audio files, no assets, just 15 lines of code. The effect is surprisingly effective at building tension.
Game 2: Flatline — A Medical Thriller
Flatline — A Medical Thriller puts you in the ER at 3 AM. Three patients, one bed, and a clock that won't stop. Every triage decision is a moral calculation — who lives, who waits, and who you have to let go.
The Triage Mechanic
Unlike Echo Chamber's interrogation dynamic, Flatline is about resource scarcity under time pressure. You have one treatment slot and three patients whose conditions deteriorate in real time. The game doesn't pause when you're reading dialogue — the timer keeps ticking.
This creates genuine urgency. Players can't carefully weigh every option. They have to make snap decisions and live with the consequences — which is exactly the emotional state the game wants to evoke.
Branching Under Pressure
The 6 endings in Flatline are determined by:
- Which patients survived (3 binary flags = 8 combinations, pruned to 6 meaningful outcomes)
- A final "shift report" choice that reframes the entire experience
The key insight: branching doesn't need to be complex to feel meaningful. Players don't see the state machine — they see the story. A patient who died in minute 2 changes how they interpret the dialogue in minute 5. The narrative weight comes from consequence, not complexity.
The 19 KB Constraint
The entire game — branching logic, dialogue, audio synthesis, UI rendering — fits in 19 KB of vanilla JavaScript. No React. No Vue. No game engine. Just a render loop, a state object, and a switch statement.
Why does size matter? Because browser games live and die by load time. A 19 KB game loads instantly on any connection. The player is making choices before they even realize the page has finished loading. That immediacy is part of the experience.
The AI-Assisted Design Workflow
Here's how I actually built these games:
Outline (15 min): I described the core concept, tone, and ending structure to an AI assistant. It generated a rough story outline with branching points marked.
Dialogue draft (20 min): AI generated first-pass dialogue for each node. I edited for voice consistency — AI tends to make every character sound the same, so I rewrote about 40% of the lines to give each character a distinct speech pattern.
State machine (10 min): I coded the suspicion/evidence (Echo Chamber) and patient survival (Flatline) tracking systems. AI helped with boilerplate but the threshold tuning was manual — I playtested each ending path 3-5 times to make sure the triggers felt fair.
Audio and polish (15 min): The Web Audio heartbeat was AI-suggested. The UI layout, color palette, and pacing were all human decisions.
Total time from concept to playable: under 2 hours per game. That's not because AI is magic — it's because the scope was deliberately small. A 5-minute narrative game with 6 endings is a tractable problem. A 5-hour RPG is not.
What I Learned
Constraint breeds creativity. The 19 KB limit forced me to cut everything non-essential. No inventory systems. No character sprites. No tutorial. Just text, choices, and consequences. The games are better for it.
Endings are the replay engine. Players who finish one ending immediately want to try another path. Six endings means six playthroughs of a 5-minute game — that's 30 minutes of engagement from a 19 KB file.
Sound matters more than visuals. The Web Audio heartbeat in Echo Chamber does more for atmosphere than any pixel art could. A single oscillator, modulated in real time, creates genuine dread.
Narrative games find their audience. The itch.io charts prove it — players actively seek out short, story-driven browser experiences. The category isn't crowded with high-quality entries, which means a well-crafted 5-minute narrative can stand out.
Play Both Games
Both Echo Chamber — An Interrogation Mystery and Flatline — A Medical Thriller are playable right now in your browser, along with 6 other games, at my itch.io store. The August Sale is live — 45% off all paid titles through August 31.
Start with either narrative game. Each takes about 5 minutes. See how many endings you can find.
AI Disclosure: All games were built with AI-assisted development tools. This article was written with AI assistance and reviewed by the developer. No AI-generated images were used — all visuals are procedurally generated or text-based.
Top comments (0)