Skip to content

Documentation / @debuffjp/dev / InputRecording

Class: InputRecording ​

Defined in: dev/src/replay.ts:131

Records input and param changes per simulation tick from page load, so a live session can be turned into a scenario that replays it exactly (the fixed-step clock and seeded RNG make runs deterministic). Wraps the input's own methods, so real events, dev hooks and agents are all captured. Dev only.

Constructors ​

Constructor ​

new InputRecording(game, input, checkpoint?): InputRecording

Defined in: dev/src/replay.ts:142

checkpoint, when given, is recorded every CHECKPOINT_EVERY ticks, just before that tick's step and after its input: the same moment a scenario reaches after the step's wait and input.

Parameters ​

game ​

Game

input ​

DrivableInput

checkpoint? ​

() => Checkpoint

Returns ​

InputRecording

Accessors ​

count ​

Get Signature ​

get count(): number

Defined in: dev/src/replay.ts:268

Events recorded so far.

Returns ​

number

Methods ​

command() ​

command(name, args): void

Defined in: dev/src/replay.ts:298

Record a game command (see DevHooksOptions.commands) so replays run it at the same tick.

Parameters ​

name ​

string

args ​

unknown[]

Returns ​

void


dispose() ​

dispose(): void

Defined in: dev/src/replay.ts:293

Returns ​

void


toReplay() ​

toReplay(toTick?, name?): Replay

Defined in: dev/src/replay.ts:278

The session from page load up to toTick (default: now) as scenario steps.

Parameters ​

toTick? ​

number = ...

name? ​

string = ...

Returns ​

Replay


warn() ​

warn(message): void

Defined in: dev/src/replay.ts:273

Note something that makes an exact replay impossible (shown with the replay).

Parameters ​

message ​

string

Returns ​

void