Welcome to my battle screen tutorial. Here I will teach you both how to make battle screens that are insertable and how to actually insert them into your ROM.
Things you will need:
For Buildfile users:
A hex editor (I reccomend HxD)
Making your battle screen
First, you should know the standard layout for battle screens. It looks something like this.
The blue plates are where the character names will go. The red plates are where the item names will go. The green plates are where the HP bars will go, and the purple plates are where the ATK/HIT/CRIT will go. You may notice the image is 256px wide, but the GBA screen is only 240px wide - there are two reasons for the extra length (highlighted here in yellow). The first is that it will become visible during screenshake. The second is that there is also a solo version of the battle screen where the bottom right area is centered, and thus visible.
Of most significance are the name and item name plates. This is because these both use their own unique tilesheet. What is a tilesheet? Well, it’s a collection of tiles. The GBA renders images using 8x8 tiles, and our tilesheets will have to contain every unique tile we use for our battle screen. This limits the amount of unique tiles we can use, of course, so you will want to try and reuse tiles while creating your screen. I highly recommend using usenti and enabling the tile grid in the view menu (and setting it to 8x8 tiles).
Now, when rendering our image, we will use TSA, or Tile to Screen Arrangement. More on this later, but the important bit is that TSA can flip images horizontally or vertically. This means every tile you use is actually 4 tiles - the original tile, the horizontally flipped version, the vertical flip, and the horizontal + vertical flip. In other words, if we take a tile and modify it in one of those 4 ways, we won’t need to add it to the tilesheet again.
As stated previously, the name and item plates use their own seperate tilesheets, so that just leaves our main tilesheet. This means that this sheet will have to contain every other tile that is used in the battle screen. So how many tiles do you have to work with? 68 tiles, including one tile for blank space. I highly recommend keeping track of how many tiles you are using and trying to work with patterns that allow you to reuse tiles.
The second thing to remember is the palette. You can use 16 colors as with most palettes. However, there are some things to keep in mind. The 0th color is, as with all palettes, transparent. The 1th - 3th colors are used for the item and character name text. Typically, they are gray, white and dark brown (outline). You can change them if you would like, but keep in mind they will also be used for the text. Lastly, the faction palettes. You will want your image to have 4 consecutive palettes, or 64 colors. Each palette will be used for one of the 4 factions. In order, they are ally (blue), enemy (red), NPC (green) and gray. You can use 16 color mode on usenti to preview how your battle screen will look with each palette.
Making your tilesheets
First, the item and name plates. These are the simplest since they have their own sheets and are 1 to 1. Refer to the previous image of the battle screen layout for the positioning of the tiles. You will copy each tile to a long sheet one tile high (or 8px). Start with the topleftmost tile, then the bottomleftmost tile, then the next column, and so on. The item plates will be 16px (or 2 tiles) longer since they are 2 tiles larger.
Now, the more difficult main tilesheet. Start with a blank 136x32 image. Leave the topleftmost tile blank. Then, take a copy of your battle screen, preferably with the name and item plate areas removed. For each unique tile (remember that flipping is NOT unique), copy it to the tilesheet. Continue until you have every unique tile. Don’t worry if you might have forgotten one - you can always add it in later.
Constructing your battle screen with TSA
Now that we have our tilesheets, we will have to tell the game how to consturct them back into our battle screen. Open FEBuilder and head to the battle screen editor. From there you can import images for each of the tilesheets. Go ahead and do so for your tilesheets. You may notice that the preview looks like a buggy mess aside from the name and item plates. Take your empty tile and erase all the mess around the plates. To your left is the tile selector. You may notice every tile from your main sheet has its own row with 8 columns. The first 4 will be each of the rotations as mentioned previously. The second will be the same thing but using the opposite side’s palette.
Go ahead and use the GUI to reconstruct your battle screen. Make sure not to overwrite the name and item plates or else the text won’t display properly! Once you’re done, simply write to ROM and boom! You now have a functioning battle screen.
During this part you may notice that you forgot to add some tiles to your main sheet. Fret not! Simply add them in and reimport the main sheet. Don’t worry about messing up your progress - as long as you don’t move your old tiles around, it will remain the same.
If you remember previously I also mentioned a solo version of the battle screen. Head to the patch menu in FEBuilder and search for “TSA” and you should find the editor. You may notice the image has a hole in the middle. This is where the item name will go. As before, don’t overwrite it, or the text won’t display properly!
If you are using FEBuilder, congratulations! You now have inserted your new battlescreen.
If you are using Buildfiles, we’ve got a couple extra steps ahead.
Creating an EA installer
For our installer, we will need 3 things - the tilesheets, the palette and the TSA. For the first 2, we should already have them from creating the battle screen in the first place. The tilesheets need to be compressed, so don’t forget to use --lz77, or to run Png2Dmp with compression, depending on your method. The palette, as stated before, needs to have all 4 faction palettes included. This should bring the total length (in bytes) of the palette dmp up to 128.
That just leaves our TSA. There are 6 TSAs used for the battle screen - TSAs 1 to 5 are used on the regular screen, and the solo screen has an extra TSA. Below I will list the locations of the TSA pointers and the TSA’s lengths (in decimal). After saving your ROM with the battle screen, open it in your hex editor. Go to each pointer’s address, grab the pointer there, depointerize it, and go to the address. From there, copy a block with the specified length to a new file and save. You will do this 6 times (once for each TSA).
Now that you have all the pieces, simply include them with labels and point to them at the pointer locations in the list below. Don’t forget to ALIGN 4 before your labels.
Feel free to reference my own installer here.
// Main Tiles - pointer at 51F68 // Left Name Tiles - pointer at 51FC8 // Right Name Tiles - pointer at 52088 // Left Weapon Tiles - pointer at 52028 // Right Weapon Tiles - pointer at 52164 // Palette - pointer at 52178 // TSA1 - pointer at 51CBC // length 180 // TSA2 - pointer at 51CC0 // length 540 // TSA3 - pointer at 51378 // length 210 // TSA4 - pointer at 51380 // length 224 // TSA5 - pointer at 52170 // length 80 // TSA Single - pointer at 5141C // length 224
And that’s all! Feel free to leave any questions or comments below.