Cynario Cynario alpha
Browse docs

Concepts

State & the truth model

How Cynario keeps state. The Playthrough log is the single source of truth; Memory, Content, and Context are views the engine rebuilds from it — which is why undo, replay, and share work and recorded randomness replays identically.

On this page

A Scenario is a graph of Scenes, and as a player moves through it, things happen: facts get remembered, blocks show and hide, the player moves from Scene to Scene. Something has to keep track of all of it. This page explains the one thing Cynario actually records, and the three things it shows you that are rebuilt from that record every time.

The one thing that is true: the Playthrough log

The Playthrough log is the recorded sequence of what happened during a run — every choice clicked, every Scene arrived at, every effect that fired, in order. It is the single source of truth. Everything else you see is reconstructed from it.

That is the whole idea: Cynario does not save the screen, and it does not save “where the player is.” It saves the story of the run and rebuilds the present moment from that story whenever it needs to.

The three views: Memory, Content, Context

The engine keeps three things live for you to read at any moment. Each one is a view — a current picture the engine maintains, but always rebuilds from the log (plus Memory) rather than storing on its own:

ViewWhat it answersPlain definition
MemoryWhat’s true so far?The facts the run remembers — scores, flags, lists, choices.
ContentWhat’s on screen right now?What’s shown: which blocks are visible, what’s styled, what values fill the text.
ContextWhere am I in the scenario?Where you are — space- and time-neutral. The home of “go to.”

These three are the only primitives an effect can change, and they are exactly the three views the truth model keeps. An effect that remembers a fact touches Memory; one that shows or styles something touches Content; a go to touches Context.

The bank line

Here is the one plain-language way to picture it:

Cynario saves your transactions (the Playthrough log), not your balance, and totals them on demand.

A bank does not store the number in your account. It stores every deposit and withdrawal, and adds them up the moment you ask for a balance. Cynario works the same way. It stores what happened, and it computes “what’s true / what’s shown / where you are” on demand by replaying the log. The balance you see is always correct because it is always freshly totaled from the transactions — never a stale number someone wrote down.

Only Memory is stored; Content and Context are rebuilt

By the bank analogy, the only thing Cynario truly stores from a run is Memory — the facts, the transactions. Content and Context are never stored on their own; they are totaled up from Memory and the log every time the Scene settles. So the picture is:

  • Memory is the ledger of facts the run accumulated.
  • Content and Context are rebuilt views — recomputed from Memory + the log, never kept as separate saved state.

That is the entire relationship. There is no second axis to learn — no “saved vs momentary,” no “sticky vs read-only.” There are three views; one of them (Memory) is the stored ledger, and the other two are totaled from it on demand.

Why undo, replay, and share all work

Because the log is the truth and the views are rebuilt from it, three things authors care about come almost for free:

  • Undo. To step back, the engine drops the last entries from the log and totals the rest. Memory, Content, and Context all rebuild to exactly the moment before. Nothing has to be carefully un-done by hand, because nothing was separately stored to begin with.
  • Replay. Hand the same log to the engine again and it produces the same run, beat for beat — the same facts remembered, the same blocks shown, the same Scenes arrived at. A replay is just the log totaled forward from the start.
  • Share. Sending someone your run means sending the log. They total it the same way you did and land in the same place. (And because the log is the only thing on the wire, it stays small and easy to reason about.)

The common thread: when “the present moment” is always rebuilt from one recorded sequence, copying or rewinding that sequence is enough. There is no hidden state to keep in sync.

Recorded randomness replays identically

A scenario can roll dice — pick a random adversary move, shuffle an order, draw a number. If that roll were redone on every replay, replays would drift away from the original run. So Cynario does the opposite: the first time a roll happens, the result is written into the Playthrough log (like a game saving its seed), and on replay the recorded result is read back instead of re-rolled.

The payoff is the best of both:

  • A fresh play genuinely rolls anew — real randomness, real variety.
  • A replay of a recorded run reproduces that run identically, because every roll is read from the log rather than redrawn.

Time and free typing follow the same rule: captured once into the log when they happen, read back on replay. The recorded run is always faithful to itself.

Reads that come straight from the log

Because the log is a full record of the run, authors can ask questions about the history of a play without ever storing a counter to track it. These reads are totaled from the log on demand, exactly like a balance:

  • How many times you’ve visited a Scene (and so: ever visited it, or visited it at least N times).
  • Whether you’ve been somewhere yet.
  • Whether you ever chose a particular option at a hub, or how many times.
  • How long you’ve spent on a Scene or across the whole run, and how long since something happened.
  • How many choices you’ve made this run.

These read just like any other fact in Logic. They sit right alongside Memory facts when you build a condition. The difference is invisible to you and load-bearing underneath: an author never writes “visited = true” or bumps a visit counter by hand. Doing that would create a second number that can drift out of step with what actually happened. The log already knows; the engine totals it for you. This is the bank principle applied to history: don’t store the balance, total the transactions.

In one breath

The Playthrough log is the single source of truth. Memory (facts), Content (what’s shown), and Context (where you are) are views the engine keeps live but always rebuilds from Memory + the log — a bank that saves your transactions, not your balance, and totals them on demand. That is why undo, replay, and share work, why a recorded random roll replays identically, and why “how many times did I visit this Scene” is a free read instead of a fact you have to maintain.