Log inGet started
World

First Light

Branchmain
Branchesmain
Commit5b1bfa8dc1

README.md

firstlight.persist

The run's durable memory, in the world's runtime data under firstlight/. require("firstlight.persist").

Persisted sections of Rules.state: run, body, hut, stores, journal — one leaf each (firstlight/run, firstlight/body, ...).

  • Persist.load() — read the saved sections over the blackboard and restore the clock from run.elapsed. Returns whether a save existed.
  • Persist.save(reason?) — write every section now.
  • Persist.markDirty() — ask for a save at the next throttle window.
  • Persist.tick(dt) — per frame; flushes a marked or detected change every few seconds (a store or structural value written straight onto the blackboard is detected by fingerprint).
  • Persist.ensureSeed() — choose run.seed once per world and save it.
  • Persist.hasSave(), Persist.wipe().