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
.storyworldbundle 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
.storyworldfile into the Project window and you get aStoryworldAssetScriptableObject, ready to bind into a session. - C# runtime API. Create a
StoryletSessionagainst aStoryworldAssetand callDraw/Play/PrimeAllSlots/GetSiteHandto drive storylets. The full surface lives onStoryletEngine.StoryletSession, and a drop-inStoryletSessionDriverMonoBehaviour wraps it forUnityEventwiring in the Inspector. - Gated outcomes. An outcome can carry an availability condition. Each
StoryletDrawnOutcomeexposes anAvailableflag (false when its condition is unmet) - show those choices disabled rather than hidden - andPlayis rejected for an unavailable outcome. Requires a.storyworldbundle at format version 2.3 or later. - Editor inspector. A
Window > Tools > Storylet Enginetab 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.storyworldstatefiles - the same portable format the authoring tool's Simulate view and the Unreal plugin produce. - Project settings page.
Edit > Project Settings > Storylet Enginefor 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>.zipfrom download.storylet.studio, unzip theStoryletEngine/folder into your project'sPackages/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:
- Pick an install route from above.
- Drag your
.storyworldfile into the Project window - the importer creates aStoryworldAsset. - Attach the bundled
StoryletSessionDriverMonoBehaviour to a GameObject and drop theStoryworldAssetinto itsStoryworldslot. (Or callStoryletSession.Create(asset, randomSeed, enableLog, out error)straight from your own code.) - 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.