Story-to-game  by Shanyin-ai

Toolkit for AI-driven interactive narrative game creation and playback

Created 1 month ago
339 stars

Top 81.0% on SourcePulse

GitHubView on GitHub
Project Summary

Summary This project provides a complete toolkit for creating and running branch narrative games, automating the conversion of novels, scripts, or outlines into playable JSON game files. It includes an AI skill for content generation and a standalone HTML launcher for immersive, text-based gameplay, targeting writers and game developers.

How It Works The suite features two main components. The Branch Narrative Game Launcher is a single-file HTML application running directly in the browser, supporting JSON scripts for interactive branching narratives. It offers a minimalist UI, immersive play, scene management, variable logic, and customization. The Story-to-Game AI Skill converts text inputs into the launcher's JSON format. This AI analyzes source material, preserves style, designs structured branching narratives, and implements a robust state/ending system, followed by automated validation.

Quick Start & Requirements

  • Launcher: Download 剧情游戏启动器.html, open in Chrome/Edge. Import JSON via "插入JSON剧本".
  • AI Skill: Drag SKILL.md or the story-to-game package to an AI tool (ChatGPT, Claude, Codex, Claude Code). Provide source text for JSON generation. Codex/Claude Code recommended for long-form content.
  • Browser Compatibility: Chrome/Edge recommended.
  • Validation: AI-generated JSONs must be validated using validate.py before use.

Highlighted Details

  • Launcher: Zero-dependency, single-file HTML. Supports immersive play, rollback, saving, loading, scene/chapter systems, variable logic, conditional branching, and achievements. Offers extensive display customization.
  • AI Skill: Full-process narrative adaptation system focusing on original understanding, style preservation, structured branching, and automated validation (13 checks). Adapts to various input lengths and ensures branches are as rich as the main narrative, with guaranteed paths to endings.

Maintenance & Community Authored by 山音 (Shan Yin), founder of 山之音STUDIO. Contact: 小红书 @山音, li-yinqian@outlook.com. No specific community channels or roadmap details are provided.

Licensing & Compatibility Released under the MIT License, permissive for commercial use and integration into closed-source projects.

Limitations & Caveats AI-generated JSONs require validate.py validation to prevent errors. Save data and achievements are stored locally and can be lost upon cache clearing. Endings must follow "fallback rules" to ensure all choices lead to a conclusion.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
81 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.