Animated Tiles

= About Animated Tiles = Animated tiles can be created for every tileset, and there is no limit on how many are used. A tileset with 256 animated tiles is perfectly possible (16 rows x 16 columns). Several animated tiles are utilized by Nintendo, most famous are the Brick Block, Question Block and Coin Outline in Pa0_jyotyu.arc. Please note that the ordinary Coin and the Donut Lift pull their animation from sprites instead of tiles and cannot be edited with the methods described here. Several other tilesets exist that have animated tiles, and the Newer team added even more.

Dimensions
A single image has the dimensions of 32 x 32px. This entity is also referred to as a "Frame". A frame needs to be setup in a very specific way, please see ################### The entire image, also called "Framesheet", consists of all the frames. The frame images are placed on-top of each other. The resulting framesheet is therefore always 32px wide, and [(frame count) x 32px] tall. An example: A framesheet consisting of 8 frames is 32px wide and 8 x 32px = 256px tall.

Other Specifications

 * At least 256 frame steps can be used.
 * The framesheet needs to be encoded to the format RGB5A3 and needs to be put inside a Wii Image Container (.tpl), with the header stripped. Please see ##############################
 * A "Framedelay" can be set. This determines, how long each frame is visible. Framedelays for well-known block types can be found #################################
 * Animated Tiles can utilize tiles from all four available tilesets.

Structure of a Tileset
Open Pa0_jyotyu.arc and extract block_anime.bin. Open the bin in a hex editor. Insert the brick block header below at the beginning of the file. Then save and close.

00 20 AF 30 00 00 00 01 00 00 00 0C 00 00 00 14

00 00 00 00 00 80 00 20 00 00 00 05 00 00 00 40

00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Rename it to "block_anime.tpl" and open it in Brawlbox. Export the image, and edit it

Dimensions of the images used in tile animations are 32 by 32px per frame!

The width of the framesheet is always 32px.

The general formula for the height of the framesheet is [(frame count) x 32]

So, if we've got 4 frames in the animation, then the dimensions of the image would be 32 x 128px.

Also, the box of each animation frame is 32 x 32px. But only the center of the box

is read by the game. The center is 24 x 24px.

Once you're done with the tileset animation, replace the image of block_anime.tpl and save.

Drag the tpl on tplrem.py to remove the header.

Rename the tpl to "Anything_That's_Not_In_AnimTiles".bin

(For example, danster_anim.bin)

Now open your custom tileset in SZS Explorer.

Add the bin file in the "BG_tex" folder. Save and quit.

These are some tpl headers you can use for some stuff:

Brick Block header (4 images, 32x128)

00 20 AF 30 00 00 00 01 00 00 00 0C 00 00 00 14

00 00 00 00 00 80 00 20 00 00 00 05 00 00 00 40

00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Question Block header (16 images, 32x512)

00 20 AF 30 00 00 00 01 00 00 00 0C 00 00 00 14

00 00 00 00 02 00 00 20 00 00 00 05 00 00 00 40

00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Coin Outline header (8 images, 32x256)

00 20 AF 30 00 00 00 01 00 00 00 0C 00 00 00 14

00 00 00 00 01 00 00 20 00 00 00 05 00 00 00 40

00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Okay, open the animtiles.txt

Copy the example below, paste it at the end of the txt file, and edit it:

texname = REEEE.bin

framedelays = 4, 4, 4, 4

tilenum = 0x123

tileset = 0

end tile

texname: The name of the bin file.

framedelays: The number of frame delay between each... frame.

tilenum: The tileset number, the row of the tile, and the column of the tile.

In the example, 0x123 means [Pa0; row 3; column 4]

It's a Pa0 tileset

By the way, each tileset has 16 rows (0-F) and 16 columns (0-F)

This is how tilenum works in Hex, anyways.

tileset: The Pa slot the tileset is part of. (Pa0 = 0, Pa1 = 1, etc)

The maximum amount of frames an animation can take it 255 or 256.

When you're done, save, and use the "txt to bin" bat file

Alright that's it

=====================================

Tileset Animation misc info/gibberish

=====================================

60 frames is probably 1 second

When doing tilenum in hexadecimal, make sure to add 0x to begin it

You can also use integers, but, like, don't

(According to CLF78 and Zementblock) Here are some animation values:

Brick Blocks = 50, 6, 6, 6

Question Blocks = 3 framedelays each

tileset = 1 is equivalent to Pa1

tilenum = 0x234       [tileset 2; row 3; column 4]

tilenum = location on tileset

0x100 = Row 0, Column 0

0x101 = Row 0, Columnn 1

0x110 = Row 1, Column 0

0x111 = Row 1, Column 1

etc

Further reference: https://horizonwii.github.io/horizonwii.net/index9053.html?page=thread&id=196