• Welcome to Final Fantasy Hacktics. Please login or sign up.
 

Special Effects Extraction Tutorial for Dummies

Started by R999, July 20, 2010, 02:54:54 am

R999

July 20, 2010, 02:54:54 am Last Edit: April 08, 2011, 11:34:19 am by Xifanie
All Credits goes to Zodiac.

Edit: FFT Effects Ripped by Zodiac

Zodiac is close to having finished ripping all the special effects for FFT!
This means steps 1 to 2 are no longer needed!

All we have to do now is, calculate the locations for Palette and Image for the BIN file,  convert the BMP back to TIM, then copy the palette and image back into the corresponding BIN file.


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


This is an extended guide from Zodiac's tutorial in the spriting forum. This tutorial is pretty much the same thing, but a little bit easier to work through (for myself). I am keeping this for extended tutorial for Zozma, Lijj, and anyone else who maybe interested in special effects of FFT, as well as for self educational purposes incase I forget how to do this in the future.

This tutorial assumes you know how to retrieve the Effect BIN files from the FFT ISO via CDMage.



Overview

FFT Effect files have their custom BIN format, which includes animation scripts and the sound effects. We need to turn the file into another graphic format known as TIM first in order to convert TIM into BMP. In order to do such a conversion, we first need to make a TIM file from the BIN file.

You need the TIM UTILITY and TIM Template files,

[attachment=0:isjkz3uu]TIMUTIL and TIMTemplates.zip[/attachment:isjkz3uu]
and a Hex Editor (Winhex preferred).


Step 1 Making TIM from BIN

First thing we need to do is guess the dimension of the EffectImage. This can be pretty much only done by observation as Zodiac can't find that info. There are three common sizes for effect files,



Determining Dimensions (and Size)

Width = Width of EffectImage in pixels
Height = Height of "

The size in bytes for EffectImage is Width * Height.
The Hex value of this decimal number is our HexImageSize.

Common sizes,

TYPE A) 256x256
BIN filesize usually at least 64KB
HexImageSize = 0x10000 bytes

TYPE B) 128x256
BIN filesize 48.4KB
HexImageSize = 0x8000 bytes

TYPE C) 128x128
HexImageSize = 0x4000 bytes




Calculating the Locations

1. What is your BIN's HexFilesize?
Example, StasisSword E163.BIN is 54,864 --> 0xD650 bytes

2. ImageStart location = HexFileSize - HexImageSize
Example, ImageStart = 0xD650 - 0x8000 = 0x5650

Note that ImageEnd is simply the end of the file.

3. PaletteStart location = ImageStart - 0x404 (Palette is stored 0x404 bytes before Image)
Example, PaletteStart = 0x5650 - 0x404 = 0x524C

4. PaletteEnd location = PaletteStart + 0x200 (This is size of Palette)
Example, 0x524C + 0x200 = 0x544C



[s:isjkz3uu]Copy and Pasting from BIN into TIM Template[/s:isjkz3uu]

This horrendous time consuming step is no longer necessary, thanks to Zodiac for ripping all the effects for us!

We have three types of TIM Templates for the 3 most common EffectImage dimensions,

TYPE A) 256x256 Template

TYPE B) 128x256 Template

TYPE C) 128x128 Template


1. In HexEditor,  open the corresponding TIM Template File, and open your BIN file.  

2. To go to a location in the hex file, press Option+G.

We need to Copy the Palette and Image from the BIN file to our TIM file.

TIMPaletteStart 0x14
TIMImageStart 0x220


PaletteStart, PaletteEnd --> TIMPaletteStart (0x14 of TIM file).
ImageStart, ImageEnd --> TIMImageStart (0x220 of TIM file).


To Copy, press Ctrl+C.
To Paste, press Ctrl+B

After you are done, Save and close the TIM file.





Step 2 Converting between BMP and TIM

Thanks to Zodiac we no longer need to do the first conversion step.

Open TIM UTILITY and open your TIM file.

Press Preview and you should see the effect, if something looks funny, it means you messed up. Look over the steps and make sure you follow through correctly.



If Preview shows up properly, then select BMP at the lower left and press Convert.

Save the BMP file and do your editing.


Make sure the first color is RGB(0,0,0) and the last color is RGB(248,248,248) in the palette in photoshop.



Once you are done with editing,  open your BMP with TIM UTILITY and convert it back to TIM.

Set the format as TIM, and check Translucent except Black and Translucent for Black, Convert.








Step 3 Copying from TIM to BIN

Open our new TIM file that we converted back from the BMP into HexEditor.


Now our goal is to Copy the Palette and Image from TIM into BIN.

Recall the locations,

TIMPaletteStart 0x14
TIMPaletteEnd 0x213
TIMImageStart 0x220


Copy Palette from 0x14--0x213   --> paste into BIN's PaletteStart
Copy Image from 0x220  --> paste into BIN's ImageStart


Save the BIN file.  Finished!

Lijj

Thanks a lot for this and helping me out. I didn't even know what the concept of hexadecimals was. But now... now that I can edit magic I suddenly feel really good!
  • Modding version: PSX