• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
June 14, 2025, 04:05:39 pm

News:

Please use .png instead of .bmp when uploading unfinished sprites to the forum!


FFTA2 Editor v1.3.3

Started by Rurusachi, April 08, 2025, 11:28:27 am

Rurusachi

April 08, 2025, 11:28:27 am Last Edit: June 01, 2025, 04:55:09 am by Rurusachi Reason: Updated to v1.3.3
I made an editor for FFTA2 that reads and rebuilds the internal filesystem instead of using fixed offsets. It can do everything that currently existing editors can do (as far as I know) + more. However the saved rom is not compatible with any other editors because all the known data offsets will change after editing. Manually editing with a hex editor is possible if you can find the new offsets.

Setup instructions and known issues can be found here:
FFTA2 Editor

Current version: v1.3.3

Features:
  • Abilities
  • Ability Sets
  • Jobs. Including Requirements and Groups(jobs that share ability sets)
  • Equipment
  • Special Characters
  • Unit Formations
  • Quests
  • Bazaar
  • Auctions
  • Sprites (Battle sprites, Portraits, Top Screen sprites)
  • Text (all except text in images?)

Changelog:
v1.3.3 (2025/06/01):
Fixes:
  • Now uses significantly less memory when saving (by calculating the final size instead of allocating ~750 mb). This might fix the editor never finishing saving on some systems.
v1.3.2 (2025/05/13):
As of this update text encoding/decoding and line height calculations should finally be correct.
A new menu at the top named Fixes contains a fix that resets all text affected by the encoding bug to vanilla.
Features:
  • Added field for Ability help text
Fixes:
  • Fixed Ability help text being saved incorrectly (index was cast to Byte instead of Short). Bugged values will reset to vanilla when loaded.
  • Fixed the Auction Prize tables overwriting the Grand Auction Prize tables when saving. Bugged tables will reset to vanilla when loaded.
  • Fixed 2 sets of characters being decoded to the same character, replacing all instances of one with the other:
    • An apostrophe-like character (now decoded as "`" ) was being replaced by a normal apostrophe.
    • "*" was being replaced by a long dash (now decoded as "ー").
v1.3.1 (2025/04/29):
Features:
  • Added a Disable Sequencer and Peytral Stat Growth patch.
  • Updated the Signed Equipment Stats patch to prevent negative stats. If already applied simply toggle it off and on to apply the updated version
v1.3.0 (2025/04/26):
Features:
  • Added autocomplete to most ComboBoxes (dropdown fields).
  • Formations are now named after the quest they are used in. Formation 0 is a special case as it is used for recruitable units and starting units.
  • Added a new Save button that saves to the most recent opened/saved rom.
  • Added copy/paste for abilities. This copies all data except name and description from one ability to another including animations.
  • Added a Signed Equipment Stats patch. This changes the range for Equipment stats from [0, 255] to [-128, 127]. If enabled you should set Sequencer/Peytral's Attack/Defense to no higher than 27, otherwise they may overflow when fully stacked.
  • Added a Starting MP patch that sets unit's starting mp to max.
  • Added a Max Level patch that sets the max level for all units.
  • Added an MP Gain Per Turn patch that changes mp gained per turn to a flat value + %max mp.
Fixes:
  • The "Required Job" fields in Job Requirement now refer to Ability Sets instead of Job Groups. This bug is unlikely to have affected anyone as they are equivalent for all existing jobs except for Sky Pirate, Dancer, Heritor, Agent, and Nightshade. If any of those jobs _or_ any newly created jobs were set as required for other jobs then they will need to be set again.
v1.2.3 (2025/04/19):
Features:
  • Updated Ability Animation fields and Ability Set Ability fields.
  • Added logging when loading and saving.
  • The file explorer now defaults to the path of the last loaded/saved rom or the current directory.
v1.2.2 (2025/04/16):
Features:
  • Now displays editor version in title.
  • Renamed the PRIME1 and PRIME2 ability effects to PRIME_CANNONEER and PRIME_FLINTLOCK.
Fixes:
  • Fixed a signed conversion bug that affected ability Weapon Requirements.
