A quick look at a watery game video format

As you can guess, my work on Real Video 4 encoder goes so well that I’d rather look at virtually anything else.

Probably some of you are aware of Tex Murphy game series (maybe not even just Mike) and I got reminded of an existence of The Pandora Directive game that supposedly has a lot of videos in it, so I downloaded a demo and decided to explore it a bit.

Game data is packed into extremely simple archive format (just the number of offsets and the offsets) so you need to know what archives to look into (hint: the larger ones).

So what about videos? They start with H2O magic (hence me calling it a watery format) and contain video frames and audio data (in an embedded WAV file). The video compression is both nothing special and somewhat original: it’s Huffman-compressed RLE. Video frame can contain several chunks, first there’s a Huffman tree description, then palette data and finally there’s compressed RLE data. The originality lies in the details: Huffman coding is often used to code single bytes while here single symbol represents both run length and value (also IIUC zero value signals skips), additionally the data is stored as the list of symbols for each codeword length. I don’t think I’ve seen anywhere neither RLE+Huffman used in such manner nor such tree description format.

This was a fun distraction even if I don’t care about the game series (I tried playing their other games like Countdown and Amazon: Guardians of Eden but the interface was too clunky and the action sequences were too annoying). It’s always nice to see some originality in video coding even if it is nothing advanced.

2 Responses to “A quick look at a watery game video format”

  1. Cool! I never finished this game but I did complete 2 of the predecessors, Under A Killing Moon and Martian Memorandum. I sort of expect UAKM to leverage similar formats as Pandora Directive, while Martian Memorandum had some clever speech encoding so the game could be delivered on a bunch of floppy disks.

  2. Kostya says:

    From an even quicker look UaKM has different video format with size first and magic .PTF next. It’s RLE with some variations to skip frame lines and it’s organised into individual nested chunks with 16-bit magic (e.g. 0xF1FA for video frame data, 0x000B for palette data inside it and so on) while PD used a frame flags byte (0x40 = Huffman tree description, 0x02 = frame data, 0x01 = palette).