Effect Files

From Final Fantasy Hacktics Wiki
Revision as of 01:15, 21 February 2025 by MrGudenheim (talk | contribs) (removed dead links)
Jump to navigation Jump to search

Follow this link to view the graphics used by the actual effect files. They can be also be found within the Effect directory in an extracted iso or in Shishi Sprite Editor's more recent versions, in the Other images tab.

A thorough reading of this topic will provide information on editing these: http://ffhacktics.com/smf/index.php?topic=116&postdays=0&postorder=asc&start=260

By converting the hexadecimal value assigned to the effect in the FFTPatcher's ability tab you can pinpoint which effect file is which within the directory.

A video compilation of all effects can be found here: http://ffhacktics.com/smf/index.php?topic=4830.0

There is a bunch of translated information about effect files in this thread: http://ffhacktics.com/smf/index.php?topic=6979.0

Example of effect data: https://ffhacktics.com/smf/index.php?topic=12226.msg226345


Effect File Format

Based on Glain's forum post and Choto's Effect Editor [1] [2]

ASM Subroutine Section (Optional)

Header Section

This section contains a list of 10 offsets (4 bytes each). Offsets are from the start of this section, not the start of the file.

0x801b48d0 in RAM is a table of data that defines where the effect file header is stored (in RAM) for each effect ID.

For ID 0x155, the table location is: 0x155 * 4 + 0x801b48d0 = 0x801b4e24

The value at 0x801b4e24 is 0x801c3cfc, the RAM location where the header data starts.

Effect files are loaded into RAM at 0x801c2500, so this results in a file offset of 0x801c3cfc - 0x801c2500 = 0x17FC.


0x00 Frames Section? (Always 0x28)

0x04 Animations Section?

0x08 Effect Script Section

0x0C Emitter Control Section

0x10 Effect Timing/Control Section?

0x14 ? (Optional)

0x18 ?

0x1C Camera Section

0x20 ?

0x24 Palette offset


Frames Section

Section 1: List of Frame Sets? Unknown about first 6 bytes, then each halfword (uint16) + 4 is related to offset to each frame

Section 2: Frame Data, repeated for each frame

0x00 VRAM 1

0x04 VRAM 2

0x08 Load Location Top Left X (unsigned)

0x09 Load Location Top Left Y (unsigned)

0x0A Width (pixels) (signed)

0x0B Height (pixels) (signed)

0x0C Display Top Left X (signed)

0x0E Display Top Left Y (signed)

0x10 Display Top Right X (signed)

0x12 Display Top Right Y (signed)

0x14 Display Bottom Left X (signed)

0x16 Display Bottom Left Y (signed)

0x18 Display Bottom Right X (signed)

0x1A Display Bottom Right Y (signed)

Rotation?


Effect Script Section

A series of instructions that tell the effect how to animate. Has 3 types of sections: Starting Section, Loop Section, and Ending Section. There may be a second Loop Section and Ending Section if effect is multi-target.

Script instructions are defined by 1 ID byte + additional bytes for data/parameters


ID Bytes Desc

0x00 4 Jump (unconditional)

0x04 2 End Effect

0x05 2 Begin Effect

0x06 4 Setup Custom Routine Pointer

0x16 6 Decision branch?

0x1d 4 Conditional branch (Timing, duration?)

0x1e 4 Conditional branch (multi-target?)

0x1f 4 Conditional branch (based on hit counter)?

0x25 2 Effect processing (advance frame)?

0x27 2 Store motion data?

0x28 2 Graphics (timing?)

0x29 4 Graphics (multi-target?), can branch

0x2a 2 Clear temp data?


Emitter Control Section

Emitter Control Section Header (20 bytes)

0x02: Number of emitters


Emitter Section: 196 (0xC4) bytes long

0x03: Flag for animation target: 0x02 - targeted panel, 0x04 - on/over source unit, 0x06 - each target unit?


Camera Section

bitwise-and with 0x01e0 with each value (2 bytes) at the following offsets

0x0806 - 1 value

0x168a - 2 values (after the first 2 bytes that are zero)

0x185a - 2 values (after the first 2 bytes that are zero)


Command based on result:

0x01c0 Rotate (or center) toward target panel?

0x0140 Rotate (or center) toward source unit?

0x0100 Rotate (or center) back to original point?


Palette Section

512 colors, 2 bytes per color. Either 16 or 256 colors per palette depending of image data format (4bpp or 8bpp)


Image data

Starts 1024 + 4 bytes after the start of the palette data. May be 8bpp format (each full byte is index to palette), or 4bpp Multi-CLUT.