Replay file

From Worms Knowledge Base

Revision as of 14:26, 6 July 2006 by CyberShadow (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Replay (.WAgame) files were introduced to Worms Armageddon with Deadcode's 3.6.19.15 beta update, which was released on 20 February, 2004. The files represent self-contained recordings of games, which can be played on any computer with the corresponding software updates installed.

Recordings of all games played (including offline, mission and training games) are saved automatically to the User\Games folder. File names consist of a date/time stamp, the game type, and the participating players.

The files contain all the information needed to play the replay flawlessly. This includes the game version which was emulated during the game, the map and the scheme, the participating teams (including the custom flags and graves), and the random seed used for random in-game events (such as random initial placement of worms and objects).

File format

The rest of this article needs to be reviewed by an expert who has more experience in this domain.

The file starts with two signature bytes ("WA"), after which follows a word with the file version. W:A 3.6.26.5 saves replays in the version 12 format (0x000C).

After this, two DWORDs follow. The first represends the map data length, and the second - the map type. The map type can be 1 for Monochrome map (.bit), 2 for Seed-generated monochrome map, or 3 for Colour map. The map data follows, its length being the 2nd DWORD in the file (see above).

Following the map data are four DWORDs (the chunk length, 0x0000000C, and three DWORDs that probably represent the random seed), after which is the game scheme. Following it are the players, the teams, and after some null padding are the message sequences (user input) which is piped to the game engine to play back the replay.

Security

The format incorporates periodic checksums, embedded into specific actions. This allows to detect modifications to the replay, causing warning messages during playback.

The tool-assisted versions of W:A save replays in an encrypted format, which is playable only with the tool-assisted version. Only Deadcode can decrypt them, thus making them playable with normal versions of W:A.

Personal tools