Skip to content

CommandReplay beta ​

Interface of @v12-engine/engine

ts
export interface CommandReplay

A game recorded as its start and its commands (recordGame's kind: 'commands'), to run again (playReplay)

Members ​

checkpoints ​

ts
checkpoints?: [tick: number, save: string][];

The world as it was every so many ticks (recordCommands' checkpoints), as saves: a replay played from a moment starts from the last one before it, not from its start. None in a replay made before there were any

commands ​

ts
commands: [tick: number, command: IssuedCommand][];

What its players told it, each at the tick it was given at, before that tick ran

debug ​

ts
debug?: PlayerId[];

The players who could use the debug commands as it was recorded (World.debugPlayers, which no save keeps): played back, they may again, so a game whose cheats were used (the editor's Play here, its map edits pushed) comes to the same. None when left out

format ​

ts
format: 2;

The replay's file format, always 2; another is not read

from ​

ts
from: number;

The tick it started and ended at

game ​

ts
game: string;

The game it is of, by id: a page plays back what it has

hashes ​

ts
hashes: [tick: number, hash: string][];

The world's fingerprint (worldFingerprint) every every ticks, to tell where a game played back came apart

kind ​

ts
kind: 'commands';

Marks this replay as one of commands, as opposed to a recording of snapshots

player ​

ts
player: PlayerId;

Whose side it is seen from when played back; any side can be, as all of the game is in it

rules ​

ts
rules: string;

The rules it was played with exactly (registry.hash): other rules may play it otherwise

saves ​

ts
saves: number[];

The ticks it was saved at: a save puts the crowd back as a load does (D2), so playing back does it there too

start ​

ts
start: string;

The world as it was at from, as a save (encodeSave)

tickRate ​

ts
tickRate: number;

Ticks per second the game ran at, for the replay to run at again

to ​

ts
to: number;

The tick the recording ended at