Skip to content
Fungi

Checkpoints and retry

Save named simulation checkpoints and let players retry from them.

Vishnu keeps a small, in-memory ring of named checkpoints for each running world. Save one at a meaningful moment; the built-in Retry action restores that simulation state. The most recent checkpoint with a name replaces its previous one, and only the eight newest names are retained.

In the Acorn starter, import system and add this rule to the cartridge’s rules array:

TS
const saveOpening = system({
id: "acorn.save-opening",
version: 1,
reads: [],
writes: [],
run(context) {
if (context.clock.tick === 0) context.checkpoint("opening");
},
});

The first simulation tick records opening. Players can choose Retry from opening in the game’s actions. Checkpoints are runtime snapshots, not published save files; use a new name for each milestone you want to keep.

TERMINAL
vishnu check && vishnu test && vishnu build