News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Utilities: Final Fantasy Tactics Editor Released!  (Read 67943 times)

RHDNBot

  • Guest
Utilities: Final Fantasy Tactics Editor Released!
« on: January 22, 2008, 06:44:10 pm »
Update By: azidahaka

Some time ago, a guy called zodiac posted here saying that he was working on editing and hacking FFT. Now, thanks to his efforts and melonhead's coding, the first FFT editor for windows is out.

So far the following are editable:
  • Class/Abilities
  • Skill sets
  • Class opening requirements
  • Damage and item formulas
  • HP, MP, PA, MA, Speed, growth, and multipliers
  • Monsters skills and stats
  • game battles
  • items and item's effects

That's what can be done so far. Future possibilities in the works (and we may need some help):
  • sprite editing (we need to figure out some compression problems in part of spr files)
  • text editing (text placement and hex chars are figured out already, we need a tool for editing)
  • map editing


For more info head to auritech.eu! We are always in need of help, and suggestions are always welcome (as is hacking help)!

Download it HERE.

Staff Note:
This is also conveniently archived here at RHDN.

Relevant Link: (http://www.auritech.eu)

knighTeen87

  • Full Member
  • ***
  • Posts: 108
  • No More Room In Hell
    • View Profile
    • My personal site with Rom Hacks&Translations,Neo Geo Soundtracks,PSX Isos,CT 2007 Hack and more...t
Re: Utilities: Final Fantasy Tactics Editor Released!
« Reply #1 on: January 23, 2008, 04:53:58 am »
this i s what i wiated for my lifetime,I'm dying to translate this game with this in Turkish  :thumbsup:

azidahaka

  • Full Member
  • ***
  • Posts: 172
    • View Profile
Re: Utilities: Final Fantasy Tactics Editor Released!
« Reply #2 on: January 23, 2008, 06:40:05 am »
you are welcome to auritech.eu... right now we are in the need of help with psx file compression. if we solve that we'll be able to edit all the game's sprites too!

Starscream

  • Sr. Member
  • ****
  • Posts: 469
    • View Profile
Re: Utilities: Final Fantasy Tactics Editor Released!
« Reply #3 on: January 23, 2008, 06:41:31 am »
I used to tinker alot with FFT using my gameshark-like device (xploder) back then, you could already edit a lot of this through codes. One thing that wasn't possible then, was to change portraits. A completly modable FFT, now that would be great.

azidahaka

  • Full Member
  • ***
  • Posts: 172
    • View Profile
Re: Utilities: Final Fantasy Tactics Editor Released!
« Reply #4 on: January 23, 2008, 09:07:23 am »
I used to tinker alot with FFT using my gameshark-like device (xploder) back then, you could already edit a lot of this through codes. One thing that wasn't possible then, was to change portraits. A completly modable FFT, now that would be great.

that is the goal we are working to reach! any help is precious.

Gemini

  • Hero Member
  • *****
  • Posts: 2017
  • 時を越えよう、そして彼女の元に戻ろう
    • View Profile
    • Apple of Eden
Re: Utilities: Final Fantasy Tactics Editor Released!
« Reply #5 on: January 23, 2008, 09:14:02 am »
you are welcome to auritech.eu... right now we are in the need of help with psx file compression. if we solve that we'll be able to edit all the game's sprites too!
IIRC, there are no compressed sprites in FFT (at least the Psx version). The only compressed data is part of the help files, which is entirely text.
I am the lord, you all know my name, now. I got it all: cash, money, and fame.

azidahaka

  • Full Member
  • ***
  • Posts: 172
    • View Profile
Re: Utilities: Final Fantasy Tactics Editor Released!
« Reply #6 on: January 24, 2008, 01:52:04 am »
you are welcome to auritech.eu... right now we are in the need of help with psx file compression. if we solve that we'll be able to edit all the game's sprites too!
IIRC, there are no compressed sprites in FFT (at least the Psx version). The only compressed data is part of the help files, which is entirely text.

sadly all sprites have uncompressed animations of everything BUT the attack one, that is in the last part of the file. we can already put in and out sprites, and everything is perfect beside the attack part that is not figured out, and that was not figured out by the guy who made FFTsprite editor

Sephiroth 1311

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Re: Utilities: Final Fantasy Tactics Editor Released!
« Reply #7 on: January 25, 2008, 02:19:42 am »
My group and I might be interested in helping you.
We're translating both the versions into Italian, and we have a working de/compresso (though I'm rather positive that compression it's used only for text, since it has limitation for FE, the ending text byte), plus a tool which can handle LZW de/archivation and a text dumper (it has to be "polished" a bit when it comes to text insertion, but it's almost ready).

