+==========================================================================================+ |Jazz Jackrabbit 3D Bonus map format: | +==========================================================================================+ Bonusmaps for Jazz Jackrabbit are stored in BONUSMAP.xxx files. Bonusmaps are 256x256 tiles wide/high, and wrap around the edge. If a road leads to the end of the map, the player is send to the other end of the map. (Though under some conditions the game will freeze and crash.) The level consists of several blocks, both compressed and uncompressed. Compression is Jazz Jackrabbit RLE compression. the level blocks are as follows: ------------------------------------------------------------------------------- FILE STRUCTURE: 0 134 Block0: Level header (Uncompressed) 134 2048 Block1: Animation sequences (Uncompressed) - Animations 2182 1024 Block2: Animation names (Uncompressed) 2694 ? Block3: Tile mapping ? ? Block4: Event properties ? ? Block5: Event mapping ? 198 Block6: Level properties (Uncompressed) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- Level header: 0 108 Lev compnts Level component files; no longer used. Each consists of a name length byte followed by 8 bytes of name, padded with nulls. There are 12 names 108 13 Tileset Tileset used in level, the extension '.LBM' may be seen and is part of the name, but isn't actually looked for. This name and the next follow the same format as the previous ones, but are longer (13 chars) 121 13 Music Name of music file used in level, extension IS looked for. ------------------------------------------------------------------------------- This controls the animations in a level. A level is presented with 256 sprites (51 containing data) in an 'array' from the BONUS.000 file. These are then used in 32 64-byte animation sequences for the level, making this section 2048 bytes long. Animation sequences have the same format as in normal Jazz levels, but with less actually used. ------------------------------------------------------------------------------- Animation sequences: 0 64 Anim Animation entry 64 64 Anim... ------------------------------------------------ Animation entries: 0 2 Spawn x,y Spawn x,y position in pixels, not used 2 1 Acc anim Accessory animation, not used 3 2 Acc x,y Accessory x,y position, not used 5 1 Blank 6 1 Frame no Number of frames in animation 7 19 Frames Animation frames in animation, 19 1-byte entries padded with nulls 26 19 h mov The movement, in pixels, horizontally of EACH INDIVIDUAL image in the animation loop. This allows images of different widths to move smoothly, or for the same image to move about as if it was several. 45 19 v mov Same as above, but vertical movement, more important too. ------------------------------------------------ ------------------------------------------------------------------------------- The next segment is the names of the animations above. 32, 16 byte entries for a total length of 512 bytes. These are not used by the game and are identical in format to the strings in the level header. (Length byte and name padded with nulls.) ------------------------------------------------------------------------------- Animation names: 0 16 Name Animation name 16 16 Name... ------------------------------------------------------------------------------- Tile mapping is the first compressed block in the level.Bonus levels are even larger than normal levels, 256x256 tiles, for a total uncompressed length of 65'536 bytes (1 byte per tile.) The level is stored column by column, rather than by row. ------------------------------------------------------------------------------- Compressed mapping: 0 2 Size Size of compressed rle block 2 x RLE block RLE block ------------------------------------------------------------------------------- 16 16-byte entries, one for each possible event in the level. This controls everything about an event. By default the standard events are 0, ignored, 1, time, 2, gem, 3, bounce-back, 4, hand, 5, exit 6, pole. ------------------------------------------------------------------------------- Compressed events: 0 2 Size Size of compressed rle block 2 x RLE block RLE block ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- Decompressed event entries: 0 5 ??? Odd an unused? 5 1 Anim seq Animation sequence used for event 6 1 Blank? 7 1 Type Event type (1, time, 2, gem, 5, pole-bounce 7, exit, 8, hand-bounce) 8 1 ? Some check either 0 or 1 9 1 ? Value 3 for all useful events 10 4 Blank 14 1 Sound Sound played when event touched 15 1 Blank ------------------------------------------------------------------------------- Event mapping: Unlike normal levels, events and tile mapping are separate. (Because combined they are larger than $FFFF) This is identical to the tile mapping block, but values here define what even is placed on the level. ------------------------------------------------------------------------------- Compressed mapping: 0 2 Size Size of compressed rle block 2 x RLE block RLE block ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- Level properties: 0 32 Snd pitch 16 sound's pitches, one for each sound in the level. Each of these entries is for a sound in the level, and defines how much a sound is squashed (Shortened and raised in pitch.) This lets Jazz use a single sound like several. For example the sound GODLIKE is used for the'got item' and 'got shield' sounds, the only difference being this value. 32 134 Snd name Name of sounds used in level, each name 9 bytes long including length byte 176 2 ? If this is not $FFFF then Jazz immediately exits and wins the bonus level 178 2 Gems Number of Gems Jazz must get to win only the first two digits are displayed in-level. (250 is thus '25') 180 2 Time Word giving the time Jazz has in the level, in seconds. Max is 9:59 (599 seconds) Anything above this results in the level displaying characters (E.g. A:59 for 11 minutes.) 182 2 Jazz x Jazz start x position 184 2 Jazz y Jazz start y position 186 12 Blank -------------------------------------------------------------------------------