v1.2.1 (2025/04/15):
Features:
  • Added description field for Ability Sets.
  • Better error messages when failing to save.
  • Renamed some text tables (mainly removing question marks).
Fixes:
  • Fixed wrong default strings for some descriptions (mainly new AbilitySets) that would cause an error when saving.
v1.2.0 (2025/04/14):
Fixes:
  • Added missing Ability targets, effect, accuracy, and modifier values.
  • Fixed Weapon Requirement bug that caused some values to disappear.
  • Important: Any rom saved with a previous version of the editor is affected by these bugs. Either start over from a clean rom or follow the manual fix found here.
v1.1.3 (2025/04/13):
Fixes:
  • The ability flags Caught by Sticky Fingers and Activates Absorb MP were switched around.
v1.1.2 (2025/04/12):
Fixes:
  • Fixed a memory issue. Now allocates less memory when saving.
v1.1.1 (2025/04/11):
Fixes:
  • Job Requirements were referring to Jobs instead of Job Groups.
v1.1.0 (2025/04/08):
  • Initial release posted here


Included optional patches:
  • Animation Fix. Ports weapon animations to all playable units (including Al-Cid). Also removes hard-coded limitations from Agent's Ability Set.
  • Expanded Top Sprite Index Limit. Expands the max amount of Top Screen Sprites from 255 to 65535. Required if more are added.
  • Signed Equipment Stats patch. This changes the range for Equipment stats from [0, 255] to [-128, 127]. If enabled you should set Sequencer/Peytral's Attack/Defense to no higher than 27 or apply the Disable Sequencer and Peytral Stat Growth patch.
  • Disable Sequencer and Peytral Stat Growth patch.
  • Starting MP patch that sets unit's starting mp to max.
  • Max Level patch that sets the max level for all units.
  • MP Gain Per Turn patch that changes mp gained per turn to a flat value + %max mp.
  • Modding version: Other/Unknown

Rurusachi

I just released v1.2.0 which fixes a bug that affects any rom saved with a previous version of the editor. To fix affected roms either start over from a clean rom or follow the manual fix found here.
  • Modding version: Other/Unknown

Emin3ms

  • Modding version: Other/Unknown
  • Discord username: Rachid System

Saul-G

That's impressive. Your editors is pretty solid alright!
Just asking a question: It is possible to add an option to set the level cap? Like making all units (both yours and the enemy) to reach max level 50?
  • Modding version: PSX
  • Discord username: Pluggy

Rurusachi

Quote from: Emin3ms on April 16, 2025, 03:33:13 pmAmazing, thanks a lot man
Thank you :)

Quote from: Saul-G on April 17, 2025, 03:07:30 amThat's impressive. Your editors is pretty solid alright!
Just asking a question: It is possible to add an option to set the level cap? Like making all units (both yours and the enemy) to reach max level 50?
Thanks :)
I can look into it. I've seen a post mentioning how to do that somewhere.
  • Modding version: Other/Unknown

Emin3ms

I'd like to know more about how you managed to make this editor. Have you been able to identify parts of the source code in assembly ?

There is this feature I've spent a lot of time trying to implement but no success, it's the possibility to have negative stats on equipment. Do you think it's possible ?
  • Modding version: Other/Unknown
  • Discord username: Rachid System

Rurusachi

Quote from: Emin3ms on April 19, 2025, 06:32:36 amI'd like to know more about how you managed to make this editor. Have you been able to identify parts of the source code in assembly ?
A while ago I found a text editor that had been built to translate the game. I looked at the code and realized it was unpacking and rebuilding the internal filesystem. This gave me the idea to build an all-purpose editor that does the same instead of using known fixed offsets. I built the editor by studying the code of this translation tool and reverse engineering the game with Ghidra. I've used Ghidra to map out a lot of the game's code at this point.

Quote from: Emin3ms on April 19, 2025, 06:32:36 amThere is this feature I've spent a lot of time trying to implement but no success, it's the possibility to have negative stats on equipment. Do you think it's possible ?
That should be possible. I looked into it and it seems to mainly be a matter of changing some instructions to load the stats as signed values instead of unsigned. The slightly more complex part is changing the calls to display equipment stat as signed values but it's doable. I've attached some screenshots with a working implementation for the attack stat only. I'll add this as a patch in the editor at some point :)
  • Modding version: Other/Unknown