What we need is information on the mapping of FRAME.BIN (to expand its words into longer ones), of some words which are shown when starting a battle (like READY!), and, lastly, to know if there is a way to adjust a bit FFT PSX world map locations graphics (one could make a script with Paint Shop Pro, though). :P

Btw, great work on what you did! :)
Is it ok if we use your fixed SPELL.MES with our translation (with due credit, of course!)?
Sephiroth 1311
****************
member of SadNES cITy
1st italian ROM translation group
http://www.sadnescity.it *********************** "Do you want to leave to your own eyes Only dreams that won't awaken you?" "Yes, Your Honour, but I want greater ones."

Gemini

  • Hero Member
  • *****
  • Posts: 2017
  • 時を越えよう、そして彼女の元に戻ろう
    • View Profile
    • Apple of Eden
Re: Utilities: Final Fantasy Tactics Editor Released!
« Reply #8 on: January 25, 2008, 03:07:17 am »
sadly all sprites have uncompressed animations of everything BUT the attack one
Wait a sec... Isn't the attack part already there?


The last part of the file doesn't really look like compressed to me. Seems more like assembly data.

[edit]Forget it, it was actually compressed. >_> I've spotted the routine and I'm giving it a look. At first sight it's a nibble-based compression and it seems to be a simple one. Full disassembly coming later.[/edit]
« Last Edit: January 25, 2008, 04:19:41 am by Gemini »
I am the lord, you all know my name, now. I got it all: cash, money, and fame.

Gemini

  • Hero Member
  • *****
  • Posts: 2017
  • 時を越えよう、そして彼女の元に戻ろう
    • View Profile
    • Apple of Eden
Re: Utilities: Final Fantasy Tactics Editor Released!
« Reply #9 on: January 26, 2008, 08:57:48 pm »
Sorry for double posting, but this topic needs a bump. :p

So, I've disassembled the code a little and here's what I found out:
Code: [Select]
Decompress:
                addiu   $sp, -0x38       # Decompress(char *source, char *dest)
                sw      $s4, 0x28($sp)
                move    $s4, $a1         # char *dest
                sw      $s3, 0x24($sp)
                move    $s3, $0          # BOOL write_nibble
                sw      $s1, 0x1C($sp)
                move    $s1, $0          # int decsize, if==25600 return from decompression
                sw      $s5, 0x2C($sp)
                li      $s5, 25600       # decompression size
                sw      $s2, 0x20($sp)
                move    $s2, $s4
                sw      $ra, 0x30($sp)
                sw      $s0, 0x18($sp)
                sw      $a0, off_80096274  # *source
                sw      $0, dword_80096270
                sw      $0, dword_8009626C

proc_data:                               # CODE XREF: Decompress:loc_8007AB04j
                                         # Decompress+13Cj ...
                jal     GetNibble
                nop
                move    $s0, $v0
                bnez    $s0, read_nibble  # GetNibble()!=0
                nop
                jal     GetNibble
                nop
                move    $s0, $v0
                li      $v0, 7
                beq     $s0, $v0, read_8bits  # if(nibble==7)
                nop
                slti    $v0, $s0, 8
                beqz    $v0, attack_sprt  # if(nibble>=8)
                nop
                beqz    $s0, read_4bits  # if(nibble==0)
                nop
                j       loc_8007AB04
                nop
 # ---------------------------------------------------------------------------

attack_sprt:                             # CODE XREF: Decompress+7Cj
                li      $v0, 8
                beq     $s0, $v0, read_12bits  # if(nibble==8)
                nop
                j       loc_8007AB04
                nop
 # ---------------------------------------------------------------------------

read_4bits:                              # CODE XREF: Decompress+84j
                jal     GetNibble
                nop
                j       loc_8007AB04
                move    $s0, $v0
 # ---------------------------------------------------------------------------

read_8bits:                              # CODE XREF: Decompress+70j
                jal     GetNibble
                nop
                jal     GetNibble
                move    $s0, $v0
                j       loc_8007AB00
                sll     $v0, 4
 # ---------------------------------------------------------------------------

read_12bits:                             # CODE XREF: Decompress+98j
                jal     GetNibble
                nop
                jal     GetNibble
                move    $s0, $v0
                sll     $v0, 4
                jal     GetNibble
                or      $s0, $v0
                sll     $v0, 8

loc_8007AB00:                            # CODE XREF: Decompress+C8j
                or      $s0, $v0         # lenght

loc_8007AB04:                            # CODE XREF: Decompress+8Cj
                                         # Decompress+A0j ...
                blez    $s0, proc_data   # if(lenght<=0)
                move    $a0, $0          # counter for decompression
                addu    $v1, $s1, $s4    # decompression seek (dest+i)

zero_loop:                               # CODE XREF: Decompress+134j
                bnez    $s3, wnibble_zero
                nop
                j       zero_stored
                sb      $0, 0($v1)       # store zero
 # ---------------------------------------------------------------------------

wnibble_zero:                            # CODE XREF: Decompress:zero_loopj
                addiu   $s2, 1           # *dest++
                lbu     $v0, 0($v1)      # load the last decompressed nibble
                addiu   $s1, 1           # decsize++
                andi    $v0, 0xF0        # &0xF0
                sb      $v0, 0($v1)      # update
                beq     $s1, $s5, eof    # if(decsize==25600), nothing more to decompress
                addiu   $v1, 1           # *window++

zero_stored:                             # CODE XREF: Decompress+108j
                addiu   $a0, 1           # counter++
                slt     $v0, $a0, $s0    # while(counter<lenght)
                bnez    $v0, zero_loop   # if condition is true, continue decompression
                xori    $s3, 1           # write_nibble^=1
                j       proc_data        # go on with data processing
                nop
 # ---------------------------------------------------------------------------

read_nibble:                             # CODE XREF: Decompress+58j
                bnez    $s3, wnibble_data  # if(write_nibble!=0)
                sll     $v0, $s0, 4
                j       continue
                sb      $v0, 0($s2)      # dest[0]=nibble<<4
 # ---------------------------------------------------------------------------

wnibble_data:                            # CODE XREF: Decompress:read_nibblej
                lbu     $v0, 0($s2)      # dest[0]
                addiu   $s1, 1           # decsize++
                or      $v0, $s0         # nibble|dest[0]
                sb      $v0, 0($s2)      # dest[0]=nibble|dest[0]
                beq     $s1, $s5, eof    # if(decsize==25600), nothing more to decompress
                addiu   $s2, 1           # *dest++

continue:                                # CODE XREF: Decompress+14Cj
                j       proc_data
                xori    $s3, 1           # write_nibble^=1
 # ---------------------------------------------------------------------------

eof:                                     # CODE XREF: Decompress+124j
                                         # Decompress+164j
                lw      $ra, 0x30($sp)
                lw      $s5, 0x2C($sp)
                lw      $s4, 0x28($sp)
                lw      $s3, 0x24($sp)
                lw      $s2, 0x20($sp)
                lw      $s1, 0x1C($sp)
                lw      $s0, 0x18($sp)
                addiu   $sp, 0x38
                jr      $ra
                nop

And if you don't like asm, here is the C++ translation (full source service :beer:):
Code: [Select]
#define DEC_SIZE 25600

bool wnibble_stat;
int rnibble_pos;
BYTE *nibble_str;
BYTE dest[DEC_SIZE];

BYTE GetNibble()
{
BYTE value;
if((rnibble_pos&1)==0) value=nibble_str[rnibble_pos/2]>>4; // read hi nibble
else value=nibble_str[rnibble_pos/2]&0xF; // read low nibble
rnibble_pos++;
return value;
}

void SprDec(BYTE *source, BYTE *dest)
{
BYTE *destcpy=dest;
wnibble_stat=false;
rnibble_pos=0;
nibble_str=source;
BYTE nibble;
int length;
for(int i=0; i<DEC_SIZE; i++)
{
nibble=GetNibble();
if(nibble!=0)
{
if(wnibble_stat!=0)
{
destcpy[0]=destcpy[0]|nibble;
destcpy++;
i++;
}
else destcpy[0]=nibble<<4;
wnibble_stat^=1;
}
else // decompress
{
nibble=GetNibble();
if(nibble==8) length=GetNibble()|(GetNibble()<<4)|(GetNibble()<<8); // 12 bit length
else if(nibble==0) length=GetNibble(); // 4 bit length
else if(nibble==7) length=GetNibble()|(GetNibble()<<4); // 8 bit length
else length=nibble; // use nibble as a length
for(int j=0; j<length; j++)
{
if(i>=DEC_SIZE) return; // stop decompression
if(wnibble_stat!=0)
{
destcpy++;
dest[ i]=dest[ i]&0xF0;
i++;
}
else dest[ i]=0;
wnibble_stat^=1;
}
}
}
}

void _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
// allocate sprite file
CFile file(argv[1],CFile::modeRead | CFile::shareDenyNone);
int size=(int)file.GetLength();
BYTE *data=new BYTE[size];
file.Read(data,size);
file.Close();
// decompress
SprDec(data+0x9200,dest);
// write decompressed result
file.Open(_T("out.bin"),CFile::modeWrite | CFile::modeCreate);
file.Write(dest,DEC_SIZE);
file.Close();
delete[] data;
}
The _tmain uses Unicode and MFC, but you can just ignore that (it's there only for fast testing purposes) and use only SprDec.

In a nutshell, the compression only crunches empty pixels (zeroed nibble) and stores them in some sort of RLE, with 4 methods to determine the lenght of that segment. Both read and write modes work in nibbles, and the decompressed segment is always 25600 bytes.
« Last Edit: January 26, 2008, 09:07:50 pm by Gemini »
I am the lord, you all know my name, now. I got it all: cash, money, and fame.

Great Red Spirit

  • Sr. Member
  • ****
  • Posts: 308
    • View Profile
Re: Utilities: Final Fantasy Tactics Editor Released!
« Reply #10 on: January 28, 2008, 10:51:32 pm »
I've been playing around with this for a bit, and I've got to say nice job!  :thumbsup: (as if I haven't already played around with FFT, cheating in my own 'unique' party, now I can make wonky classes and oh god I think I hear another playthrough coming along)

Zodiac

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Utilities: Final Fantasy Tactics Editor Released!
« Reply #11 on: January 29, 2008, 04:22:53 pm »
:o Front page?

Oh, thank you so much Gemini, that should help a lot.

I figured it was a nibble based compression & that it crunched color #0 but not more than that.

It will take me time to study, I have no C knowledge and basically no assembly either. But in the end I want to code a tool capable of converting 256x488 bmp images (256bits) to .spr files.

Frame.bin contains the battle text? I remember checking a file containing those and I'm pretty sure it's just a simple 2bit color image file.

melonhead doesn't talk a lot so I have no idea on his future plans with this project.

Sephiroth 1311

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Re: Utilities: Final Fantasy Tactics Editor Released!
« Reply #12 on: January 30, 2008, 05:45:11 am »
:o Front page?

Oh, thank you so much Gemini, that should help a lot.

I figured it was a nibble based compression & that it crunched color #0 but not more than that.

It will take me time to study, I have no C knowledge and basically no assembly either. But in the end I want to code a tool capable of converting 256x488 bmp images (256bits) to .spr files.

Frame.bin contains the battle text? I remember checking a file containing those and I'm pretty sure it's just a simple 2bit color image file.

melonhead doesn't talk a lot so I have no idea on his future plans with this project.
It does... inside that file there are "Bravery", "Faith", status abnormalities, etc, which we obviously need to translate.

Do you know where to find the mapping info for those graphics? I only managed to spot the ones for Bravery and Faith (quite simple, but can't find the others...).
For mapping info I mean those bytes that control screen position, position inside the FRAME.BIN and widht end height.
I need that to organize a better Italian translation for those words. ;)

P.S. By the way, do you know where "Now Loading" is located?
In the PSP version is a simple RAW, but it is not in the PSX one.
Sephiroth 1311
****************
member of SadNES cITy
1st italian ROM translation group
http://www.sadnescity.it *********************** "Do you want to leave to your own eyes Only dreams that won't awaken you?" "Yes, Your Honour, but I want greater ones."

Zodiac

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Utilities: Final Fantasy Tactics Editor Released!
« Reply #13 on: January 30, 2008, 06:35:29 am »
Oh, you meant that... not remember if I played with those; I doubt.

Are you saying you're translating from the English version? Then the translation will loose accuracy. :/

Can't really be of much help; sorry.

Sephiroth 1311

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Re: Utilities: Final Fantasy Tactics Editor Released!
« Reply #14 on: January 30, 2008, 12:16:59 pm »
Oh, you meant that... not remember if I played with those; I doubt.

Are you saying you're translating from the English version? Then the translation will loose accuracy. :/

Can't really be of much help; sorry.

Actually, we're translating the fantastic PSP translation, and then copying the translated text into the PSX version (of course, we're working on the PSP version too). ;)
Anyway, don't worry 'bout it!
We will probably release our tools after finishing our work, though. ;)
Sephiroth 1311
****************
member of SadNES cITy
1st italian ROM translation group
http://www.sadnescity.it *********************** "Do you want to leave to your own eyes Only dreams that won't awaken you?" "Yes, Your Honour, but I want greater ones."

