gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Game Design > Unknown compression format

#18319 - LOst? - Tue Mar 23, 2004 10:55 pm

I have tried the GBA Crusher on a Sega Genesis tile data to see how much I can decrease the size.

I'm actually looking for the name of the compression type used by the basic Sega games, and I thought it could be some sort of LZ, so I tried to compare the data after being compressed. Here is the result:

Huffman 4-bit: Genesis tile data ended up 17% compressed
Huffman 8-bit: Genesis tile data ended up 35% compressed
LZ77 and VRAM safe: Genesis tile data ended up 33% compressed
Sega Genesis compression: Genesis tile data are 55% compressed


I don't know much about compression or how it works. The tile format in Sega Genesis is 4 bit per pixel. The LZ77 isn't good on this format? Is there any other LZ compression that may be better to use? Or is this compression format made up by Sega (which I don't believe)?

Oh by the way, I tried to compress GBA tiles with the GBA Crucher and the Sega Genesis compression format with the result:

Huffman 4-bit: GBA tile data ended up 50% compressed
Huffman 8-bit: GBA tile data ended up 62% compressed
LZ77 and VRAM safe: GBA tile data ended up 67% compressed
Sega Genesis compression: GBA tile data are 33% compressed

So I guess LZ77 is best for GBA tile data.

Does anyone know what type of compression the Genesis uses after seeing just these results? Just a guess would be nice :P

#18320 - Miked0801 - Tue Mar 23, 2004 11:23 pm

A guess would be an LZ compressor with a filter applied to the data. But with the data supplied, I can only guess. I'm pretty sure it won't be an LZ78/LZW type nor anything more memory intensive. As the compression rates are high, I doublt it's a Huffman or RLE. That leaves LZ77. With even a differential filter, many tilesets compress much better.

#18321 - LOst? - Tue Mar 23, 2004 11:41 pm

Miked0801 wrote:
A guess would be an LZ compressor with a filter applied to the data. But with the data supplied, I can only guess. I'm pretty sure it won't be an LZ78/LZW type nor anything more memory intensive. As the compression rates are high, I doublt it's a Huffman or RLE. That leaves LZ77. With even a differential filter, many tilesets compress much better.


Compression is too complex for my brain...

Code:
The art compression format is a very dense compression format. It's only used for art because the format relies on the data being in blocks of 64 bytes.

From a guy I know that has written a compressor/decompressor tool for the Genesis tile format. The problem is that he's calling the compression format with his own name, even though it's used in more than 10 original Sega games. It would be fun to know the real name of it and that's why I'm asking for help.

#18326 - Miked0801 - Wed Mar 24, 2004 3:19 am

Hmmm. Maybe he's creating a lookup of some-sort then where the top N 64-byte patterns are turned into special escape sequences to get compression. Just a guess.

#18334 - tepples - Wed Mar 24, 2004 4:47 am

The only difference between Sega Genesis tile data and 4-bit GBA tile data is that Sega Genesis tile data is nibble-swapped to work better with the big-endian 68K architecture. This suggests some sort of nibble-wise operation.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#18345 - LOst? - Wed Mar 24, 2004 6:14 pm

tepples wrote:
The only difference between Sega Genesis tile data and 4-bit GBA tile data is that Sega Genesis tile data is nibble-swapped to work better with the big-endian 68K architecture. This suggests some sort of nibble-wise operation.


Okay. It's always interesting to know how different consoles work. I like the M68k processor a lot.