Demo

From ZDoom Wiki
Jump to navigation Jump to search
DoomWiki.org
For more information on this article, visit the Demo page on the Doom Wiki.

A demo, short for demonstration, is a recording of settings and in-game commands allowing to reconstitute a playthrough with perfect accuracy. The demo format, however, is very susceptible to engine or level changes. For this reason, ZDoom does not offer backward demo compatibility: if a demo was recorded with too old a version of ZDoom, the program will tell you it cannot play it back.

ZDoom is also not compatible with the vanilla Doom demo format and will therefore not play the demo loop from the various supported IWADs. Because of the lack of backward demo compatibility, it is not advised to put built-in demo lumps in a ZDoom mod, as they risk getting obsoleted. Instead, a scripted TITLEMAP can be used.

The chasedemo console variable can be used to watch demos in chasecam mode.

The ZDoom demo format is based on the MiniWikipediaLogoIcon.pngInterchange File Format. It contains a FORM chunk of type ZDEM. It is then followed by several chunks, which can be of the following types:

  • ZDHD: ZDoom demo header. Contains engine version, map label, and random number generator seed.
  • VARS: Variables. Stores the state of the demo-critical console variables.
  • UINF: User information. Contains data about each of the players recorded in the demo.
  • NETD: Net demo. Contains no info, but its presence flags the demo as being multiplayer.
  • WEAP: Weapons. Contains the list of weapons available in-game during the demo and which slot they use.
  • BODY: Body. Contains the bulk of the demo: the commands issued each tic by each player. This chunk may be compressed with MiniWikipediaLogoIcon.pngzlib.
  • COMP: Compression. Contains the total size of the BODY chunk data when uncompressed.

Critical console variables

Demo-critical console variables are those that have either the CVAR_DEMOSAVE flag or the CVAR_SERVERINFO flag. They include:

  1. alwaysapplydmflags
  2. compatflags
  3. compatflags2
  4. deathmatch
  5. dmflags
  6. dmflags2
  7. forcewater
  8. fraglimit
  9. gameskill
  10. genblockmap
  11. genglnodes
  12. gennodes
  13. infighting
  14. splashfactor
  15. sv_aircontrol
  16. sv_cheats
  17. sv_corpsequeuesize
  18. sv_disableautohealth
  19. sv_dropstyle
  20. sv_fastweapons
  21. sv_gravity
  22. sv_smartaim
  23. sv_unlimited_pickup
  24. teamdamage
  25. teamplay
  26. timelimit
  27. var_friction
  28. var_pushers

Currently, the VARS chunk can store up to 32 console variables.