There has been another general outcry for a tutorial on how to edit spell effects lately, so here we are once again. Hopefully this tutorial will answer a lot of the basic questions when it comes to effect editing. First and foremost, what will be covered herein:
- Extracting and Importing Effect Files to and from your ISO.
- Modifying effect palettes. [Fancy way of saying changing the colors of spells.]
- Removing unwanted parts of effects.
- Replacing parts of effects with something new.
And a short list of what will NOT be covered and why:
- Screen/unit tinting effects: There are commands in the effect files that do things like tint the whole screen one color or fade to black for an effect. Others, like the example below, will tint an affected unit a specific color. To my knowledge, no one has dissected the effect files enough to know how this is done or if they have then I'm unaware of where it is documented. The instructions below will not cover anything that tints the whole screen or units.
- Sounds in spell effects: As with the screen tinting, as far as I know we just haven't discovered how sounds are controlled in the effect files.
- Making wholly new effects: Again, this comes down to a lack of detailed knowledge on how the effect files work. As of right now all we can do is modify existing effects into something else that will follow the same general pattern of motion on the screen. Until someone decides to start taking apart the effect files and decoding them into something we can understand and more easily modify, this is about as good as it gets folks.
With that out of the way, let's get down to it.
What you will need for the purposes of this tutorial: CDMage, GraphicsGale, TIMUtil, a HEX editor
[I will be using HxD in my examples].
This tutorial will also assume that you know how to use FFTPatcher to choose your effects for the skills in your patch. I will not be covering anything involving FFTPatcher. I will also be assuming you have at least a basic working knowledge of how to use GraphicsGale or similar image editing programs. If you don't, just go play around with GG for a while. Its not too tough to figure out.
Step 1: Go here
and get a BMP file of the effect you intend to modify. Xifanie has very graciously ripped the effect images from every spell effect in the game and made them readily available. We should thank her. Thanks, Xifanie! For our example today we will be modifying effect E052 "Faith/Face Up". As listed on the effects page we can see the filename for the effect is E052.BIN.
Step 2: Go into CDMage and open your ISO as "M2/2352 track".
Step 3: Open the EFFECT folder and locate your effect file on the right and right-click it to bring up the menu and select Extract Files. Make sure your effect filename matches the one from the effects page. Just save this to wherever you'll be keeping your working files. Also make a note of the number in the Size column for your file. We'll need that for Step 8. It has been cut off a bit in my example image but for this example our filesize is 46076.~Removing Graphics~
Step 4: Open your downloaded BMP file in GraphicsGale. You are going to want to overwrite anything you don't want in the spell effect with pure Black. This has RGB values of 0 as you can see highlighted in the image below. This is usually the very first color in the image's palette as shown by the red arrow.
We will be removing the heart from the spell effect here. Now just save the BMP. If that was all you wanted to do then proceed to Step 7. ~Changing The Colors~
To change the colors of an effect you will need to change the palette. Palettes for spell effect are "indexed" which really just means each pixel in the image refers to a color in a specific place on the palette. If you only want to change a few colors of an effect then select the color you want to modify in the palette and use the value boxes [as highlighted in Step 4 above] to change the color. This example will be for changing the colors of the ENTIRE effect.
Step 5: For GraphicsGale you will want to go to All Frames and select Adjust Color. [In Photoshop this is usually called Hue/Saturation and can be found under Image > Adjustments. Your version may vary.]
This will bring up a new window with a lot of options. We're only interested in four of them: The RGB sliders and the Saturation slider. You can change other things there but I won't guarantee your effect will turn out as planned. Basic rule of thumb here: Do not increase Brightness ever and do not raise the RGB values over 0.
I want to change the pink colors of the effect to gold. As you can see here, the image changes to reflect my changes to the sliders. When you've got colors you like, click OK. If this is all you need for your effect, skip ahead to Step 7.~Replacing Graphics~
For this section we will be using the heart-less version of the effect we made in Step 4 as well following the palette changing instructions in Step 5. The reason I chose gold is because the graphics I want to paste into the effect file are mostly gold and anything you paste into your BMP will attempt to match itself colors to the existing palette. Because what I want to paste into the effect uses white but the palette does have a white color, I have changed the very last and brightest color to white.
Step 6: This is really just as simple as Copy and Paste or just drawing your new graphics over what you want to replace. If you want to know how to make nice graphics, go read a spriting tutorial. Or you can just be like me and steal some graphics from another game. As shown below, I've replaced the hearts with a clock I stole from one of the Castlevania games. Looks kind of unimpressive here compared to the heart but it will serve for this example.
Step 7: A few of the previous steps will may directed you here. That's because this part is required no matter what you're changing or how. You will need to convert your BMP into a TIM file. Open TIMUtil and load your modified BMP file. Now the important part - you MUST click both of the checkboxes for 'Translucent except black' AND 'Transparent for black'. This is why we removed existing graphics with a pure black color. If you don't do this, your effect will look all wrong. Once you've got that done, click Convert and save your TIM file.
Now here is where I think a lot of people get lost trying to make things work. Open your HEX editor and open both your extracted BIN file and your TIM file you just created. If you're not familiar with HEX editing you're going to see a lot of numbers and letters that won't mean a lot to you. We are only concerned with all of the little pairs of numbers and letters in the middle of the window. ~Importing Your New Colors~
Step 8: Click on the tab at the top of the window that is your TIM file then bring your cursor to Offset: 14 as displayed in the bottom left of the window. This is the beginning of the palette data for your spell effect.
Now highlight down to Offset 213. The status bar at the bottom should read Block: 14-213 and Length: 200. Offset 213 is the very end of the palette information. You want to Copy this block of data.
Now remember that filesize number I had you make note of back in Step 3? This is where we need it. We now have to figure out where in the BIN file we have to Paste-Write this data for the palette.
Step 9: Read what's in the following spoiler.
You got all that? Our example effect is larger than 34KB but smaller than 70KB, so we are going to take the filesize  and subtract 33796 from that: 46076 - 33796 = 12280. That gives us the where but its in decimal. We want that in hexidecimal. After a quick conversion we get 2FF8, as in Offset: 2FF8. So you need to click on the tab for your BIN file now and you want to Goto that offset. You can find it manually or use the Goto function built into your hex editor to find it. I opt for the latter.
Step 10: Now you don't want to just Paste normally here. You want to Paste Write or Paste Overwrite, depending on your HEX editor. If you just Paste or Paste Insert you will increase the filesize. This will ruin your effect. You want to see this:
If all you're doing is putting in new colors, then you're done here. Save your BIN file and skip ahead to Step ###. If you are removing or otherwise modifying the graphics, read on.~Importing Modified Graphics~
This part is pretty much the same as importing the palette information, functionally speaking. You're just going to be looking for more data in a different place in the TIM file. However, this is a lot easier to find where you want to Paste Write it to.
Step 11: Once again you will need to open your HEX editor and open both your extracted BIN file and your TIM file. If they're still open from Step 10, that's fine. This time however, we're going to use our IMAGE size to find out where we need to copy from in the TIM file.
Step 12: Click on the tab for your TIM file again and go to Offset: 220 and then just select everything to the very end of the file. Make a note of the Length value here and Copy.
Step 13: Click on your BIN file tab once more and bring up the Goto window again. This time you want to change the 'Offset relative to' from 'Begin' [default] to 'end (backwards)' because we'll be telling it to count backwards from the end of the file.
As you can see above, I've set the Offset to 7FFF, 1 less than 8000 in Hex. This is to compensate for how HxD is going to count backwards. The goal is to bring us to the offset in the file that will let us Paste Write that Length 8000 block of data and end at the very last byte of the file. [If doing a smaller image you'll want your Offset to be 3FFF. If larger, Offset should be FFFF.]
Step 14: Paste Write in your data from the TIM file here. The data should come to the very end of the file, no more and no less.
If you get this error then you're not exactly Length 8000 from the end of the file:
If you see black numbers left after the red/changed values like this then you're not exactly Length 8000 from the end of the file:
You'll need to adjust where you're pasting your data from accordingly, but if you followed these steps properly then you should be right on target. Once everything is in place correctly, save your BIN file.
Step 15: This is the last and easiest part. Go back to your ISO in CDMage and right-click your effect file in the EFFECT folder again, but this time select Import File. Go find your newly modified BIN file and load it in. That's it! You've just created your own custom spell effect.
A fun note: Since this effect uses exactly the same graphics as the Innocent effect you can actually import the graphics data to E053.BIN [after adjusting for the different filesize] and get another new effect there but using that effect's special code which makes for another interesting looking spell. I've done that and applied the other three changes done in the tutorial here into a video.http://www.youtube.com/watch?v=_VNgmWzS9eE
The first questions I would expect is "Why is it green like that? What happened to the gold?" and the best I have is a theory and it goes back to the list of what isn't covered in this tutorial. The effect file has instructions in it to modify the colors of the palette to make that green color. If you note on the original/heartless version [top left] there is that burst of blue color, but our palette has no blue in it. I believe the effect file for Faith has instructions to apply a modification to the graphics based on existing colors in the palette, giving us green where once there was blue. This marks a great example of some of the limitations of effect editing right now. Simpler effects, like Esuna, take palette modifications beautifully as you can see here:http://www.youtube.com/watch?v=cNzjlYAIpsM
Other effects will just ignore any changes you make to their palette [I'm looking at YOU, Stigma Magic. >_< ] So for right now some of this is still a little hit and miss. Try your own edits, see what you come up with and as always...happy hacking! ^_^