Instant Carma

From KeenWiki
Jump to: navigation, search
Instant Carma is a program created by CK Guy used to carmackize Keen Galaxy levels separately from TED5 and much more quickly. It accomplishes this due to two reasons, firstly, InstantCarma is run in windows, while TED5 must be run in Dosbox and secondly, while TED5 (and Carmack compression in general) relies on an 8KB sliding window with constant checks and compairisions between compressed and uncompressed data, InstantCarma performst he bare minimum amount of compression.

InstantCarma has been superseeded with falling use of TED5 in favor of newer, windows-based level editors that can performCarmack compression cleanly and quickly.

Minimum compression

Camack Compression is related to LZW and RLE in that it contains pointers to previously decompressed data.

For the minimum amount of compression two things need to be done. Firstly the size of the decompressed data must be written to the start of the minimally compressed data (This of course will be the same as the decompressed data's length, and slighlty shorter than the 'compressed' data being written.) secondly, any values that look like Carmack pointers (flags) must be rewritten as to not cause confusion during decompression. The modding wiki states this step as follows:

Words whose high (second) byte is xA7 or xA8 would appear to be issue, as they would be confused with near or far pointers. These are handled by representing them as the three bytes: $00, $Ax $xx, this is recognized as an exception (Repeating zero words would make no sense.)

The data will thus be x + 4 bytes longer, where x is the number of words in the uncompressed data with a high byte of $A7 or $A8 (Those looking like Carmack pointers.)

External links

Download Instant Carma

Carrmack Compression on the Modding Wiki