Inspiration

What it does

How we built it

Challenges we ran into

Accomplishments that we're proud of

What we learned

What's next for The Second Ending: Nie Xiaoqian

Inspiration

The Second Ending: Nie Xiaoqian — Lanruo, Unwed reimagines a public-domain tale from Strange Tales from a Chinese Studio through a female-centered lens. Xiaoqian is not a reward, a victim, or a route selected by the player: she is a witness to her own coercion and the person who decides what freedom costs.

What it does

This is a complete Chinese interactive mystery for mobile and desktop browsers. Across three acts, the player investigates a spirit contract, collects ten clues, makes consequential choices, and reaches one of four endings. Trust, agency, and entanglement have visible effects before the finale; six major choices return as later narrative echoes.

At the end of Act II, the player selects two or three clues and writes a short theory. GPT-5.6 returns structured support, contradictions, missing evidence, and a question worth asking Xiaoqian. The game then uses deterministic rules to decide whether a safer plan becomes viable. The player can help, but cannot choose Xiaoqian's future for her.

How we built it

The game is a React + Vite web app with data-driven story nodes, local browser saves, a clue notebook, branching state, and four ending rules. A Cloudflare Worker sends only the selected clue texts, one player theory, and a bounded relationship-state summary to openai/gpt-5.6-luna through OpenRouter. Structured responses are validated before use. If the model is unavailable, a deterministic local review keeps the chapter playable.

Codex and GPT-5.6

Human direction established the literary theme, character voice, six core choices, four endings, and art direction. Codex helped restructure the story system, implement branching consequences and evidence review, write tests, debug deployment, and prepare the Build Week documentation. GPT-5.6 is part of play: it analyzes the player's own selected evidence and free-text reasoning, but it cannot invent clues, alter endings, or override Xiaoqian's agency.

Challenges and lessons

The main challenge was making AI useful without turning it into an author who solves the story or chooses for the heroine. Constraining model inputs, validating structured output, retaining rule authority in the game, and providing a deterministic fallback made the AI scene interpretable, resilient, and faithful to the theme.

Try it

Play the public build and explore a second path through Lanruo Temple.

Built With

Share this project:

Updates