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.
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
- Deterministic simulationMultiplayerA deterministic simulation always produces exactly the same result from the same inputs, regardless of machine, timing or chance.
- Asynchronous multiplayerMultiplayerIn asynchronous multiplayer, people play against each other without being online at the same time: moves are stored and resolved later.
- Procedural sound effectsProduction & AI toolsSounds computed at runtime from oscillators, noise and filters instead of being stored as audio files.
- Automated playtestingEngine & techAn automated playtest has a program play through the game and report errors, dead ends and broken solution paths.