Skip to content

Storylet Engine Unity 0.1.0

Choose a tag to compare

@github-actions github-actions released this 30 Aug 19:35
· 7 commits to main since this release

Added

  • Shared scarcity (design/shared-scarcity.md): Shared on Deck and Card plus
    SharedCopies, so a pile (or one card) is scarce across flows rather than
    one each per participant. Claims count every live flow's board; a shared
    redraw: never is spent for everyone on the first play; a finite redraw
    stays personal, because a cooldown is an absolute turn of a per-flow clock.
    Two new trace verdicts, ClaimedElsewhere and Taken, because "claimed"
    and "cooldown" would point a participant at their own board and their own
    clock, neither of which has anything to do with it.
  • Engine.Log() / ClearLog(): the RUN's log, every flow's events in one
    order with each entry naming its Flow. A flow's own log cannot show a
    story action in another flow moving shared state. The Runtime State window
    draws it under the engine's name, above the per-flow sections.
  • The save's shared half is now { props, spent } rather than a bare
    PropsPartition, carrying what a shared one-shot took out of the world.
  • Flows (design/flows.md): Engine owns the bundle, the shared state and
    @world; a Flow is one playthrough across it, and every play verb lives
    there. OpenFlow / GetFlow / Flows / CloseFlow / Reset manage them,
    re-opening a name replaces that flow, and a closed handle is inert. Named
    after Patter's Engine / Flow so a project running both engines reads the
    same. StoryletBundleAsset.CreateSession is now CreateEngine, and
    StoryletDebug keys on the ENGINE (Register(engine, label)): the Runtime
    State window asks each engine for its open flows, so a flow opened or closed
    later appears and disappears without a registry call.
    This REPLACES the session of the entries below, which was engine and
    single flow in one object: everything they say about a "session" is now
    split between the two, with the play verbs on the flow and the bundle,
    shared state and save on the engine.
  • The pure C# runtime layer, transliterated from the TS reference runtime:
    StoryletValue, Mulberry32 (+ the contractual shuffle), the state kernel
    (PropertyBag, ScopeRegistry), expression AST + evaluator + storylets
    dialect + matched-constraint specificity, the compiled bundle model and
    save envelope, and the full Session (deal / dealMany with the dealt
    slice, peek, play, outcomes, board, per-box turns, cooldowns, claims and
    copies, the home group, hand templates with holes and the composed @hand
    environment with write-back routing, ranking with stable sorts and seeded
    tie shuffles, save/load with the drifted-content contract, retained log +
    trace events, property rows and path-addressed get/set).
  • The Newtonsoft JSON layer (StoryletEngine.Runtime.Json): compiled-bundle
    loading into the pure model.
  • The dotnet TestHost (repo-side, never ships): replays the whole
    conformance corpus (expressions, specificity, peek, scripted) through the
    C# runtime.
  • StoryletSave in the Json layer: the .storyletsave string boundary over
    the runtime's own save envelope (SerializeState /
    DeserializeState / LoadState; foreign or malformed blobs throw),
    mirroring the play-helpers save API.
  • The UnityEngine-touching runtime layer (StoryletEngine.Runtime.Unity):
    StoryletBundleAsset (raw .storyletsc JSON persisted verbatim, compiled
    bundle rebuilt lazily, parse failures readable on LoadError,
    CreateSession(seed)), and the StoryletDebug session registry (weakly
    held, OnChanged event) the examiner reads.
  • The editor layer (StoryletEngine.Editor): StoryletBundleImporter
    (ScriptedImporter for .storyletsc; a broken bundle still imports with
    the error readable on the asset) and the Runtime State window
    (Window > Storylet Engine > Runtime State): per-session Save/Load of
    .storyletsave files, the type-aware property examiner / editor with
    per-row reset and a ~4 Hz refresh that spares the focused control, and
    read-only per-box turns + board contents.
  • The Board demo, as a committed Unity project beside this package
    (../StoryletEngineDemo): open it and press Play, no package install and no
    sample import, because its manifest references this folder by relative path.
    The exported Hamlet bundle dealt onto a playable board (hands as groups,
    cards as buttons, outcomes beneath their card, a transcript of every deal,
    play and turn), registered with StoryletDebug. The same demo ships for
    Godot, Unreal and JavaScript. It replaces the Samples~/BoardDemo UPM
    sample, which is retired: one home for the demo, so the two copies cannot
    drift.
  • .meta files for every shipped file and folder (generated by Unity
    6000.4.6f1 against an embedded checkout of this package).
  • Live Link went to protocol v2 (design/live-link.md): a client now
    attaches to the ENGINE, not to one flow. hello carries flows, new
    flowOpen / flowClose frames announce participants joining and leaving,
    and every trace and board frame names its flow. The client discovers
    flows itself by diffing the engine's list before each forwarded event, so a
    multi-participant run needs nothing extra from the host. The editor's Board
    follows one flow at a time and remembers the last board per flow. Held to
    the shared fixture in packages/conformance/live-link/, which now scripts a
    second participant opening, playing and closing.
  • Live Link: StoryletLiveLink (Runtime) joins a running game to
    Storyletter over a loopback WebSocket on a worker thread: Attach(engine)
    streams the session's trace and board snapshots to the editor's Board,
    TryReceive (drained from Update()) hands back pushed bundles, which
    StoryletLiveBundle.TryParsePush + Apply (Json layer) swap in under the
    run, state kept; SetBuild re-hellos. StoryletDebug.RegisterLink lets
    the Runtime State window show the link's state. The demo wires it behind
    #if UNITY_EDITOR || DEVELOPMENT_BUILD; the TestHost replays the shared
    fixture (packages/conformance/live-link/) against it. Trace events now
    fire after the state they report has landed (deal, evict, play, turns), as
    the reference runtime does.