Bay 12 CMV

From MultimediaWiki
Revision as of 19:29, 28 April 2011 by Andux (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The CMV file format is used by the game Dwarf Fortress to store intro movies and player recordings.

File structure

Header

Type Name Description
uint32 Version The format version used; should be >= 10000
uint32 Width Width (in characters) of each frame
uint32 Height Height (in characters) of each frame
uint32 DelayRate How long each frame is displayed; seems to be in hundredths of a second.

Sounds

This section is present in version 10001 files, but not in 10000 or 10005.

Type Name Description
uint32 SoundCount Number of sound references defined.

Sound references

An array of SoundCount records:

Type Name Description
char[50] SoundName Filename (no dir or ext) of an external file which contains the sound data.

Sound timing data

An array of 3200 (16 channels x 200 frames?) 32-bit signed integers, specifying the index of one sound ref defined above. A value of -1 indicates no new sound is played at that point.

Frame data

Frame data is stored in zlib-compressed chunks containing a maximum of 200 frames:

Type Name Description
uint32 z_size Size of compressed data.
bytes z_data z_size bytes of compressed data.

The uncompressed structure of each frame roughly corresponds to a text-mode screen buffer:

Type Name Description
char[Width*Height] Characters An array of characters, encoded in the CP437 character set.
char[Width*Height] Attributes Encodes the ANSI color codes for each character.

Note that the encoding of color attributes is nonstandard:

0ibbbfff
i   - Foreground Intensity Bit
bbb - Background Color Bits
fff - Foreground Color Bits

Related software

CMV Movie Editor