Another bunch of interesting game codecs

While Iran wages a proxy war with Ukraine (and I can easily believe they’re not against doing it to the last russian), I’m still trying to distract myself by looking at various video formats in games I have no intention to play.

Finding games with unknown formats gets harder and harder (or at least more tedious). So here are two games with an interesting approach to video compression.

Dark Earth packs frames as separate planes with 5-bit components and each plane is compressed using a peculiar modification of LZ77 scheme: depending on a bit set, it either codes a run or a forward reference in either the same or previous buffer. Additionally it codes it using non-bytealigned stream (run mode is coded in 13 bits and copy mode takes 25 bits).

There’s also Defcon 5 game (the one from the mid-1990s, do not confuse it with a game with the same name but from a previous decade). This one employs a different method I don’t remember seeing anywhere else: painting squares. Of course you’re used to various codecs splitting tiles in blocks and filling them (from older codecs using quadtrees to H.26x and its rip-offs). This one does it differently though: there is a fixed set of tile sizes selected for each video (I’ve seen only 32, 16, 8, 4, 2 set though) and frame data is essentially a list of commands telling at which offsets to paint a tile of this size with a given colour (those offsets may be completely arbitrary). It may be not the most efficient compression algorithm but it’s quite interesting. Also the container specifies palette as fixed and changing colours—first part is stored in the header and the second part is transmitted with each frame. Again, it’s not something extremely effective but I can’t easily remember any other format doing it that way.

I’ll probably try to do something different next time but I consider time spent on looking at these formats well-wasted.

Comments are closed.