Author Topic: [FF9] General editor - Hades Workshop (0.38)  (Read 160485 times)

Tirlititi

  • Insane poster
  • *
  • Posts: 420
  • Karma: 55
    • View Profile
[FF9] General editor - Hades Workshop (0.38)
« on: 2013-06-06 17:51:30 »
Hi there !

I'm working on a Final Fantasy IX modding tool called Hades Workshop. It is aiming to allow to edit most of Final Fantasy IX's content. Quite a big project and I don't know if I will ever decide when it's finished  ;D

//============== THE TOOL =================//

The features so far :
- Can open Final Fantasy IX PSX files, in .bin format and in any language version,
- Now works with the Steam version,
- Read and edit datas about :
--- Spells the party can cast,
--- Supporting abilities the party can use,
--- Commands the party has,
--- Default stats of the party members,
--- Items' features,
--- Items sold in shops,
--- Statistics, attacks and AI of enemies,
--- Tetra Master cards,
--- Text, dialogs and charmap,
--- Game's script,
--- MIPS script and CIL script,
--- Model exporting (Battle Scenes only for PSX, more for Steam),
--- Backgrounds (view only in PSX, view/replace in Steam),
--- Steam resources exporter/importer,
--- Spell animation sequencing.
- Works under Windows only (you may recompile the source code I redistribute or use wine under linux).

It may be a good idea to have a look at the help (F2).

Also, I recommend to the new Steam users to go easy with this tool. Several features are easy to get familiar with, but due to the power of this program and the complexity of FF9, there are subtilities and traps to avoid.
You should read this post to get to know some of them.
Important : Hades Workshop doesn't work if Albeoris's Memoria tool was used. The other tool called Memoria (seriously Albeoris...) by gjoerulv works just fine.

Credits :
I made the program, obviously, but I got helped a lot by your wiki (http://wiki.qhimm.com/view/FF9) for cluster datas format and by http://finalfantasy.wikia.com/ occasionally.

Other than that, LandonRay and Zande made quiet an useful work in data finding, Zidane_2 wrote most of the other tools about FFIX before me.

The background image has been drawn by Maxa'. You can check his Deviant-Art page here.

Please tell me if you get any suggestion/bug report/feedback to share ^^

Here are the download links :

HADES WORKSHOP

Github project

The older versions can be found here

Thank you for your attention  :)

//=============== THE MODS =================//

