You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Note: The tile structures are compressed with zlib in the CMP format - it must be inflated!
shortwidth (2 bytes) # width of themap (in tiles)short height (2 bytes) # height of themap (in tiles)tile[width * height] tiles (width * height *4 bytes) # list of tilestructures (zlib compressed)typedef struct {shortabTileId (2 bytes) # ground tile frameindex (Tile/Tbl)shortpassableTile (2 bytes) # passable tile flagshortsObjTileId (2 bytes) #static objectindex (TileC/SObjTbl)} tile (6 bytes)
DAT
intfile_count (4 bytes) # file count +1 (decrementfor file count)file[file_count] files ((file_count * file_size) bytes) # list of file structuresbyte[] file_data # binary data of allfiles (head-to-tail)typedef struct {intdata_location (4 bytes) # index of'file_data'for the start ofthis file byte[13]file_name (13 bytes) # the filename (UTF-8 padded -13 bytes) } file (17 + size bytes)
DNA
intmob_count (4 bytes) # number of mobs in filemob[mob_count] mobs (mob_count * mob_size bytes) # list of mob structurestypedefstruct {intframe_index (4 bytes) # frame index of mob bytechunk_count (1 byte) # number of chunks in mob byteunknown1 (1 byte) # unknown id/flag (1)shortpalette_index (2 bytes) # palette index of mob chunk[chunk_count] chunks (chunk_count * chunk_size bytes) # list of chunk structures} mob (8 + (chunk_count * chunk_size) bytes)typedefstruct {shortblock_count (2 bytes) # block count of chunk block[block_count] blocks (block_count * block_size bytes) # list of block structures} chunk (2 + (block_count * block_size) bytes)typedefstruct {shortframe_offset (2 bytes) # offset from frame_index in chunkshortduration (2 bytes) # amount of time to play the frameshortunknownId1 (2 bytes) # normally -1, only has real values in death animationsfor2 mobs bytetransparency (1 bytes) # transparency byteunknownId2 (1 byte) # unknown id/flag (5) byteunknownId3 (1 byte) # unknown id/flag (5)} block (9 bytes)
DSC
byte[15] header (15 bytes) # PartDescription (literal)byte[7] null (7 bytes) # unknown nullbytes (1)byte unknown1 (1 byte) # unknown id/flag (2)intpart_count (4 bytes) # number of partspart[part_count] parts (part_count * part_size bytes) # list of part structurestypedefstruct {intid (4 bytes) # id of the partintpalette_id (4 bytes) # palette index of the partintframe_index (4 bytes) # first frame index of the partintframe_count (4 bytes) # number of sequential frames after frame_index byteunknown2 (1 byte) # unknown id/flag (3)intunknown3 (4 bytes) # unknown id/flag (4) byteunknown4 (1 byte) # unknown id/flag (5)intunknown5 (4 bytes) # unknown id/flag (6)intunknown6 (4 bytes) # unknown id/flag (7)intchunk_count (4 bytes) # number of chunks chunk[chunk_count] chunks (chunk_count * chunk_size bytes) # list of chunk structures} part (34 + (chunk_count * chunk_size) bytes)typedefstruct {intid (4 bytes) # id of the chunkintunknown (4 bytes) # unknown id/flag (1)intblock_count (4 bytes) # number of blocks block[block_count] blocks (block_count * block_size bytes) # list of block structures} chunk (12 + (block_count * block_size) bytes)typedefstruct { byteid (1 byte) # id of the blockintnull (4 bytes) # unknown id/flag (1)intunknown (4 bytes) # unknown id/flag (2)} block (9 bytes)
EPF
shortframe_count (2 bytes) # number of frames in the EPFshortheight (2 bytes) # height of theEPF (?)short width (2 bytes) # width of theEPF (?)short unknown (2 bytes) # unknown id/flag (1)intpixel_data_length (4 bytes) # length of the pixel databyte[pixel_data_length] pixel_data (pixel_data_length bytes) # list of pixel data bytesframe[frame_count] frames (frame_count * frame_size bytes) # list of frame structurestypedefstruct {shorttop (2 bytes) # top offset of theframe (in pixels) short left (2 bytes) # left offset of theframe (in pixels) short bottom (2 bytes) # bottom offset of theframe (in pixels) short right (2 bytes) # right offset of theframe (in pixels) int pixel_data_offset (4 bytes) # index of'pixel_data'for the start ofthis frame's pixel data int stencil_data_offset (4 bytes) # index of'pixel_data' for the start of this frame's stencil data} frame (16 bytes)
FRM
inteffect_count (4 bytes) # number of effects in FRMint[effect_count] palette_index (effect_count *4 bytes) # list of palette indiciesfor effects
MAP
shortwidth (2 bytes) # width of themap (in tiles)short height (2 bytes) # height of themap (in tiles)tile[width*height] tiles (width * height *4 bytes) # list of tile structurestypedefstruct {shortab_tile_id (2 bytes) # ground tile frameindex (Tile/Tbl) short sobj_tile_id (2 bytes) #static objectindex (TileC/SObjTbl)} tile (4 bytes)
PAL (Single)
byte[9] header (9 bytes) # DLPalette # DLPalette (literal)byte[15] unknown (15 bytes) # unknownbytes (1)byte animation_color_count (1 byte) # number of animation colorsbyte[7] unknown2 (7 bytes) # unknownbytes (2)short[animation_color_count] (animation_color_count *2 bytes) # list of animationcolors (short)color[256] palette (1024 bytes) # list of color structurestypedefstruct { bytered (1 byte) # red valuefor color bytegreen (1 byte) # green valuefor color bytered (1 byte) # red valuefor color bytealpha (1 byte) # alpha valuefor color} color (4 bytes)
PAL (Packed)
int palette_count # number of palettes in filePAL[palette_count] palettes # list of PAL structurestypedefstruct { byte[9] header (9 bytes) # DLPalette (literal) byte[15] unknown (15 bytes) # unknownbytes (1) byte animation_color_count (1 byte) # number of animation colors byte[7] unknown2 (7 bytes) # unknownbytes (2) short[animation_color_count] (animation_color_count *2 bytes) # list of animationcolors (short) color[256] palette (1024 bytes) # list of color structurestypedefstruct { bytered (1 byte) # blue valuefor color bytegreen (1 byte) # green valuefor color byteblue (1 byte) # red valuefor color bytealpha (1 byte) # alpha valuefor color } color (4 bytes)} PAL
TBL (Effects)
int effectcount (4 bytes) # number of effects in TBLeffect [effect_count] effects # list of effect structurestypedefstruct {inteffect_index (4 bytes) # effect indexint framecount (4 bytes) # number of sequential frames after effect_index byte[20] unknown # unknownbytes (1) frame [frame_count] frames # list of frame structurestypedefstruct {int frameindex (4 bytes) # start frame indexfor effectint framedelay (4 bytes) # delay until nextframe (milliseconds)int pallete number (4 bytes) # palette index to use when rendererbyte[4] unknown (4 bytes) # unknownbytes (1) }} effect
TBL (Motion)
stringheader (21 bytes) # MotionStandard (literal)byte[2] unknown (2 bytes) # unknown nullbytes (i.e., [00,01])int motion_count (4 bytes) # number of motionsmotion[motion_count] motions (motion_count * motion_size bytes) # list of motion structures # motion_size =33 + (frame_count *122 bytes)typedefstruct {intid (4 bytes) # id of the motion stringname (21 bytes) # name ofmotion (i.e.,"SwingEast") int unknown_int (4 bytes) # unknownint (i.e., [FF, FF, FF, FF]) int frame_count (4 bytes) # number of frames in the motiontypedefstruct { (frame_count *122 bytes)shortunknown_short (2 bytes) # unknownshort (i.e., [FF, FF]) int[30] layer_ids (120 bytes) # list of layer ids describing z-order, read until first -1int (i.e., [FF, FF, FF, FF])} # then can skip to end ofstruct (122 bytes)
TBL (Static Objects)
intobject_count (4 bytes) # number of objects in SObj TBLshortunknown (2 bytes) # unknownshortobject[object_count] (obj_count * obj_size bytes) # list of object structurestypedefstruct {intunknown (4 bytes) # unknownbyte (typically0xFFFFFFFF) byte unknown (1 byte) # unknownbyte (typically0x00) byte movement_directions (1 byte) # movement directionsforstaticobject (see list below) byte tile_count (1 byte) # number of tiles instatic objectshort[tile_count] (tile_count *2 bytes) # list of tile indiciesforstatic object} object
Note: Movement Directions appear to have 6 states:
0x00 (Empty)
0x01 (Bottom)
0x02 (Top)
0x04 (Left)
0x08 (Right)
0x0F (Full)
TBL (Tiles)
inttile_count (4 bytes) # number of tiles in TBLtile[tile_count] tiles (tile_count *2 bytes) # list of tile structurestypedefstruct {shortpalette_index (1 byte) # palette indexfortile (masked) } tile (2 bytes)
Contributors
Huge thank you to everyone who helps figure out NTK file structures: