Problem
Traditional visual novels lock players into fixed dialogue trees, while AI-chat games usually depend on paid inference servers and feel detached from scene direction. Asking players to download an installer also gets in the way of trying a short game.
I Want to Commit Your Heart is a no-install browser visual novel set in a Sunrin Internet High School software club. It mixes a 694-node branching script with on-device small LLM conversations running on WebGPU.
What I Built
-
694-node story graph and three endings
- Modeled scenes as a JSON node graph tied to conditionals, state flags, and per-character affinity so earlier choices carry forward into later dialogue and events.
- Shipped three endings, including romance routes and a club-interview rejection, with an ending gallery that records unlocked routes.
-
In-browser AI dialogue with Transformers.js and WebGPU
- Ran a Qwen-based small language model directly in the browser with no inference server, injecting the current scene, character profile, and affinity state into each prompt.
- Fine-tuned the model with LoRA on Korean character dialogue, then added 396 correction samples to cut down on mixed-up characters and canon mistakes.
- Added Guard/R2 response checks to swap out broken generations with safe fallbacks, plus a fallback mode so the base story still plays on devices without WebGPU.
-
In-game messenger and web playback controls
- Built phone notifications and a Discord-style messenger where players read messages and pick replies.
- Hooked up character expressions, school backgrounds, six original BGM tracks, and three ambience layers with audio cross-fading.
- Implemented localStorage auto/quick saves, six manual save slots, backlog, skip, auto-play, and mouse/keyboard/touch layouts.
Results
- Reached the finals of the 2026 Digital Content Contest as team lead covering planning, the web engine, LoRA fine-tuning, and WebGPU dialogue.
- Shipped 694 story nodes and 13 free-conversation points inside one continuous playthrough.
- Covered branching logic and save integrity with Vitest, and verified single- and multi-turn AI dialogue plus UI flows in real Chrome WebGPU via Playwright.
Demo Video
Stack
- React 19
- TypeScript
- WebGPU
- Transformers.js
- LoRA
- Vitest
- Playwright
