Level Format (NSMBU)

From NSMB2/U Modding Wiki
Jump to: navigation, search

As usual, the level format in NSMBU is severely identical to its predecessors. Each section in the file have been labeled as blocks, so in NSMBU, there are 15 blocks total. This number may be confusing because blocks have been documented and they usually start at 0, so starting at block 0 is usually how it is documented.


Header[edit]

The header of the file will always be 0x78 bytes long. Each entry is 0x04 bytes long.

Offset Size Description
0x00 0x04 Block 0 offset.
0x04 0x04 Block 0 size.
0x08 0x04 Block 1 offset.
0x0C 0x04 Block 1 size.
0x10 0x04 Block 2 offset.
0x14 0x04 Block 2 size.
0x18 0x04 Block 3 offset.
0x1C 0x04 Block 3 size.
0x20 0x04 Block 4 offset.
0x24 0x04 Block 4 size.
0x28 0x04 Block 5 offset.
0x2C 0x04 Block 5 size.
0x30 0x04 Block 6 offset.
0x34 0x04 Block 6 size.
0x38 0x04 Block 7 offset.
0x3C 0x04 Block 7 size.
0x40 0x04 Block 8 offset.
0x44 0x04 Block 8 size.
0x48 0x04 Block 9 offset.
0x4C 0x04 Block 9 size.
0x50 0x04 Block 10 offset.
0x54 0x04 Block 10 size.
0x58 0x04 Block 11 offset.
0x5C 0x04 Block 11 size.
0x60 0x04 Block 12 offset.
0x64 0x04 Block 12 size.
0x68 0x04 Block 13 offset.
0x6C 0x04 Block 13 size.
0x70 0x04 Block 14 offset.
0x74 0x04 Block 14 size.
0x78 End of header.

Block 0[edit]

Block 0 contains information on which tileset file to load for the area. There are 4 slots available with 0x20 bytes for each entry, so this section will always be 0x80 bytes long. Any entry that is not used is filled with 0x00 and ignored by the game.

Offset Size Description
0x00 0x20 Tileset 1 slot name.
0x20 0x20 Tileset 2 slot name.
0x40 0x20 Tileset 3 slot name.
0x60 0x20 Tileset 4 slot name.
0x80 End of block.

Block 1[edit]

Block 1 deals with area settings, and will be 0x18 bytes long. The numbers in [] represent what values are used. Be reminded that the padding is simply implied, due to the value always being 0.

Offset Size Description
0x00 0x02 Padding
0x02 0x01 Unknown. [0, 14]
0x03 0x01 Unknown. [0, 1, 3, 5]
0x04 0x05 Padding.
0x09 0x01 Warp Across Edges setting (as well as another setting)
0x0A 0x02 Time Limit 1.
0x0C 0x01 Padding.
0x0D 0x01 Unknown. [0, 100]
0x0E 0x01 Unknown. [0, 100]
0x0F 0x01 Unknown. [0, 100]
0x10 0x01 Unknown. [0, 1, 2, 3, 5, 6, 8, 9, 11, 12, 13]
0x11 0x02 Padding.
0x13 0x01 Unknown. [0, 10]
0x14 0x02 Time Limit 2. Used after you touch the first midway flag. Otherwise, 0.
0x16 0x02 Time Limit 3. Used after you touch the second midway flag. Otherwise, 0.
0x18 End of block.

Block 2[edit]

Block 2 contains information about zone boundings. It is possible for this section to contain more than one entry. Each entry is 0x1C bytes long.

Offset Size Description
0x00 0x04 Upper Bound
0x04 0x04 Lower Bound
0x08 0x04 Unknown Upper Bound
0x0C 0x04 Unknown Lower Bound
0x10 0x02 Bounding ID
0x12 0x02 Unknown. [0, 0xF]
0x14 0x08 Padding.
0x1C End of block.

Block 3[edit]

Block 3 contains unknown information. Sometimes this section can contain 2 entries. The size of each entry is 0x08 bytes long.

Offset Size Description
0x00 0x02 Padding
0x02 0x02 Unknown. [0, 2]
0x04 0x02 Unknown. [0, 2]
0x06 0x02 Unknown. [0, 2, 66]
0x08 End of block.

Block 4[edit]

Block 4 contains information about the background. It includes IDs, the background name, and other unknown attributes. The structure is 0x1C bytes long.

Offset Size Description
0x00 0x02 Background Block ID.
0x02 0x01 Padding.
0x03 0x01 Unknown.
0x04 0x04 Padding.
0x08 0x0F Background name.
0x18 0x02 Unknown.
0x1A 0x02 Padding.
0x1C End of block.

Block 5[edit]

This section appears to be unused. It seems to be 0xA bytes long, but it may vary.

Offset Size Description
0x00 0x01 Padding.
0x01 0x01 Unknown.
0x02 0x01 Unknown.
0x03 0x01 Unknown.
0x04 0x01 Unknown.
0x05 0x01 Unknown.
0x06 0x02 Padding.
0x08 0x01 Unknown.
0x09 0x01 Padding.
0x0A End of block.

Block 6[edit]

Block 6 contains the information for entrances. The structure is 0x18 bytes long.

Offset Size Description
0x00 0x02 X Position.
0x02 0x02 Y Position.
0x04 0x01 Padding.
0x05 0x01 Unknown. [0, 100]
0x06 0x02 Padding.
0x08 0x01 Entrance ID.
0x09 0x01 Destination Area ID.
0x0A 0x01 Destination Entrance ID.
0x0B 0x01 Entrance / Exit Type.
0x0C 0x01 Unknown. [0, 3, 5, 10, 12, 15]
0x0D 0x01 Associated Zone ID.
0x0E 0x01 Padding.
0x0F 0x01 Unknown. [0, 1, 2]
0x10 0x01 Padding.
0x11 0x01 Settings. Can have two masks: 0x80 = Not Enterable, 0x01 = Unknown
0x12 0x01 Unknown. [0, 1, 2, 3, 4, 5, 6, 7, 10, 11]
0x13 0x01 Unknown. [0, 1, 2, 3, 4, 5, 6, 7, 21]
0x14 0x01 Unknown. [0, 3, 5, 6]
0x15 0x01 Unknown. [0, 2, 5]
0x16 0x01 Unknown. [0, 3, 5, 7, 8, 10]
0x17 0x01 Padding.
0x18 End of block.

Block 7[edit]

Block 7 contains information for sprite placement and functionality. It's size is 0x18 bytes.

Offset Size Description
0x00 0x02 Sprite ID.
0x02 0x02 X Position.
0x04 0x02 Y Position.
0x06 0x0A Sprite Data.
0x10 0x01 Zone ID.
0x11 0x01 Layer?
0x12 0x03 Sprite Data.
0x15 0x03 Padding.
0x18 End of block.