← back to SERVICE

Interactive FMV Short Drama

A branching short-drama web game built from vertical video clips, plus a node-canvas editor where writers build the story without code.

stack
TypeScript, Next.js, React Flow, Vite, Cloudflare Pages, Cloudflare Workers, Cloudflare D1, Cloudflare R2, FFmpeg, Vitest, Playwright
What I did
  • Built the node-canvas editor where writers connect scenes and choices, upload clips, and deploy versions.
  • Built the shared schema that validates the branch graph and decides endings.
  • Built the browser player with clip prefetching, fade transitions, saves, QTE scenes, and subtitles in Korean, English, and Japanese.
  • Built the API worker for sign-in, save sync, event collection, and a reporting dashboard.

What it is

A browser game built from short vertical video clips (1080×1920, 10 to 15 seconds each). The viewer watches a clip, taps a choice, and the next clip plays after a fade. The story branches across episodes. It has bad endings per episode, an affection system for several characters, and a final ending decided by the character with the highest affection and the number of conditions collected.

It has three parts in one npm workspaces monorepo:

  • Editor: A Next.js node canvas built with React Flow. A node is a scene, and an edge is a choice.
  • Player: A Vite web app that reads only published snapshots. It does not depend on the editor or a database.
  • Shared schema: The contract both sides use for the branch graph, validation, and ending rules.

A Cloudflare Worker with D1 handles sign-in, save sync, and analytics.

Why I built it

There were two needs. First, writers and planners who don’t code needed to build and change a branching story on their own. Second, the player had to feel instant on a phone. The clips don’t need to play seamlessly, so the only performance goal was to have the next clip downloaded before the viewer taps. That one goal shaped every technical decision.

How it works

  • Playback: Progressive MP4 clips, one <video> element, and a CSS fade. MSE and HLS were considered and rejected.
  • Prefetch: While a clip plays, the player downloads every possible next clip as a Blob URL and releases the ones it has passed. Clips go through Cache Storage, and after the home screen loads, reachable clips download in the background.
  • Delivery: Clips live in Cloudflare R2 with content-hash file names and immutable caching, so video traffic never passes through the web app host. The web app runs on Cloudflare Pages.
  • Authoring: The editor transcodes uploaded videos to 720p with FFmpeg and validates the graph on save. It warns about problems such as missing ending text or choice labels longer than five characters.
  • Deploying: The editor cuts a versioned snapshot, sends it to QA first, and then promotes a checked version to LIVE. Node positions are removed from the published snapshot.
  • Saves and sign-in: Viewers can play as guests, or sign in with X or Google to sync their saves.
  • Analytics: The player batches events such as views, choices, QTE results, and endings, and sends them to the Worker. The Worker validates them and stores them in D1 without duplicates. A dashboard shows how far viewers got by episode, compares the numbers with GA4, and exports CSV.