DE EN FR ES IT

Multiplayer

Replay

Also: match replay, playback

A replay is an in-game playback of a match that has already been played. It is produced either from a stored event log or by feeding the recorded inputs through a deterministic simulation once more.

From moves to replay in FaxFightBoth sides’ secret moves go into the deterministic resolver. It writes a log that the replay plays back. Moves Asecret, encrypted Moves Bsecret, encrypted FightEngineno randomness Result logJSON log of the fight Replayplays back the log FaxFight: the server resolves once, everyone sees the same fight
Diagram based on FaxFight’s technical documentation: the resolver stores its log, the replay animates it.

Background

There are two basic approaches. An input replay stores only every side’s commands and re-simulates the match on playback. It takes very little space, but requires the simulation to compute exactly the same result on every machine, even after updates. An event replay stores the outcomes, who hit whom and when, and plays that list back.

Replays serve entertainment, learning and debugging: developers can step through a reported match. In asynchronous games they are often the real highlight, because both sides only experience the outcome during playback.

Classic mistakes are replays that break after an update because the rules changed, and interfaces that spoil the result before the playback even starts.

How we do it

In FaxFight the replay is the heart of the experience. When a fight is resolved, the fight engine writes a JSON log of every round to the database. The replay page embeds that log, and replay.js turns it into the arena, poses (standing, attacking, hit, victory), knockout fall, comic speech bubbles and energy bars, with announcer, character voices, fight music and synthesised sound effects.

So we play back an event log rather than re-simulating. That keeps old fights playable even if we tweak values later. The replay can be skipped and muted, runs slower when reduced motion is requested, and the result only appears afterwards, so nothing gets spoiled.

Related terms