vangstampede

This editor is able to make it so that Al-Cid can change job? Instant 10/10 in my book.

Some questions, do you have plans to add features to edit:
1. your clan member's stats?
2. abilities, such as changing Charged Attack's 8 attack value into 40 and increasing Regen's health regeneration value?
3. MP regeneration rate, like say, 15 instead of 10?
  • Modding version: Other/Unknown

Rurusachi

Quote from: vangstampede on April 20, 2025, 04:09:17 am1. your clan member's stats?
If you mean the starting clan members they are in Formation 0. Formation 0 contains all the recruitable units. Any unit with Faction set to 8 will be a starting clan member.

Quote from: vangstampede on April 20, 2025, 04:09:17 am2. abilities, such as changing Charged Attack's 8 attack value into 40 and increasing Regen's health regeneration value?
3. MP regeneration rate, like say, 15 instead of 10?
These values are defined in the battle scripts which I haven't fully understood yet. I have found the mp per turn part of the script and made a proof-of-concept flat + %max mp per turn mod. I just need to implement it in the editor. I haven't found any other values in there yet but eventually yes
  • Modding version: Other/Unknown

Emin3ms

Damn bro you are such an unexpected hope 🤣

When i wrote the issue about yaml tasks/playbook I didn't see that you already have a Patch section in the editor, so another option could be to have a list of patches available like it is currently in the editor, with a little form if needed to adjust some values. Problem is that if you stop being active on this project there won't be new patches ^^
When it comes to edit assembly code it's difficult without known parts so anyway I wouldn't know how to create a patch !

My 2nd big change that i wanted to make is to gain % of max mana per turn instead of flat. We know the location of the flat values but then I haven't found the function that uses them.
  • Modding version: Other/Unknown
  • Discord username: Rachid System

Rurusachi

Quote from: Emin3ms on April 20, 2025, 06:08:09 amWhen i wrote the issue about yaml tasks/playbook I didn't see that you already have a Patch section in the editor, so another option could be to have a list of patches available like it is currently in the editor, with a little form if needed to adjust some values. Problem is that if you stop being active on this project there won't be new patches ^^
When it comes to edit assembly code it's difficult without known parts so anyway I wouldn't know how to create a patch !
It's open source so anyone can contribute if they want to ;).
I do also plan to include an import/export function for the internal files. That way they can be modified outside of the editor if you know what you're doing.
But having a format for defining external patches is a good idea I'll write that down.

