Storylet Studio

StoryletEngine for Unity

Storylet Studio publishes .storyworld bundles - precompiled storylet data ready to play at runtime. StoryletEngine for Unity is a UPM package for Unity 6 LTS (6000.0) and later that loads those bundles inside your Unity project and runs storylets from C# (MonoBehaviour or plain code).

This page orients you: what the package does, where to get it, and what's involved in shipping a Storylet Studio storyworld through a Unity game. The package ships with full installation and API docs of its own, so treat this as the overview.

What you need

  • Unity 6 LTS (6000.0) or later.
  • A .storyworld bundle from Storylet Studio - published from the authoring tool via Publish.
  • The StoryletEngine Unity package zip, from download.storylet.studio under "Engine plugins".

What the package gives you

  • Asset importer. Drop a .storyworld file into the Project window and you get a StoryworldAsset ScriptableObject, ready to bind into a session.
  • C# runtime API. Create a StoryletSession against a StoryworldAsset and call Draw / Play / PrimeAllSlots / GetSiteHand to drive storylets. The full surface lives on StoryletEngine.StoryletSession, and a drop-in StoryletSessionDriver MonoBehaviour wraps it for UnityEvent wiring in the Inspector.
  • Gated outcomes. An outcome can carry an availability condition. Each StoryletDrawnOutcome exposes an Available flag (false when its condition is unmet) - show those choices disabled rather than hidden - and Play is rejected for an unavailable outcome. Requires a .storyworld bundle at format version 2.3 or later.
  • Editor inspector. A Window > Tools > Storylet Engine tab for poking at a live session in Play Mode - state, properties (editable inline), and action log with filter + copy / save. The State tab also has Save State / Restore State buttons that read and write .storyworldstate files - the same portable format the authoring tool's Simulate view and the Unreal plugin produce.
  • Project settings page. Edit > Project Settings > Storylet Engine for engine-wide preferences.
  • Save / restore of session state via SaveToJson / RestoreFromJson.
  • Bundled sample. A Riverbend Inn storyworld + driver scene under the package's Samples (import via the Package Manager's "Samples" panel).

Install routes

Two options. The package's own README has the details:

  • Zip download. Get StoryletEngine-Unity-<version>.zip from download.storylet.studio, unzip the StoryletEngine/ folder into your project's Packages/ directory.
  • Local file dependency. "studio.storylets.engine": "file:../path/to/StoryletEngine" - handy when several projects share a single extracted copy.

Either route pulls in Newtonsoft.Json automatically via the package's declared UPM dependency.

Quickstart (3 minutes)

The full quickstart lives in the package's own README. The short form:

  1. Pick an install route from above.
  2. Drag your .storyworld file into the Project window - the importer creates a StoryworldAsset.
  3. Attach the bundled StoryletSessionDriver MonoBehaviour to a GameObject and drop the StoryworldAsset into its Storyworld slot. (Or call StoryletSession.Create(asset, randomSeed, enableLog, out error) straight from your own code.)
  4. Press Play. From here, call the session's methods - Draw, Play, PrimeAllSlots, GetSiteHand - to drive the loop.

That's the basic loop. Save / restore, the inspector tab, and the project settings page all wire up automatically.

IL2CPP / managed stripping

The package ships a link.xml next to its runtime asmdef that protects the inner-core engine assembly and Newtonsoft.Json from managed-code stripping. Ship builds (IL2CPP + Managed Stripping Level = Low or higher) work out of the box, with no project-side stripping rules needed.

Where to next

  • The package's own README - quickstart, full API reference, supported Unity versions, troubleshooting.
  • For Game Developers - the overall publish-and-load workflow, how the engines compare, and licensing / source.
  • Simulate - what running a storyworld looks like in the reference UI; the Unity package exposes the same Draw / Play primitives.
  • Game Data - the per-storylet custom fields a player shell typically reads to drive presentation (UI, dialogue, audio).
  • StoryletEngine for Unreal - the sibling plugin for Unreal Engine 5.7+. Same engine semantics, same bundle format, same cross-runtime conformance suite.