Skip to content

SavedGame beta ​

Interface of @v12-engine/client

ts
export interface SavedGame<A extends object = Record<string, unknown>>

Games saved in this browser, to go on with later: the world as it was (saveWorld), where it was played (scene: a scene of an app, or whatever a page calls the place it launches a game from) and what that was opened with, so that loading it opens the same place from the save. In IndexedDB, as a world is too big for localStorage; in a database of its own, apart from the editor's

Members ​

args ​

ts
args: A;

What the scene was opened with, so that loading the save opens the same place

at ​

ts
at: number;

Milliseconds since 1970

game ​

ts
game?: string;

The game it is of, by id (Rules.id): two apps on one origin may have scenes of the same name, and a save is only listed by its own game. Saves from before it have none

ts
header?: SaveHeader;

What the save says of how old it is (saveHeader: its format, its game's version of saves, the rules it was made with), kept beside it so that a list knows whether the game still loads it without reading the world. Saves from before it have none

id ​

ts
id: string;

The save's id: the key it is kept under

kind ​

ts
kind?: 'checkpoint';

A checkpoint of a mission's rules (world.checkpoint, campaign plan SV3), not a save the player or the game made: one a mission, made again in its place (checkpointId), kept apart from the lists of saves. None for a save

label ​

ts
label?: Message;

A checkpoint's words, as the rules gave them: what "Retry from …" says

name ​

ts
name: string;

What the player called it, or what it was called for them: the mission and the time in it

picture ​

ts
picture?: string;

A picture of the game as it was saved, for the lists of saves (campaign plan SV2): a small JPEG as a data URL, 320 pixels wide. Kept with the summary, without the world. None where there was no screen to take it of

save ​

ts
save: string;

The world, as encodeSave writes it

scene ​

ts
scene: string;

The scene it was played in, and what that was opened with, the save itself apart

seconds ​

ts
seconds: number;

Seconds of the game it was saved at