
Introduction
Librogame Engine is a lightweight, feature-rich engine for creating interactive text adventures and gamebooks (choose-your-own-adventure games) with vanilla HTML, CSS, and JavaScript.
There is no framework, no build step, and no backend. You write your story in JSON, add images and audio if you want, and deploy the static files to any web host.
What you can build
- Classic gamebooks with branching choices
- Stat-based tests and skill checks
- Inventory-driven puzzles
- Perk and flag based story paths
- Multi-language stories with runtime language switching
- Illustrated adventures with background music and sound effects
Highlights
- Character creation with name, stats, and perks
- 2d6 dice tests with animation and sound
- Conditional choices based on items, flags, perks, and stats
- One-shot choices that disappear after being selected
- Colored text and dialogue boxes
- Dynamic inventory with item images, descriptions, and usage
- Save and load through
localStorage - Light and dark themes
- Responsive three-column layout with collapsible sidebars
- Background music per story node
- A bundled Markdown to JSON story converter
Documentation map
- Quick Start — get the example adventure running
- Project Structure — what every file and folder does
- Story Structure — the JSON format
- Text Formatting — colors and dialogue boxes
- Requirements and Items — conditions and inventory items
- Tests — stat-based checks
- Media — images and music
- Character Creation — the player onboarding flow
- Stats and Perks — character mechanics
- Inventory — item capacity and usage
- Dice Tests — how rolls work
- Themes — CSS variables and color schemes
- Languages — adding translations
- Interface — layout and sidebar behavior
- Credits — the in-game credits screen
- Story Converter — write stories in Markdown
- Markdown Syntax — the supported converter syntax
- Technical Details — compatibility and dependencies
- Security — HTML sanitization
- Contributing — how to help the project
Example story included
The repository ships with a complete example adventure, "L'Antica Cripta" / "The Ancient Crypt", which demonstrates:
- Character creation with name and perks
- Stat-based tests
- Inventory and item usage
- Conditional branches based on items, flags, and perks
- Background music
- One-shot choices
- Multiple paths and endings
- Story node images
- Colored text and dialogue
Requirements
- A modern browser (Chrome, Firefox, Safari, or Edge)
- A static file server for local development
- Python 3 only if you want to use the bundled Story Converter
License
This project is released under the MIT License. See the LICENSE file for details.