don't click here

UFTC compression/decompression tool

Discussion in 'Technical Discussion' started by Sik, Apr 26, 2011.

  1. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,718
    1
    0
    being an asshole =P
    http://www.fileden.com/files/2006/12/22/543510/uftc.7z

    I should go and update the SLZ tools (and actually go make XSLZ...). In the meanwhile, here goes another compression format: UFTC. This format is meant to compress entire sprite animations (e.g. all player sprites, all sprites of an enemy, etc.), while still being able to decompress them in real-time as the game is running. It does so by splitting tiles into 4x4 pixel "blocks" and then just storing IDs that point to data in a dictionary.

    Compression ratio? Didn't really try that out yet, though it depends heavily on how much redundancy is in the animations really. Decompression speed (on the MD) is pretty good: decompressing 16 tiles takes up about 10 scanlines (around 3.82% of a frame in NTSC). The idea of this format was to be able to stream sprites from the cartridge while still being able to do some compression. Useful if you have, for example, lots of sprites for the player and want to reduce space usage somewhat.

    So, who wants to try?

    EDIT: fixed some stupid issue in the makefile... I hope. Apparently make isn't as smart as I thought.

    EDIT 2: derp fixed stupid bug in the decompressor side of the tool, redownload please.
     
  2. FraGag

    FraGag

    Tech Member
    Sonic 1 using UFTC for Sonic's graphics

    The uncompressed graphics are 41,248 bytes, and 34,362 bytes after compression. It's not a lot, but someone who would like to make a sprite sheet with smoother animations could see a better compression ratio (as long as the dictionary fits in less than 32,768 bytes; the dictionary in Sonic's art takes 24,048 bytes).

    I altered the decompression routine slightly, because using d7 was impractical in the context where it's used (d7 is the counter for the object loop). Also, I removed the bra.s @LoopEnd before the first iteration, because the DPLCs specify the number of tiles minus 1 already.

    Also, I fixed the SEGA sound as per the guide on the wiki, otherwise the game would crash in Regen. Speaking of Regen, its debugging tools were very helpful in the (short) development of this hack. :v:

    Bonus: uftc.exe
     
  3. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,718
    1
    0
    being an asshole =P
    Sonic games already arrange Sonic sprites to avoid redundance though (I.e. some tiles are shared among sprites), so that makes UFTC kind of useless in that context. I guess it's something though.
     
  4. FraGag

    FraGag

    Tech Member
    Right. Somebody importing a sprite sheet without bothering to optimize it would benefit more from this.
     
  5. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,718
    1
    0
    being an asshole =P
    Updated 68000 decompressor on request of FraGag who insisted that I should be using movem =P

    EDIT: turns out it's slower FFFFFFFFFFFFFFF reuploading old code, sorry.