Tiles and Objects (Puzzle)

Puzzle Tileset Editor can be used to set various attributes on tiles. These include setting the Properties and the Core Type (collision data). Most of these properties can be changed from within Puzzle, but unfortunately not all of them. It's for example not possible to give an object the item from a specific ?-block. Such edits have to be done by HEX-editing files from the tileset directly.

= Changing Attributes (Behaviors, Properties and Collision Data) for Tiles and Objects = Please see the Puzzle Tileset Editor documentation, to learn how to set available attributes on tiles.

Attributes for objects on the other hand cannot be modified at all from within Puzzle. To set attributes on objects, a file from the tileset needs to be modified with a HEX-Editor.

Step 1: Extracting the required Files from a Tileset
Start BrawlBox, then open the tileset you want to modify. Now, extract two files from the tileset.

From the folder BG_chk: , for example: And from the folder BG_unk: , for example Save them in a folder so that you can find and modify them. Keep BrawlBox open because we need to replace the modified files later.

Step 2: Understanding the Purpose and Structure of the extracted Files
The file d_bgchk_TILESETNAME.bin in BG_chk is used to store the attributes for tiles. The file TILESETNAME.bin in BG_unk is used to store the attributes for objects.

Structure of d_bgchk_TILESETNAME.bin (Tiles)
This file contains all the attributes that can be set on tiles, such as behaviors and collision data. Each tile utilizes 8 bytes of data, starting from the very beginning of the file. Each byte can set one attribute from a list of available behaviors or Core Types. The data for each tile is identical to what is shown in Puzzle under "HEX-Data". Thanks to the Newer Team and Tempus, the values for those 8 bytes are mainly known. The full lists can be seen here on the same page.

Structure of TILESETNAME.bin (Objects)
This file contains all the attributes that can be set on objects, such as tile/slope properties, tilenumber, and tile attributes. The full lists can be found here on this page. Each object utilizes 3 bytes of data for objects with normal tiles, and more bytes for objects with sloped tiles. The first object starts from the very beginning of the file. The linefeed for objects and sub-blocks of slopes is  in the HEX-Code, while the end of each object is denoted with   in HEX.

Each byte can set one attribute from a list of available behaviors or slope properties.

All used values of BG_chk
Jump to BG_unk (Objects)

Byte 0: (missing 0x1, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80)

Byte 1: (missing 0x4, 0x20, 0x40, 0x80)

Byte 2: (missing 0x1, 0x2, 0x20)

Byte 3: (missing 0x80)

Byte 4:

Byte 5:

Byte 6:

Byte 7:    (No Flag - mostly Rails)

Byte 7:    (Climable Grid Flag)

Byte 7:    (Coin Flag)

Byte 7:    (Explodable Block Flag)

Byte 7:    (Pipe Flag)

Byte 7:    (Question Block Flag)

Byte 7:    (Partial Solids)

Byte 7:    (Slope Flag)

Byte 7:    (Spike Flag) {| class="wikitable"

Byte 7:    (Conveyor Belt Flag)

All used values of BG_unk
Jump to BG_chk (Tiles)

Upperslope:

Possible bits - 0x80 (slope flag), 0x10, 0x02, 0x01

Lowerslope:

Possible bits - 0x80 (slope flag), 0x04

First Byte:

Second Byte: Denotes the tilenumber used for the object.

Last Byte:

Possible bits - 0x01, 0x02, 0x04, 0x08, 0x10, 0x20

Step 3: Setting custom Attributes on Objects
Please note: Those attributes can only be used on tiles with behaviour set to "Question Block" or "Invisible Question Block".

To do that, locate the HEX code for the tile you want to change (in d_bgchk_TILESETNAME.bin), then change byte 3 to 0x4 (Invisible Question Block) or 0x5 (Question Block). Other tile types don't seem to work, but not all combinations were tested.

Now back to the objects: The two bottom bits from byte 3 are the tileset slot. That's also the reason why the values for byte 3 are multiplied by 4 (0x0 = Inherit, 0x4 = Fire, 0x8 = Star, 0xC = Coin, 0x10 = Vine etc). This causes the result to "bitshift" to the left, so that the last 2 bits can be used for the tileset slot. Please note that the tileset slot should always be the same for the entire tileset. Pa0 = 0, Pa1 = 1 etc. For clarity, we've marked the bits for byte 3 in binary notation:, where XX = Unknown (tested and no visible change), VVVV = Value, and TT = tileset slot. After modifying the files, save them and put them back in your tileset with BrawBox, save the tileset and you're done. Pro Tip:


 * Create 12 identical objects from the tile you want to assign Power-Ups to.
 * Give that tile the property "Question Block" or "Invisible Question Block" by HEX-editing your d_bgchk_TILESETNAME.bin file.
 * Assign the 12 available Power-Ups to your newly created objects, by HEX-editing your TILESETNAME.bin file, as shown above.
 * Save the HEX-edited files, put them back (replace) in BrawlBox, and save the tileset.