Quote from: Emin3ms on April 20, 2025, 06:08:09 amMy 2nd big change that i wanted to make is to gain % of max mana per turn instead of flat. We know the location of the flat values but then I haven't found the function that uses them.
Already on the way (mentioned one post above you) :).
I can explain it a bit more. The flat values you're talking about are inside one of the battle scripts ("battle/btlprocess.sbn" to be specific). The battle scripts are written in their own scripting language. So the values are actually part of a "push to stack" call in the script. That part of the script is roughly:
  • ...
  • Push unit index(?)
  • Pop as unit pointer and write to memory-1
  • Call getUnitCurrentMp(currentUnit)
  • Push call result
  • Push 0xA (the flat value you're talking about)
  • Stack Addition (push(pop + pop))
  • ...
This is slightly simplified and eventually after this it calls setUnitCurrentMp with the new value. There's some more calls in there to manage the stack and memory. I'm also not 100% sure how it gets the unit pointer. I wrote a hook in the scripting language that also gets the max mp, divides by 10, and adds it to the value. I just need to implement it as a patch in the editor with customizable values.
  • Modding version: Other/Unknown

Emin3ms

Wonderful, how have you been to extract scripts ? With ghidra ?
  • Modding version: Other/Unknown
  • Discord username: Rachid System

Rurusachi

Quote from: Emin3ms on April 20, 2025, 07:47:56 amWonderful, how have you been to extract scripts ? With ghidra ?
I found the filenames in the code with Ghidra. The internal filesystem is basically a hashtable so it doesn't store the filenames.
I currently use a python script to extract files but the editor can also do it, I just haven't made the UI for it. The editor already extracts the files to memory for editing (That is the core idea of the editor after all), I just have to make the UI for selecting which files to extract.
  • Modding version: Other/Unknown

vangstampede

April 20, 2025, 06:19:04 pm #13 Last Edit: April 20, 2025, 06:34:14 pm by vangstampede
Quote from: Rurusachi on April 20, 2025, 05:51:37 amIf you mean the starting clan members they are in Formation 0. Formation 0 contains all the recruitable units. Any unit with Faction set to 8 will be a starting clan member.

Not that, I meant editing the stats of all the characters I currently have recruited as clan members. Like, suppose that I accidentally level up Luso as Soldier instead of Paladin. I wanna edit Luso so that Luso stays on the same level but his stat is adjusted as if he just leveled up as Paladin instead of Soldier.

Quote from: Rurusachi on April 20, 2025, 05:51:37 amThese values are defined in the battle scripts which I haven't fully understood yet. I have found the mp per turn part of the script and made a proof-of-concept flat + %max mp per turn mod. I just need to implement it in the editor. I haven't found any other values in there yet but eventually yes

Looking forward to that! I've always thought that it's messed up how Doublehand and Charged Attack only give 8 extra attacks lol
  • Modding version: Other/Unknown

Rurusachi

Quote from: vangstampede on April 20, 2025, 06:19:04 pmNot that, I meant editing the stats of all the characters I currently have recruited as clan members. Like, suppose that I accidentally level up Luso as Soldier instead of Paladin. I wanna edit Luso so that Luso stays on the same level but his stat is adjusted as if he just leveled up as Paladin instead of Soldier.
Oh this editor is only for editing the rom. It's not for save or memory editing. That's completely different.

Quote from: vangstampede on April 20, 2025, 06:19:04 pmLooking forward to that! I've always thought that it's messed up how Doublehand and Charged Attack only give 8 extra attacks lol
Yeah that's ridiculous lol. I'll find the values eventually so they can be fixed.
  • Modding version: Other/Unknown

vangstampede

Quote from: Rurusachi on April 21, 2025, 09:26:42 amOh this editor is only for editing the rom. It's not for save or memory editing. That's completely different.

Oh, I see. I legit didn't know that, thanks.
  • Modding version: Other/Unknown

GasT87

Amazing work, from time to time I still play around with A2 but never have the time to finish anything. This will hopefully help me get things back on track.
A question that has bothered me ever since the game release is that Nu Mou and Moogle can't enter water and changing their jobs to allow them too crashes the game. Would the animation fix patch fix this or is there something else that can be changed to make them work? Also if I understand correctly the animation patch would enable any race to use any weapon? Like spear wielding Viera o Nu Mou using braces?

Rurusachi

Quote from: GasT87 on April 28, 2025, 10:53:25 amA question that has bothered me ever since the game release is that Nu Mou and Moogle can't enter water and changing their jobs to allow them too crashes the game. Would the animation fix patch fix this or is there something else that can be changed to make them work?
The problem here is probably that they don't have an alternate sprite set for being in water. It should be possible to add in-water sprites for them. Though since the editor doesn't support animation editing you'd have to copy the in-water unit sprites from a race that already has all the animations Moogle/Nu Mou need.

Quote from: GasT87 on April 28, 2025, 10:53:25 amAlso if I understand correctly the animation patch would enable any race to use any weapon? Like spear wielding Viera o Nu Mou using braces?
Yes
  • Modding version: Other/Unknown

Saul-G

Nice nice nice nice nice nice...

These improvements on your editor are quite impressive after a few weeks. Thanks to implementing the level cap, btw.

What more can be done to improve the editor? Maybe adding a flag for monster abilities than can be learn by blue mages? Would that be hardcoded?

What about modifying the unit list that can join your clan on these events? Whould be possible for monsters to join the clan that way?

Sorry if this is read like it that can be easily added upon. Thanks for your fine work.
  • Modding version: PSX
  • Discord username: Pluggy

Emin3ms

Are item slots used for grenades usable to create new items or they have something special hardcoded ? Same question for possibility of reordering the items
  • Modding version: Other/Unknown
  • Discord username: Rachid System