Here are Final Fantasy IX mods made using Hades Workshop. I won't speak of LandonRay's mod because it is not related to it, but it's also worth a look ^^
Difficulty Tweak : Made by Iamthehorker, this mod increases the MP cost of the abilities and make the battles tougher. The gameplay itself is preserved, so it really is an increase of difficulty for an augmented playthrough. If you think that the boss battles end too quickly or if you never saw the use of the ethers/elixirs, this mod is a way to go. It also allows Steiner to equip the Save of the Queen in the end-game.
Final Fantasy Formula IX : A mod made by Aidolu with completly different spells and commands. I particulary like how commands have been re-invested to make spells like Songs or Cooking moves. The new spells are mostly taken from other Final Fantasy with few changes sometimes because of the limitation of my program or of FFIX battle mechanics.
Save The Queen : A mod made by ThisGuyAreSick2. It allows Steiner to use the allmighty Save The Queen. It also changes the way you synthesize it (it's made in the Black Mage Village in disc 4).
FF9.2.2 : A mod made by Vir to improve the Perfect Stats challenge balancing. It removes the forced exp battle so a true lvl 1 game can be made. It also fixes the Thunder Slash glitch. Vir also made a Fixed Stats Mod which removes the primary stat variations from games to games and have a normalized stat progression.
Alternate Fantasy : My own mod. It modifies a bit of everything in the game but mostly change the abilities and the gameplay in battles.

Also, you can find here the different tiny mods I made over the years.

//============== HELP AND TIPS =================//

This topic is now more than 30 pages long. Different people asked for help at different points and I always tried to give a complete answer. You can thus find details in this topic about subtilities of the game, or how a feature of HW works, or how to do some precise thing. Since I don't want everyone to read the whole topic thoroughly, here are links to answers to these kind of questions.

Side effects of Initial/Auto-statuses
A list of spells specially handled by the engine
Bypass the enemies' Max HP limit
Checking if a character is in the team in-battle
Enabling an enemy attack depending on the party stats
Make Zorn & Thorn battle more difficult
About the random encounter rate
Removing Dagger's depression effect in-battle
About Ragtime Mouse quizz and reward script
Unlocking manually a few of the "Hidden Scenes"
Skipping the script that makes Dagger unlearn her summons
Make Mini-Theater Ship obtainable as a key item
Removing Excalibur II time condition manually
Making temporary characters available in the party menu (1)
Making temporary characters available in the party menu (2)
Changing properly the content of a chest
Ensure that characters enter the party at level 1
How to use "GetRandom" to generate a random number in a range
List of animation IDs and who use them
Declaring local and global variables in scripts
Typical NPC dialog script
Add NPC and PC on the field
Manually extracting a Beatrix mod out of Alternate Fantasy
How to mix some of the standard mods
A word about background and walkmeshes
HW format for text file batching
Helping with the development of HW
Bug when making a multi-hit spell animation (PSX)
Adding custom text font (PSX)
Using Memory card saves after modding (PSX)
Fixing "The Collector" Tetra Master bug (PSX)
Change the initial items + hex-hack to give supporting abilities to Beatrix (PSX)
MIPS editing + controlling someone else than Zidane in fields for PSX
Grudge's MIPS spell formula (PSX)
Using the Background Editor (Steam)
Properly adding a new enemy to a battle (Steam)
Removing (some of) the bubbles appearing when you get close to NPC on Steam
Removing the stat growth of characters (Steam)
Modding Magic Stone growth of characters (Steam)
Modding spell effect: explanation (Steam)
Modding Supporting Abilities: HP/MP +X% (Steam)
Modding Supporting Abilities: Auto-status and Immunes (Steam)
Skipping the last two cinematics of the game (Steam)

//================ BONUS =================//

Simplified Game Scripts

Here are some scripts of systems or mini-games that are of some interest if you wish to know how the game works in-depth.
FFIX Code Folder

Hidden dialogs

Here are some few interesting secret dialogs, never used in the game.
I've also made a patch to enable some of them in-game :
Hidden Dialogs (PSX)
Hidden Dialogs (PC)
And a video showing the patch's content.

Don't hesitate to tell me if you find more unused dialogs : I'll add them to the list ^^

Alexandria [Over the roofs...] :
Puck “So, Vivi... Is this your first time in Alexandria?”
Vivi “Uh...  Um...  Yeah. I bought my ticket from a moogle wearing a hat...”
Puck “Bad luck!  If I ever find that moogle, I'll hurt him plenty!”
Vivi “Uh... Thanks...”
Puck “Alright!  Just a little farther 'til we can see the stage!”

Ruined Prima Vista [Steiner's bitterness] :
[1/3]
Steiner “Those bastards... If they plan to demand a ransom, they're wasting their time.  I'll see to it that they receive nothing!”
[2/3]
Steiner “Wretched thieves... I'll see them all hanged!”
[3/3]
Steiner “Those bastards... They will never get away with this!”

Observatory Mountain [Good and Evil with Grampa Morrid] :
Steiner “Alexandria, off course! Burmecia started the war, and we lost our king as a result.”
Morrid “Many wars were fought before the Lindblum Airship Revolution.”
Morrid “Alexandria intiated some of the wars against Burmecia. Now, can you tell me who was right or wrong?”
Steiner “I-I am not talking about the past! I am talking about the future!”
Morrid “What will you do if Alexandria starts a war?”
Steiner “When will the cargo ship arrive!?”

Gizamaluke's Grotto [Entering Burmecia] :
Burmecian Soldier “This is the Gizamaluke's Grotto. It is Burmecia's border.”
Burmecian Soldier “No one is allowed inside without the king's permission.”

Cleyra [Meeting with the King and the High Priest] translated from japanese by luksy :
Freya “It has been some time, Your Majesty.”
King of Burmecia “Ah, Freya, well met.”
King of Burmecia “The High Priest and I welcome you.”
High Priest of Cleyra “My Lady.”
High Priest of Cleyra “It would appear that this predicament no longer concerns Burmecia alone.”
Freya “I understand, Your Holiness.”
Freya “And yet...”
Freya “I fear my strength alone may not suffice.”
King “Freya...I know what troubles you.”
King “I must apologize for earlier.”
King “Can you ever forgive me?”
King “No! off course you cannot.”
King “But the fate of the people of Burmecia now hangs by but a thread.”

Occupied Lindblum Castle [Reaching Cid] :
Don't get caught by the enemy!
Jump out when she looks away!
Man “The regent is waiting for you at the Base Level.”
Man “The enemy is busy loading supplies. Go down on the lift, now!”
Man “Once you get on the lift, my comrades will take care of the rest.”
Zidane “So, I just take the lift to the Base Level without getting caught?”
Yeah...
Zidane “Piece o' cake! Leave everything to me.”
Huh?
Is anybody there...?
A tail?
Meeow!
Oh, it's only a cat...
Zidane (Wow, that was a close one.)
Man “(You idiot!)”
Man “Whatever you do, don't get caught!”
Man “What's wrong? The regent is waiting at the Base Level.”
Man “Go now, or you'll get caught!”
Zidane “I gotta run while she's looking away.”

Occupied Lindblum Castle [The Ancient World Map] :
Regent Cid “That is a national treasure of Lindblum!”
Regent Cid “It was passed down through my ancestors, since the days of the first regent.”
Regent Cid “It was probably made before our continent was covered in the Mist...”
Regent Cid “That is an ancient map of the entire world!”

Alexandria [Balloon Mini-game] translated from french by me :
Girl “You want to play with us?”
Girl “You've got some time to gather balloons and give them to the boys behind us!”
Girl “You get more time depending on the color of the balloon that you bring.”
Green → 5 more seconds
Yellow → 10 more seconds
Blue → 15 more seconds
Red → 30 more seconds
Girl “All the three of us have a balloon and we are somewhere on the square.”
Girl “Well... Start!”
Boy “X more seconds! You have Y points!”

Final [The 2 worlds' fusion] :
The Iifa Tree could not be stopped...
Gaia and Terra's fusion
caused global chaos,
destroying many cities and
taking many lives...
« Last Edit: 2017-10-14 13:29:18 by Tirlititi »

xenokain

  • Cool newbie
  • *
  • Posts: 61
  • Karma: 2
    • View Profile
Re: [FF-IX] Hades Workshop
« Reply #1 on: 2013-06-06 21:31:18 »
link not working :/

Tirlititi

  • Insane poster
  • *
  • Posts: 420
  • Karma: 55
    • View Profile
Re: [FF-IX] Hades Workshop
« Reply #2 on: 2013-06-06 21:36:56 »
Fixed, I added quotes around the link but it wasn't needed...  :roll:

Thanks for warning !

xenokain

  • Cool newbie
  • *
  • Posts: 61
  • Karma: 2
    • View Profile
Re: [FF-IX] Hades Workshop
« Reply #3 on: 2013-06-06 21:37:32 »
Thanks  ;) by the way im sure you can add the .dll into the program when building it. Some people choose to leave them out because it makes the program bigger i believe. I've heard of "external dependencies" when building source code so im sure you can choose to have it built into the program or make it so you can get the .dll seperately. Not sure how Codelite + wxFormBuilder works though.
« Last Edit: 2013-06-06 22:00:04 by xenokain »

JBedford128

  • Cool newbie
  • *
  • Posts: 98
  • Karma: 5
    • View Profile
Re: [FF-IX] Hades Workshop
« Reply #4 on: 2013-06-07 14:47:42 »
Well, this saves me time trying to make my own program with my very limited knowledge on reading from files.

You may want to look at this. I noticed you are missing some of the stats.

Also I haven't figured out the statuses yet. I know some relate to class (Aerial enemies are immune to Float, for example). And I haven't found where the Card is stored. But I imagine the Card drop might be based on the encounter/formation and not just individual enemies. I don't know where the formation data is so I haven't looked around. Also I see where the attack data is probably stored (after the enemy stat data) so this guide may prove useful if you plan on figuring that out.

I assume what the program calls CP is actually AP?

I also think it would be useful if you still gave the number of the formation. So on Disc 1, the Beatrix battle is file0, so having it say "0: Beatrix" would be a help.

But anyway, I love you for doing this. This is extremely useful.

NFITC1

  • No life
  • *
  • Posts: 2762
  • Karma: 61
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: [FF-IX] Hades Workshop
« Reply #5 on: 2013-06-07 14:56:13 »
Thanks  ;) by the way im sure you can add the .dll into the program when building it. Some people choose to leave them out because it makes the program bigger i believe. I've heard of "external dependencies" when building source code so im sure you can choose to have it built into the program or make it so you can get the .dll seperately. Not sure how Codelite + wxFormBuilder works though.

Depends on the library. If the source is open you can copy what you need into your project. Otherwise, it's safest to distribute the library with it as it may have external dependencies as well. Honestly, size doesn't matter so much anymore. Back before Harddrives were less than 10 GB it would be important to cram as much into as little as you could. Now it's hard to find a machine with less than 80 GB which is more than enough for most people (although my 2TB machine is more than half full :) ).

Tirlititi

  • Insane poster
  • *
  • Posts: 420
  • Karma: 55
    • View Profile
Re: [FF-IX] Hades Workshop
« Reply #6 on: 2013-06-07 16:15:04 »
Many thanks for the links, JBedford128. I didn't see this topic before ! Very useful.
About enemies' attacks, I know some things about it but the datas are splitted everywhere and particulary in the script file for the AI (that includes which monster uses which attacks...). I still lack knowledge on scripts, though I got some opcode values.
Yeah, maybe the card drop is in the enemy formation, there are a couple of bytes I don't know in it.
And yes, CP -> AP. CP is the french thing and I messed up ^^'.

Quote
I also think it would be useful if you still gave the number of the formation. So on Disc 1, the Beatrix battle is file0, so having it say "0: Beatrix" would be a help.
Okay, I'll add that.

I'm quiet sure there is a simple way to remove the dll dependancies (it should be an option passed to the compiler) ; my attempts to do it just didn't work  :(

Next version will be focused on being able to overwrite datas. It'll be limited anyway but I'll try to make it as full as possible.

NFITC1

  • No life
  • *
  • Posts: 2762
  • Karma: 61
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: [FF-IX] Hades Workshop
« Reply #7 on: 2013-06-08 02:14:40 »
I'm quiet sure there is a simple way to remove the dll dependancies (it should be an option passed to the compiler) ; my attempts to do it just didn't work  :(

I don't think dll embedding is possible. I do enough assembly and disassembly to know that there's not a simple flag to tell a compiler to rip the code out of a library and mesh it with your code. There are lots of reasons this would not work. Unless you can get the source code of these libraries in your target language then I wouldn't think about integrating it into a single executable. I could give lectures about why trying to do such a thing is bad practice, but I'll spare you if you just trust me when I say you shouldn't.

xenokain

  • Cool newbie
  • *
  • Posts: 61
  • Karma: 2
    • View Profile
Re: [FF-IX] Hades Workshop
« Reply #8 on: 2013-06-08 05:44:14 »
I think its better you keep it the way you have it with the .dll files just added to the rar/zip. you can always make the dll part a last priority (you can come back to) once you feel the program has developed enough.

Tirlititi

  • Insane poster
  • *
  • Posts: 420
  • Karma: 55
    • View Profile
Re: [FF-IX] Hades Workshop
« Reply #9 on: 2013-06-10 17:06:28 »
Updated. I've update the link in the first post so you don't have to search the last version through the topic.

The program may now overwrite datas directly in the binary file. Be careful because you can't unedit what you've done. I'm planning to add a system that saves a backup of the original datas in the .hwf file (when you open the file for the first time) but that's not done yet.
I also fixed that "fatal error" message when you exit the program.

About what you can edit, what you can't edit and what is limited (long boring post incoming :P) :
- texts are limited both in size and in printable characters. You may only use characters from the US/EU char table (link) and size is limited to what the size initially allocated for all the datas of the same type. For instance, in the US version, there is a size of 1608 characters for ALL the spells names (including the terminating character, so it actually does 1416). In general, there is only up to 3 extra characters so you will most likely have to remove the names from other spells to get some space.
- You can't edit the enemy names yet (there is a way to have more space for them but that will be for another version).
- Commands spell lists are also limited. You may link 2 commands to increase the limit (they would share the same spells). White Magic and White Magic+ are linked by default, as well as Black Magic and Black Magic+ but you can link Dagger's eidolons (trance and normal) and the 2 Beatrix Seikens (dunno why there is 2 of them) so you win 12 spells to put anywhere for free.
- Editing commands don't change the spell list in the menu (only in battle). It doesn't add AP requirement to the character either, so he can use it without having to learn it.
- I added the "Model ID" field to the enemies, but that's more for testing and curiousness than for real use. I'm pretty sure it won't be simple to change the model. I haven't test it yet though.
- You can't change the enemy groups, apart from its frequency and the AP it gives. It would be safe to remove an enemy from a group but any other change would have bugging results.
- You can add up to 32 items to a shop, period.

I removed the "Targetable" flag. I thought it were used by things like the battle with Steiner and the Bomb behind him but that's not even the case. Since it's more something that deals with the battle's script, I'll leave it out for now.
I also added names to the shops. It may be inacurrate for the weapons and armors shops and it is imprecise for the item shops. If someone can confirm the last one is the Zorn and Thorn's shop right before Oeilvert, it would be nice of him.

I'll stop searching for removing the dll dependancies, then. That's not a priority either, as you said, xenokain ^^

Oh, and I added the numbers in the enemy list. I'll make it optional in the following versions, though.
« Last Edit: 2013-06-10 17:11:34 by Tirlititi »

xLostWingx

  • Freak
  • *
  • Posts: 800
  • Karma: 8
  • No Comment
    • View Profile
    • FFVII Lost Wing Mod/Hacks
Re: [FF-IX] Hades Workshop
« Reply #10 on: 2013-06-10 18:43:14 »
Love to see work being done with IX  ;D Keep up the good work man.

shikulja

  • Fast newbie
  • *
  • Posts: 34
  • Karma: 0
    • View Profile
Re: [FF-IX] Hades Workshop
« Reply #11 on: 2013-06-10 23:55:01 »
it is very cool). add image extractor and simple chars font editor. like chenge ierogliphs on other chars.

xenokain

  • Cool newbie
  • *
  • Posts: 61
  • Karma: 2
    • View Profile
Re: [FF-IX] Hades Workshop
« Reply #12 on: 2013-06-11 01:32:08 »
Thanks for the updates  ;D This is extremely useful.

JBedford128

  • Cool newbie
  • *
  • Posts: 98
  • Karma: 5
    • View Profile
Re: [FF-IX] Hades Workshop
« Reply #13 on: 2013-06-11 17:36:02 »
I've noticed something strange with some bosses. They are displayed as having 10000 HP more than they actually have in the game. This explains why I couldn't find Ozma in the data when searching for his HP, and it also explains why Ozma has 55545, 10000 less than the upper limit.

There obviously is a flag that does this. Friendly Yan proves that 65535 HP is possible. So a flag removes 10000 HP from the given amount, which I can't think of any good reason for.

Edit: Well I think I might have found it. Before the HP value there is a string of 0s (in hex). But I noticed that both Beatrix and Prison Cage had an 80 (so 80 00 00 00 before the HP value). So I changed the 08 to 00 for Prison Cage, and used Death. And Death killed it. I didn't see its HP count though. So that might have just been some statuses that I changed. (additional note: Using Death on Prison Cage causes a game hang).

Edit2: Doesn't effect HP, but does effect some status immunities.
« Last Edit: 2013-06-11 18:25:43 by JBedford128 »

Tirlititi

  • Insane poster
  • *
  • Posts: 420
  • Karma: 55
    • View Profile
Re: [FF-IX] Hades Workshop
« Reply #14 on: 2013-06-11 19:14:57 »
Nonono, that's not that, that's AI-relevant.

When an enemy dies, he just dies, but some bosses (like Ozma, or even the very first Masked Man) actually have a more complex dying animation, which is in fact a spell (Maliris's ending movement is the only one that actually does something). So they have a scripted event : "When they have less than 10000hp, the ATB pauses, they cast a spell and then they die". There is a part of the hexa code about what I think is the event setup for Masked Man's battle :
Code: [Select]
05 D6 1E 0E 7F 02 EE 00 05 79 01 29 24 7D 10
27 1E 2A 7F 02 08 00 05 D6 1F 7D 01 00 2C 7F
10 27 = 10000.
05 is the variable assignement opcode, so it's only about setup (38 is the opcode for an enemy to cast). I don't know a lot about how variables are coded but you can assume the opcode 05 is 7F-terminated. I don't know for sure what 02 is but it seems to be a sort of a JUMP opcode (01 is also JUMP, though...).

Ok, I just saw your 2nd edit. That's a good thing to know nonetheless, thank you :D

EDIT : Ha, sorry, that's not Masked man's battle, that's beatrix's battle. I just went confused with "1st battle in the game" and "1st battle in the battle list"  :oops:
« Last Edit: 2013-06-11 19:38:15 by Tirlititi »

JBedford128

  • Cool newbie
  • *
  • Posts: 98
  • Karma: 5
    • View Profile
Re: [FF-IX] Hades Workshop
« Reply #15 on: 2013-06-11 20:35:38 »
Oh, that makes a lot more sense. ^_^

Death is tied to this, as both worked on Parasite Cage when I set it to 00. It also allowed Scan to work (it just seems to Miss otherwise), which allowed me to see the true HP. Everything else was Guarded (but I didn't test Venom (no player ability natively has it) or Vanish (which natively targets only allies)).

I don't understand Eat's relationship to it. I could Eat Parasite Cage (well, i didn't (i don't think i could given its HP), but it said "I can no eat until weaker"), but for Garnet it just plain said "I no can eat".

Edit: Oh wait, Garnet gets immunity from Eat because she is of the Humanoid class. Remove the class and she can be Eaten.

So I did some more digging.

Part of the enemy file:
----------------
00 00 00 00 [first-status-set. Status immunity]
00 00 00 00 [second-status-set. Status evasion, and sometimes auto-status]
00 00 00 00 [third-status-set. Status at beginning of battle/sort-of auto-status]
00 00 [HP]
00 00 [MP]
--------------------

Now, with regards to the status immunities:
Byte1 (01=Break, 02=Venom, 04=Virus. 08=Silence, 10=Blind. 20=Annoy, 40=Zombie, 80=??)
Byte2 (01=Death (but not Eat), 02[messes up targetting?], 04=Confuse, 08=Berserk, 10=Stop, 20=Auto-Life, 40=??, 80=Defend)
Byte3 (01=Poison, 02=Sleep, 04=Regen, 08=Haste, 10=Slow, 20=Float, 40=Shell, 80=Protect)
Byte4 (01=Heat, 02=Freeze, 04=Vanish, 08=Doom, 10=Mini,20=Reflect, 40=???, 80=Gradual Petrify)

It's the same statuses with all three sets of status thingies. 80000000 seems to do nothing, but the third-status-set uses 80000000 as a Death immunity. 00020000 is odd as an immunity. I'm not sure I could actually hit the enemy with it on.

So the first-status-set is Guard immunities.

The second-status-set work the same as immunities, but instead of saying "Guard" it says "Miss". Its other benefit is auto-statuses. The ones I've noted are Auto-Float, Auto-Haste, Auto-Reflect, Auto-Slow, Auto-Berserk, Auto-Poison, and Auto-Regen. I didn't go through each one individually, since I got the gist, so there may be more. However, I think Auto-Poison may be purely cosmetic. Unless I've forgotten how Poison worked, I sat waiting for the enemy to take damage but never did. I also suspect Auto-Slow may be cosmetic. I do know that Auto-Reflect works though.

There is also something interesting about Auto-Haste and Auto-Slow. When both are on, both the Haste and Slow indicators will appear next to the enemy. If one is on, and the one that is not on is inflicted on the enemy, both indicators appear then also. This could just be evidence that both are cosmetic and do not function as Auto-Statuses. But I don't know for sure.

The third-status-set inflicts the status at the start of the battle, however the effectiveness of this changes:
-If Stop is a selected status, then it can be removed. Unlike the second-status-set, there's no forced Miss.
-If a status is a temporary status (is removed after a duration) then the status does not stick. A graphic will be seen on start-up but that's it.
-For the countdown statuses, the countdowns are removed. If Doom is a selected status, the enemy will get Death instantly.
-00400000 seems to be Trance. The Masked Man was glowing, but it didn't do anything.
-00010000 and 00000040 have the enemy disappear and commands are never completed.
I also looked at other unknowns in an attempt to find out what they were. The two-bytes after the Animation IDs: Only of the bits in these bytes seems to do anything. "01" makes Prison Cave (the enemy I was testing on at the time) invisible.
-80000000 is the oddest. As discussed before, this is what bosses have. It Guards Instant Death, it makes Scan Miss, it makes Eat Miss (No can  eat), and a new revelation is that it makes Demi Miss too.

Also, after the Steal data, there are two unknown bytes, and then another set of two unknown bytes. For that second set of two unknown bytes, I set it to FF and it meant that when my characters attacked, they actually passed through the Prison Cage and attacked behind it. So these bytes may decide which part of a model the characters should attack.

Additionally, further down, the seventh and eighth bytes after the bytes deciding Blue Magic: These dictate where the cursor appears in relation to the enemy. I switched it to FF and it made the cursor jump all over the screen, but I also set it to a more stable figure that moved the cursor a couple feet upward from its original position. Additionally, my characters attacks towards the cursor. So this is like the bytes I mentioned before, except the offset effects the cursor too, which is not the case for the other ones.

Sorry if any of that wasn't clear, I'm not good with explaining things or words.
« Last Edit: 2013-06-12 13:47:17 by JBedford128 »

Tirlititi

  • Insane poster
  • *
  • Posts: 420
  • Karma: 55
    • View Profile
Re: [FF-IX] Hades Workshop
« Reply #16 on: 2013-06-13 01:13:57 »
It's clear enough, thanks.
I know a bit more than what the programs currently displays. I'll try to write it down.
The Enemy Chunk data has an ID of 10 and begins like every other chunk (see the wiki for that).
Then there is the "groups" datas :
Code: [Select]
1 byte Unknown
1 byte NbGroups
1 byte NbEnemyTypes
1 byte NbAttacks
2 bytes Battle Flags
2 bytes Unknown

Then comes [Nb Groups] times this :
Code: [Select]
1 byte Group Frequency
1 byte Nb Enemies
2 bytes Engaging camera ID
2 bytes AP
2 bytes Unknown
[
1 byte Enemy ID
1 byte Targetable Flag
2 bytes Unknown
2 bytes Position X
2 bytes Position Z
2 bytes Position Y
2 bytes Facing Angle
] (x4)

Then come the enemy's stats (the part you investigated). There are [NbEnemyTypes] of them (thx to you : I didn't know the purpose of the first 12 datas) :
Code: [Select]
4 bytes Status immunity
4 bytes Status evasion/auto-status
4 bytes Status initial cast
2 bytes HP
2 bytes MP
2 bytes Gils
2 bytes Exp
4 bytes Drop Item
4 bytes Steal Item
1 byte Unknown
1 byte Collision size (it tells how large some effects must be, such as scan)
2 bytes Aiming position, as you said (though I don't know more how it should be interpreted)
2 bytes Model ID (thx Zande for this and the followings)
2 bytes Animation ID 1
2 bytes Animation ID 2
2 bytes Animation ID 3
2 bytes Animation ID 4
2 bytes Animation ID 5
2 bytes Animation ID 6
4 bytes Unknown
2 bytes Attack Power
1 byte Speed
1 byte Strength
1 byte Magic
1 byte Spirit
4 bytes Unknown
1 byte Elemental guard
1 byte Elemental absorb
1 byte Elemental half
1 byte Elemental weak
1 byte Level
1 byte Class
1 byte Unknown
1 byte Physical defence
1 byte Physical evade
1 byte Magic defence
1 byte Magic evade
1 byte Blue magic
2 bytes Unknown
2 bytes Cursor position (not the one you mentioned but pretty much the same thing if I remember well)
2 bytes AKAO death ID (sound when he dies)
2 bytes Cursor position (the one you mentioned)
16 bytes Unknown
2 bytes Shadow Gap Y (didn't investigate it...)
7 bytes Unknown
1 byte Drop card
10 bytes Unknown

Finally come the attack stats. [NbAttacks] times this :
Code: [Select]
1 byte Unknown
2 bytes Model ID (though it seems unused ; the real model ID is in the 0x11 chunk file with the attack animations)
1 byte Unknown (often 1F or 5F)
1 byte Effect
1 byte Power
1 byte Element
1 byte Accuracy
1 byte Flags ("use reflect", "is magic" and I don't know the others, unfortunatly :/)
1 byte Status
1 byte MP cost
5 bytes Unknown
And finally, 4 bytes end the whole thing, but I don't know what it might be.

About opcodes, since that's the most interesting thing I would want to hack next. Here is what I know :
The arguments of most opcodes can be either raw values or variable codes. A variable code is a list of variable operations terminated by 7F. I won't list operations here but there is a sample :
Code: [Select]
D40D 7D0200 20 D809 7D0000 18 27 7Fis translated into :
Code: [Select]
( Var_D40D == 2 ) && ( Var_D809 < 0 )20 is the == operation, 18 is the < operation and 27 is the && operation and 7D announce a short numerical value. So it is read like that :
Code: [Select]
D40D 7D0200 20 -> ( Var_D40D == 2 )
D809 7D0000 18 -> ( Var_D809 < 0 )
27 -> ( Var_D40D == 2 ) && ( Var_D809 < 0 )
The result is put on the stack (for a following conditional jump, for instance).

The list of opcodes and their effect (for those I know of) can be seen in the file "Hades_Strings.h" of the source code. I don't list them cause there are a lot of them...

I'll update this post if you or me find more informations. Now I just discovered that the US version and the french version have a huge difference : in the french version, some important datas are compressed (with a compression method called RNC) in a sub-file, making them impossible for me to edit. But that's not the case in the US version... So I guess I'll end up making this program only open the US version...
« Last Edit: 2014-06-01 10:27:40 by Tirlititi »

JBedford128

  • Cool newbie
  • *
  • Posts: 98
  • Karma: 5
    • View Profile
Re: [FF-IX] Hades Workshop
« Reply #17 on: 2013-06-14 16:16:11 »
The third set of status bytes do not have anything to do with immunity, they are just initial cast, and the status can be removed by standard means (like Remedy).

The fifth byte (first unknown byte, after number of attacks) of the data:
- 01 = When the battle ends in a non-standard way, do not continue battle.(used for bosses and friendly enemies--allows to continue fighting boss after death sequence if turned off)
- 02 = Always back attack
- 04 = [Unknown]
- 08 = [Unknown]
- 10 = no victory pose/no fanfare.
- 20 = cannot escape
- 40 = enemies are out of reach? (Masked Man could still hit me for full damage, i could not hit him)
- 80 = Cannot use magic (greyed out in menu, party members at least)
Sixth byte:
- 01 = Attacks take off a lot: I assume this is the Ipsen effect- weak weapons do more damage
- 02 = [Unknown]
- 04 = [Unknown]
- 08 = prevents the battle results screen.
- 10 = [Unknown]
- 20 = [Unknown]
- 40 = [Unknown]
- 80 = [Unknown]

Since my tests were against Masked Man I could have missed things, like if the unknowns were to effect EXP or Drop, or if the victory poses of some of the characters played or not (although it wouldn't make sense to decide that in the battle data- i thought the same about Magic block and the reverse weapons though).

For the first unknown (byte5) in Attack stats, you state it can only be 1F, but I have seen 5F frequently.

And I am using the PAL UK version and it seems to match up to the US version quite well. I've seen some differences, but most are translation.
« Last Edit: 2013-06-16 16:38:19 by JBedford128 »

Tirlititi

  • Insane poster
  • *
  • Posts: 420
  • Karma: 55
    • View Profile
Re: [FF-IX] Hades Workshop
« Reply #18 on: 2013-06-14 20:21:08 »
Ah, that's a good thing to know. I thought that RNC thing would be used by every european versions.
The header begins with "RNC\1" so if you search the hexadecimal sequence "52 4E 43 01" and find no results, it's sure that's not used. But I trust your test, it may just be a cleaner way to know it.
But for now, I don't seek datas written in this part of the file. That'll become a problem when I'll look for items, characters' stats and supporting abilities.

Thanks for testing the flags :)
I can't do as much testing as I would like to and I'm really grateful you take care of some. I'll release a new version soon, but I would like to make that backup system before.

By the way, the 3rd status set is used for death/eat/scan immunity, no? Even if it's only 1 bit. Also, what is break? You meant petrify?
« Last Edit: 2013-06-14 20:23:52 by Tirlititi »

JBedford128

  • Cool newbie
  • *
  • Posts: 98
  • Karma: 5
    • View Profile
Re: [FF-IX] Hades Workshop
« Reply #19 on: 2013-06-14 21:29:52 »
Oh yeah, I forgot about that one bit. :p

And by Break I do mean Petrify. Break is the name of the spell. I did the same with Annoy: the status is actually "Trouble" but at the time my main source for status name was ability name.

Also I think I've very likely found the value that stores the card. Dendrobium and Fang both store "01" (both holding the Fang card, the second card) in the byte, and Goblin stores "00" (Goblin card, the first), Beatrix stores "FF" (no card), and Ironite stores 08 and Basilisk stores 05, which match up.

Code: [Select]
16 bytes  Unknown
2 bytes   Shadow Gap Y (didn't investigate it...)
7 bytes   Unknown
1 byte    Card drop (00 to 63, FF is none)
9 bytes   Unknown

I'll confirm this in an edit later (EDIT: Confirmed. I had a Fang drop an Airship card).

Above you may notice that I dropped a byte from what you originally wrote. The total I wrote would be 35 bytes in this section, but you have 36.

So take the Goblin/Fang one for example: After Goblin, there are 36 bytes in this section, then Fang's enemy-block starts. For Fang, there are 35 bytes in this section before the Attacks/Abilities block starts.

So there is an additional byte here between two enemies in the same scene? Or am I missing something?
« Last Edit: 2013-06-14 22:26:47 by JBedford128 »

Tirlititi

  • Insane poster
  • *
  • Posts: 420
  • Karma: 55
    • View Profile
Re: [FF-IX] Hades Workshop
« Reply #20 on: 2013-06-15 01:14:50 »
I checked again and I think you miscalculated.
That does 116 (0x74) bytes for all the stats.

JBedford128

  • Cool newbie
  • *
  • Posts: 98
  • Karma: 5
    • View Profile
Re: [FF-IX] Hades Workshop
« Reply #21 on: 2013-06-15 01:43:37 »
Here's what I'm seeing:
Code: [Select]
[end of Goblin]
09 09 09 09 09 01 f9 00 ff 02 ff ee 01 00 f6 f9
fc 00 17 00 b6 00 b4 00 01 00 00 00 00 00 01 00
00 00 00 00                          [36 bytes]

[Fang]      04 e0 00 44 00 00 00 00 00 00 00 00
44 00 aa 00 5a 00 17 00 ff f4 f0 ff ec f0 ed f9
70 03 97 00 c9 06 c9 06 c1 06 cd 0d bd 06 bd 06
00 00 00 00 02 00 08 00 13 08 08 0a 10 00 00 00
00 00 00 01 01 02 64 0a 02 0a 03 00 09 00 13 00
82 00 03 00
           
            0d 0d 0d 0d 0d 01 fa 00 fd 00 fd f7
fc fc f6 f9 f9 00 83 00 ee 00 44 01 22 01 00 00
58 00 01 00 00 00 00                 [35 bytes]

[attack data]        00 00 00 fe 1f 08 08 00 64
2c 00 00 80 00 00 00 00 12 00 fe 1f 40 08 01 00
...............................................
The only explanation is the attack data is wrong. It has one less byte near the start, and one more at the end. Because it says there should be four bytes before the "usually 1F byte", so I assume there should only be three.

If that were the case, it would also explain why I'm seeing five bytes that end the whole thing instead of four.
« Last Edit: 2013-06-15 01:46:47 by JBedford128 »

Caledor

  • Cool newbie
  • *
  • Posts: 70
  • Karma: 2
    • View Profile
Re: [FF-IX] Hades Workshop
« Reply #22 on: 2013-06-15 02:07:32 »
Finally someone showing some love for FF9! Can't wait to see this tool completed! :-D
By the way will it eventually be able to edit things other than magic names like weapon names and so on? And it is possible to avoid the char limit restriction for those sections?


Tirlititi

  • Insane poster
  • *
  • Posts: 420
  • Karma: 55
    • View Profile
Re: [FF-IX] Hades Workshop
« Reply #23 on: 2013-06-15 11:39:54 »
@ JBedford128 : Oh, yeah, the attack is wrong, I saw that when I implemented it but forgot to correct here (there is 1 byte less at start and I forgot the accuracy). Sorry.

@ Caledor : Yeah, weapons will be editable, but that's part of the datas that are compressed in some versions (if it only concerns the french version, that's not a big deal, though...).
I can't remove the char limit restriction for now. I can't even tell whether it is easy or would require deep restructuration of the file.
The only thing I can do for now is merging the names when they are the same. I guess I'll eventually do that.

Tirlititi

  • Insane poster
  • *
  • Posts: 420
  • Karma: 55
    • View Profile
Re: [FF-IX] Hades Workshop
« Reply #24 on: 2013-06-16 21:05:00 »
Update.
I added quiet a lot of stuff for enemies, some spell effects, fixed few bugs...
Also made the .ppf exporter. It does the same thing that a PPF creator, but much faster. The comparison is done between the changes you made and the file on the hard disk (so don't save before exporting the .ppf).

The enemies' spells animations are just there for information, they are quiet inaccurate or missing.

Now I'll take a break for a week.
« Last Edit: 2013-06-16 21:09:36 by Tirlititi »