top of page

Tileset Animations

2.7

Description Loading...

HMA Discord Link 2.png

Credits:

Haven (Original Tutorial)

BroTacos (Rewritten for more current versions of HMA with more detail)


This feature is still in beta and is currently only available for FireRed 1.0

There are some issues with the feature that I found that should be made known before beginning. Some of them are manageable and some might be a deal breaker for you depending on what you are doing.

  • when using an animation from the tool a secondary tileset, leaving the default primary tileset animation alone, the new animation works fine but seems to disable the primary tileset animation. there are instances of both tilesets having animations in the vanilla game that function normally, ember spa being the one i tested with

  • using an animation from the tool on both the primary and secondary tilesets it only plays the animation on the secondary

  • having null entries in the animation table makes some super odd visual bugs

  • i seem to have to play around with adding data when creating the animation frame to get it to create a 4 tile frame, it likes to default back to 1 tile

  • adding a new entry to the animations table duplicates the previous entry, much like any other table. however there is no option to repoint the new one. i have to delete the address in the table and add new data to create a unique table entry See this bug report for details

Always make a backup before making changes!

Original Wiki Tutorial by Haven Here

FireRed and Ruby/Sapphire Animated Tile Frames

Info

What does the "Add Tileset Animation" button do?

When you click the button, HexManiacAdvance will insert 3 new things into your rom:

  • A table that stores the animations for your tileset in an easy-to-edit and easy-to-expand format.

  • A callback routine that uses the table to update the tileset during gameplay.

  • A initialization routine that you can use to connect your new animations to your tileset using the animation initialization pointer we mentioned before.

Step 1

Click the Utilities menu -> Expand - > Add Tileset Animation

You will get a pop-up, click Run

Step 2

Choose a name for your new animation.

For this example, my animation will be named "test"

HMA will automatically take you to your new table which will be named

graphics.maps.tilesets.animations.(name chosen in Step 2).table

This table will host the information about how you want your tileset to animate

Here's a brief summary of what each field does:

  • animations -> this pointer leads to N other pointers, one for each frame of your animation. For example, if you want your water to cycle through 4 tiles, then you want 4 frames, so animations will point to 4 pointers, and each of those pointers will point to your tiles. It's less confusing than it sounds.

  • frames -> this is the number of frames in your animation. A larger number means that the animation will use more images before restarting the cycle.

  • timer -> this decides how quickly your animation will run. The tick-rate will be 2^n. For example, if you pick '3', then your animation will update every 8 ticks of game time, or about 8 times per second. If you pick '4', then your animation will update every 16 ticks of the game, or about 4 times per second.

  • tiles -> the number of tiles that you want to animate. For example, flowers are usually 2x2 tiles, which means 4 tiles total. So a flower animation would have 4 tiles per frame.

  • tileOffset -> the index of the first tile you want the animation to replace.

Step 3

Edit the table based on the animation you want

Then click Create new data for each frame

For this example, I'll be making another flower animation.

The animation will use 4 tiles and have 4 frames updating every 16 ticks. The tiles for this animation will be in the secondary tileset starting at tile 706. Since the animation uses 4 tiles, tileOffset 706, 707, 708, and 709 will be used. NOTE: You might have to have to play around with adding data when creating the animation frame to get it to create a 4 tile frame, it likes to default back to 1 tile

To locate the tile number (tileOffset):

In HMA version 0.6.1 and later:

Haven made the tile number viewable in version 0.6.1

Open the tile viewer window and select the tiles you wish to use. The tile number will be shown in the tile preview next to "Selected Tile:"


In HMA version 0.6.0 and earlier:

You will have to manually count the tiles to find the correct number. The following equation and example should help you find that number a little easier without having to count each individual tile.

16r - 1 will give you the number of the last tile in the row. You can count back from there to find the number for the tile you will be using. 16 being the total number of tiles per row

r being the row number

-1 because the tile ID starts at 0, not 1


For my example at tile 706, the tiles i want to use are in row 45. 16 x 45 = 720

720 - 1 = 719

719 is the last tile in the row, I can count back from there to find the number for the first tile I intend to use


NOTE: The tiles used must be all adjacent to each other. The top left tile of the block will be the first tile, top right tile will be the second, bottom left the third, bottom right the forth. See the vanilla flower tiles as an example.

NOTE: While you you are here you might want to create the tiles that are viewable on the map in the map editor, this does not seem to be required but it might be hard to identify the tiles later on as they will just appear as blank tiles. They will also just show up on the map as empty blocks.

Step 4

Now you'll want to get the palette address for the tileset you are adding the animation to.

Go to a map using the tileset you want to add the animation to.

Click Edit Map Header

Click View Table in Data Tab

This will bring up the data table for the map, This view should have all the information we need to proceed

We want to look at the tileset information, the primary is in the second box (red) and secondary in the third box (yellow)

Right now we want the offset listed in the "pal" field, copy that offset

For my example I am adding the animation to my secondary tileset in Pallet Town. The "pal" offset being 26D7C0

Step 5

Go back to your animation table at

graphics.maps.tilesets.animations.(animationname).table

Double click the animation pointer (yellow) or click the arrow at the end of the animation field (red) to view the animation data

Double click the frame pointer (yellow) or click the arrow at the end of the frame field (red) to view the frame data

Paste the palette offset into the "Palette Address:" field

You will only have to do this once per animation

Step 6

Click the "back" arrow to go back to the animation frames

From here we can start to add in our animation frames

For each of the frames, click Edit to draw in the animation frame

When editing the frame, you will need to select the palette slot from the dots on the top left

NOTE: Remember palette slot 0-6 are for the primary tileset, 7-12 is for the secondary tileset


Step 7

When you are finished editing your animation frames, go back to the map data table (Step 4)

Go into the layout data

Now go into the tileset data for the tileset you are adding the animation to Primary (red) or Secondary (yellow)

The second to last field is the animations. If there is an pointer here the tileset already has an animation If it says <null> there is no animation on this tileset

Select the animation field and type graphics.maps.tilesets.(your animation name).init


And your done! Keep in mind some of the bugs with the tool mentioned at the beginning of this guide and enjoy!

If you want to animate multiple tiles, you can use the "Add 1 New" button in the animation table to add more animations for the same tileset. NOTE: Having <null> entries in the table will break things and cause graphical bugs

NOTE: Adding a new entry to the table duplicates the previous but does not give you an option to repoint. Deleting the address from the table and clicking add new data will give you a new unique entry



Happy Hacking!

 


bottom of page