the bipship :: keen utilities and more :: articles    


Design & Implementation
Copyright © 2008-2010
by Alan Faubert : CK Guy

· · ·

psychonauts purchased on gog.com finally - what took me so long

 

Bipship Articles

— Vorticons Level Format FUNCTIONAL, NEEDS TIDYING —

directly copy-pasted from a post of mine on K:M, it needs to be cleaned up

Okay, here is a brief run-down of the Keen Vorticons level format.

At the top level, we have a dword (four bytes) giving the length of the uncompressed data (in bytes), followed by the rle-compressed data. The rle algorithm used in the level files is pretty simple. A word of xFEFE means that the next two words are the length of the run, and the word the run consists of. Now, once we decompress that, we are left with a bunch of words. The format of this stream is:

- the level's height (in tiles) represented as a word
- the level's width (in tiles) represented as a word
- four words of nothing, when you read a map, you can ignore them, when you write a map, they can be zeros.
- the plane size (in bytes) [see below] as a word
- eight more meaningless words

Then comes the plane 0 data (tiles) and the plane 1 data (sprites). ***Both of these are padded out to the next 16-byte boundary, which also affects the 'plane size' given above*** So the plane size is 2*w*h, rounded up to the next multiple of 16.

I have not noticed any 'quirks' in Keen 1 vs. Keens 2 and 3...

This has been pretty much subsumed by the Modding Wiki. I don't really see a future for this section anymore.