Home - ByteSower/qnce-engine GitHub Wiki

⚠️ QNCE Engine is Under Major Reconstruction

Notice (Feb 2026): The QNCE Engine is currently undergoing major reconstruction. Many features, including narrative rules and story flow, may not behave as expected. The engine is transitioning toward broader quantum modeling principles and improved performance. If you require stability, consider waiting for a future release. See GitHub and npm for updates.

QNCE Engine Wiki

QNCE Engine Logo

NPM Version TypeScript MIT License Tests Performance

Quantum Narrative Convergence Engine - Framework-agnostic interactive storytelling with quantum-inspired mechanics

🌟 Welcome to QNCE Engine

The Quantum Narrative Convergence Engine (QNCE) is a powerful TypeScript library that enables developers to create sophisticated interactive narrative experiences. Drawing inspiration from quantum mechanics, QNCE provides unique storytelling capabilities through superposition, collapse, and entanglement mechanics.

⚡ Key Features

🌿 Advanced Branching System

  • Multi-path narratives with conditional logic and flag-based branching
  • AI-driven content generation for dynamic story expansion
  • Real-time branch insertion/removal for live content updates
  • Dynamic branch evaluation with custom condition evaluators

🚀 Performance Infrastructure

  • Object Pooling: 90%+ allocation reduction
  • Background Processing: Non-blocking cache preloading
  • Hot-Reload: Sub-3.5ms live story updates
  • Real-time Profiling: Comprehensive performance analysis

🛠️ Developer Experience

  • Framework-agnostic - Works with React, Vue, Node.js, vanilla JS
  • TypeScript-first with comprehensive type definitions
  • Modular architecture allowing selective feature imports
  • CLI tools for project scaffolding and performance monitoring

💾 State Management

  • Full state persistence with compression and validation
  • Automatic save/restore with configurable intervals
  • Checkpoint system for implementing undo/redo functionality
  • Cross-session persistence with localStorage and custom storage adapters

🎨 UI Components

  • React integration with useQNCE hook for reactive state management
  • Pre-built components - UndoRedoControls, AutosaveIndicator
  • Keyboard shortcuts for common actions and accessibility
  • Customizable theming and responsive design support

🎯 Core Concepts

Concept Description Example
Superposition Multiple narrative outcomes exist simultaneously Player facing multiple potential story paths
Collapse Choices "collapse" the narrative to a specific path Making a decision that locks in story direction
Entanglement Early decisions affect later outcomes A kindness in chapter 1 affecting chapter 5

🚀 Quick Start

# Install QNCE Engine
npm install qnce-engine

# Create a new project
npx qnce-init my-story

# Run performance monitoring
npx qnce-perf --watch
import { createQNCEEngine, DEMO_STORY } from 'qnce-engine';

// Create engine instance
const engine = createQNCEEngine(DEMO_STORY);

// Get current narrative state
console.log(engine.getCurrentNode().text);

// Display available choices
const choices = engine.getAvailableChoices();
choices.forEach((choice, i) => {
  console.log(`${i + 1}. ${choice.text}`);
});

// Make a choice and advance the story
engine.makeChoice(0);

📚 Documentation Structure

Page Description Quick Link
Getting Started Installation, basic usage, first steps 🏁 Start here!
Branching Guide Advanced branching system and AI integration 🌿 Power features
Performance Tuning Optimization, monitoring, and profiling ⚡ Speed it up
CLI Usage Command-line tools and automation 🛠️ Developer tools
API Reference Complete API documentation 📖 Technical specs
Persistence Adapters How to save/load engine state across backends 💾 Persistence
Contributing How to contribute to the project 🤝 Join us!
Release Notes Version history and migration guides 📋 What's new

🎮 Use Cases

🎭 Interactive Fiction

Create branching narratives with complex storylines and character development.

🎲 Game Narratives

Power RPG dialogue systems, quest lines, and story-driven gameplay.

📚 Educational Content

Build interactive learning experiences with adaptive pathways.

🏢 Enterprise Applications

Create guided user experiences, onboarding flows, and decision trees.

📊 Performance Benchmarks

Metric Target Current Status
State Transitions ≤5ms ~3ms ✅ Exceeds
Flow Switches ≤20ms ~12ms ✅ Exceeds
Hot-reload Updates <2ms ~1.8ms ✅ Meets
Memory Usage ≤50MB ~35MB ✅ Exceeds
Cache Hit Rate ≥95% ~98% ✅ Exceeds

🌐 Framework Support

QNCE Engine works seamlessly with popular frameworks:

Framework Support Level Integration Guide
React ✅ Full React Integration
Vue 3 ✅ Full Vue Integration
Node.js ✅ Full Server Integration
Vanilla JS ✅ Full Vanilla JS Guide
TypeScript ✅ Native TypeScript Examples

🔗 Important Links

📦 Package & Repository

📚 Learning Resources

🤝 Community

🚀 What's Next?

🗺️ Roadmap for v1.3.0

  • Visual story editor with drag-and-drop interface
  • Advanced AI integration with GPT and Claude support
  • Multiplayer narratives with real-time synchronization
  • Visual novel renderer for rich media stories

📄 License

QNCE Engine is released under the MIT License.


Ready to build your next interactive narrative?

Get Started → | View Examples → | Join Community →

Built with ❤️ by the QNCE development team


📍 Wiki Navigation

You are here: Home

Next: Getting Started →

All Pages: Getting StartedBranching GuidePerformance TuningCLI UsageAPI ReferencePersistence AdaptersContributingRelease Notes


This documentation is maintained for QNCE Engine v1.3.0 with advanced feature set including Choice Validation, State Persistence, Conditional Choices, Autosave & Undo/Redo, and UI Components.

⚠️ **GitHub.com Fallback** ⚠️