Skip to content

Reactive_Story_Engine

Generative interactive fiction with audio, theming, and soul tracking

AI Pair Programmed HIGH_LOAD
ReactTone.jsCanvas APITypeScript

OPTIMIZED_FOR_DESKTOP

LOADING_MODULE...

The Engine

The Reactive Story Engine takes a single static JSON bundle - a Story DNA plus scene graph, audio profiles, theme profiles, soul config, and visualization parameters - and produces a fully playable, musically-reactive narrative experience. No API calls at play time. Fully offline-capable.

The system has five parallel engines that all subscribe to a central soul state:

  • Scene Graph Engine - branching narrative with prose that adapts to accumulated choices
  • Audio Engine - Tone.js synthesizers generate ambient pads, melody fragments, sub bass, and noise that shift with each chapter. Two detuned LFO-modulated pad layers create organic breathing volume swells.
  • Theme Engine - palette, typography, spacing, and animation curves all crossfade between chapters. The switch from sans-serif to serif signals a shift from action to reflection.
  • Soul Tracker - maps choices to 3-5 invisible dimensions. Endings are determined by the dominant trait - you never pick an ending, it’s determined by the accumulated weight of all your choices.
  • Viz Engine - a canvas waveform visualizer renders behind the text, lerping between per-chapter amplitude, frequency, speed, and noise parameters.

Architecture

Every choice updates the soul state, and all four renderers (scene, audio, theme, viz) react simultaneously. Phase transitions crossfade synth profiles over 2-4 seconds, ramp BPM, fire stinger chords, and shift the color palette. Ghost melodies from earlier phases can bleed through when soul thresholds are crossed.

The engine supports three narrative structures: arc (linear progression), cycle (repeating loop with evolving prose), and spiral (loop that transforms each iteration).

Current Stories

Night Wrecker - Five chapters. You wake in a dark room. Something is there. Denial through fragile hope, overwhelming exposure, grief, and forward motion. Four soul dimensions (light, confrontation, motion, memory) lead to four endings. Arc structure, D minor, sine oscillators, literary tone.

Design Principles

  1. The soul state is the central nervous system. A choice doesn’t just advance the story - it shifts the music, the colors, the waveform, and the prose simultaneously.
  2. The music breathes. Static loops feel dead. Breathing feels alive.
  3. Typography carries emotional weight. The switch from sans to serif is a signal, not decoration.
  4. Endings are found, not chosen. The ending feels earned rather than selected.
  5. The system is the portfolio piece. Any individual experience is impressive. The fact that they’re outputs of a generalizable engine is what makes it remarkable.