azidahaka

  • Full Member
  • ***
  • Posts: 172
    • View Profile
Re: Utilities: Final Fantasy Tactics Editor Released!
« Reply #15 on: January 30, 2008, 12:23:39 pm »
Oh, you meant that... not remember if I played with those; I doubt.

Are you saying you're translating from the English version? Then the translation will loose accuracy. :/

Can't really be of much help; sorry.

Actually, we're translating the fantastic PSP translation, and then copying the translated text into the PSX version (of course, we're working on the PSP version too). ;)
Anyway, don't worry 'bout it!
We will probably release our tools after finishing our work, though. ;)

Grande! ma sei dei sadnes! io sono il proprietario del sito auritech e promotore dell'hacking! ti sarei veramente grato se riuscissi a passarci un modo per fare la decompressione e compressione dei file spr... abbiamo delle patch grandiose, ed editando gli sprite potremo rendere le cose ancora piu' interessanti, fare dei video e far crescere ancora l'interesse!

translated for non italians: it's just an help request :D

you all sadnes are welcome to auritech.eu forums... maybe you might add something special to your translated version ;)

Gemini

  • Hero Member
  • *****
  • Posts: 2017
  • 時を越えよう、そして彼女の元に戻ろう
    • View Profile
    • Apple of Eden
Re: Utilities: Final Fantasy Tactics Editor Released!
« Reply #16 on: January 30, 2008, 08:03:26 pm »
Grande! ma sei dei sadnes! io sono il proprietario del sito auritech e promotore dell'hacking! ti sarei veramente grato se riuscissi a passarci un modo per fare la decompressione e compressione dei file spr...
The decompression code is already there, even tho it's in C++ and R3000 asm. :P Your program is coded in C# or something related with .NET, right? You could create a dll just for sprite de/compression and then link it into the editor, so that you won't need any C->whatever language translation.
I am the lord, you all know my name, now. I got it all: cash, money, and fame.

azidahaka

  • Full Member
  • ***
  • Posts: 172
    • View Profile
Re: Utilities: Final Fantasy Tactics Editor Released!
« Reply #17 on: January 31, 2008, 01:50:26 am »
Grande! ma sei dei sadnes! io sono il proprietario del sito auritech e promotore dell'hacking! ti sarei veramente grato se riuscissi a passarci un modo per fare la decompressione e compressione dei file spr...
The decompression code is already there, even tho it's in C++ and R3000 asm. :P Your program is coded in C# or something related with .NET, right? You could create a dll just for sprite de/compression and then link it into the editor, so that you won't need any C->whatever language translation.

thanks i didn't understand that. i'm not the programmer of the tool, so....

zodiaaaaaaaaac! have a chat with melonhead! :)

Gemini

  • Hero Member
  • *****
  • Posts: 2017
  • 時を越えよう、そして彼女の元に戻ろう
    • View Profile
    • Apple of Eden
Re: Utilities: Final Fantasy Tactics Editor Released!
« Reply #18 on: January 31, 2008, 05:38:09 am »
Is Zodiac italian, too? :O
I am the lord, you all know my name, now. I got it all: cash, money, and fame.

azidahaka

  • Full Member
  • ***
  • Posts: 172
    • View Profile
Re: Utilities: Final Fantasy Tactics Editor Released!
« Reply #19 on: January 31, 2008, 06:22:59 am »
Is Zodiac italian, too? :O
no he's not :) by the way on the auritech.eu forum's i'm karsten.

i've tried to contact you guys time ago, i had almost all FFT already translated and were willingly to help you guys... how are things going? if you need help i'm good at translating, localizing and most important adapting the text to italian.