Author Topic: Developing FF4kster: a comprehensive editor for FF4  (Read 246005 times)

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,682
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #450 on: August 28, 2013, 03:04:14 PM »
Hmm, looking back at the Ram Locations in the Bab-il Docs, it seems that there's a separate place of Ram being saved for a second character's auto-battle commands.

388C-3899 Autobattle script for first/only character
389A-???? Autobattle script for second character

I wonder if it's somewhat based on formation. After all the only auto-battle that includes two characters is the final one against Zemus and Zeromus if memory serves me correctly.

Now that is another thing with auto-battles you bring up. There are some slight pieces of information missing when it comes to events and battle events. I saw this when I was trying to fix Vivify's patch and setting the Zeromus event on the Training Guard. If you just go for it, switching the formations out, in the second (what would normally been an auto-battle) battle all of your characters will be dead. There is no instruction I saw that kills the party characters. Only after adding a character before the battle begins will that character not be dead.

In addition with Auto-battles Tellah's not the only one that works like this. Something somewhere removes the party members that are called by a specific formation, at least it seems that way. Cecil is required for the auto-battles on the Airship, Tellah is required for the auto-battle in Damcyan, Edward is required for the 1v1 WaterHag, Yang is required for the Mt. Hobbs Ambush, etc. The events leading up to these battles do nothing unusual though to wipe the party to assure this one character is there. Set any other normal formation and you will get just another battle.


Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #451 on: August 28, 2013, 03:16:29 PM »
To me that seems to imply that it's a feature of the formation whether it's hiding characters. Could it be one of the "mystery" values that we haven't already figured out? Perhaps it's handled somewhere else entirely?

 :hmm: Does the ending event actually add FuSoYa and Golbez to your party? If so what happens to the rest of the party? Like, how does it make room for them? If not, how are we having a battle with characters that aren't in our party?
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,682
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #452 on: August 28, 2013, 03:27:05 PM »
That was my first guess too but when I looked at them I saw nothing too out of the ordinary. Most other auto-battle event battles have the Mystery Byte set to 0 except for the two auto-battles against Zemus/Zeromus they are set to 1, but changing them to 0 doesn't do anything noticeable.

Now here is where things get interesting... it doesn't appear to load FuSoYa per se but loads what is in the 1st Shadow Slot. If you start the game and go straight for the Zemus fight Golbez will be fighting alone in a cycle of Fire 3, Ice 3, Lit 3, W. Meteo. Say if you add and immediately remove Tellah 1 from your party he will be fighting along Golbez in the Zemus fight because he is the actor currently in the 1st Shadow Slot.

This means that your party is still there... somewhere but this formation specifically calls Shadow Slot 1 and Golbez's actors, despite them not being in your active party. This is admittedly the only instance of this as far as I recall.



This means that Golbez must similarly be loaded from some sort of 5th Shadow Slot, I would imagine.
« Last Edit: August 28, 2013, 03:35:13 PM by Grimoire LD »

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #453 on: August 28, 2013, 03:37:56 PM »
Found something else interesting, I added a fight at the beginning of the opening sequence with the Bard. If I add Tellah to the party before the fight, it's Tellah alone vs Bard. If I add Kain to the party instead of Tellah (so, no Tellah in the party at all), the game hangs when the battle starts. This implies that something is checking for Tellah specifically.

Now here is where things get wonkee. I changed all the encounters in the section of the overworld around Baron to the Bard fight and loaded a save with just Cecil and Kain (no Tellah). They fought the battle normally, no one hidden, but both were executing Tellah's autobattle script for that fight! That could imply that there's something checking whether the battle was launched by an event...
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,682
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #454 on: August 28, 2013, 05:48:10 PM »
Alright! I think I found the index! I placed a Read breakpoint on the Encounter index (7E1800)  started up my ready-made Zeromus event and when I did it started to CMP the value of the encounter through listings starting from 00E516 in ROM. starting with F700 which is the Dark Knight vs. Paladin battle, then continued down the list...

In RAM at...

(Note to Self: Always add +1 to hex 1B3 = 435 + 1 = Formation 436

E516 - F700 (248) - Fabul Siege Formation (Oh, I see! Rydia is never removed from the party in this event, but these formations are special so she doesn't appear.) (Edward-Yang-Cecil)
E518 - F800 (249) - Fabul Siege Formation (Edward-Yang-Cecil)
E51A - F900 (250) - Fabul Siege Formation (Edward-Yang-Cecil)
E51C - F100 (242) - Cecil vs. Kain (Cecil)
E51E - EE00 (239) - Tellah vs. Edward (Auto-Battle) (Tellah)
E520 - F600 (247) - Paladin vs. Dark Knight (Paladin Cecil)
E522 - EF00 (240) - Edward vs. WaterHag (Edward)
E524 - F000 (241) - Yang vs. 3 Imp Captains (Auto-Battle) (Yang)
E526 - F300 (244) - Tellah vs. Golbez (Auto-Battle) (Tellah)
E528 - FD00 (254) - Edge vs. Rubicant (Auto-Battle) (Edge)
E52A - A801 (425) - Adult Rydia vs. Golbez (Rydia) (UNUSED!)
E52C - 01B3 (436) - Golbez and FuSoYa vs. Zemus (Auto-Battle) (Golbez-Shadow Slot 1)
E52E - 01B4 (437) - Golbez and FuSoYa vs. Zeromus (Auto-Battle) (Golbez-Shadow Slot 1)

In ROM at...


6716 - F700 (248) - Fabul Siege Formation (Oh, I see! Rydia is never removed from the party in this event, but these formations are special so she doesn't appear.) (Edward-Yang-Cecil)
6718 - F800 (249) - Fabul Siege Formation (Edward-Yang-Cecil)
671A - F900 (250) - Fabul Siege Formation (Edward-Yang-Cecil)
671C - F100 (242) - Cecil vs. Kain (Cecil)
671E - EE00 (239) - Tellah vs. Edward (Auto-Battle) (Tellah)
6720 - F600 (247) - Paladin vs. Dark Knight (Paladin Cecil)
6722 - EF00 (240) - Edward vs. WaterHag (Edward)
6724 - F000 (241) - Yang vs. 3 Imp Captains (Auto-Battle) (Yang)
6726 - F300 (244) - Tellah vs. Golbez (Auto-Battle) (Tellah)
6728 - FD00 (254) - Edge vs. Rubicant (Auto-Battle) (Edge)
672A - A801 (425) - Adult Rydia vs. Golbez (Rydia) (UNUSED!)
672C - 01B3 (436) - Golbez and FuSoYa vs. Zemus (Auto-Battle) (Golbez-Shadow Slot 1)
672E - 01B4 (437) - Golbez and FuSoYa vs. Zeromus (Auto-Battle) (Golbez-Shadow Slot 1)

Hopefully I'll be able to find the party make-up and requirements to play the chosen formation.

 :edit: I can confirm that positioning is a large part of this. I switched 01B3 and 00F1 and only Cecil appeared to fight Zemus (normal auto-battle carried out from there) 00F1 is the Cecil vs. Kain fight, which would make sense that Cecil would be alone. This means that the party is set before the formation number is found, hmm...

 :edit: 2: Hmm, so right above these values are values that Must correspond to "treat actor special".

E509 - 03 - Child Rydia - Hide during Fabul Fight
E50A - 03 - Child Rydia - Hide during Fabul Fight
E50B - 03 - Child Rydia - Hide during Fabul Fight
E50C - 01 - Dark Knight Cecil - Only One Present fighting Kain
E50D - 04 - Tellah 1 - Only One Present fighting Edward
E50E - 0B - Paladin Cecil - Only One Present fight Dark Knight
E50F - 05 - Edward - Only One Present fighting WaterHag
E510 - 07 - Yang 1 - Only One Present fighting Imp Captains
E511 - 0C - Tellah 3 - Only One Present fighting Golbez
E512 - 12 - Edge - Only One Present fighting Rubicante
E513 - 11 - Adult Rydia - Hide during Golbez vs. Party fight
E514 - 13 - FuSoYa - One of Two Present fighting Zemus
E515 - 15 - Golbez - One of Two Present fighting Zemus

But I've already seen first hand that it refers to the first Shadow Slot for FuSoYa's Zemus formation in particular so I have to wonder if these are even used...?


 :edit: 3: Phew, my money was right on the mark. They are thankfully the Only One Present or Hide commands for each special party battle, Except for the final battle's special battles. I have No idea where the game draws those, but nulling them or changing them in anyway does absolutely nothing. However the others work as you would expect change the Tellah ID of 04 to 01 to have Dark Knight Cecil beat up on Edward, for instance.

I think it's fairly clear that the normal matters are ignored for the 13 and 15, since one it's not FuSoYa it is grabbing but Shadow Slot 1 and 2, Golbez is not even in your party therefore the game should lock up when trying to access it. There is something very special going on in that particular scene, but I can't quite reason it out.

But that does solve that, looking forward to seeing Auto-battle and Special Battle's incorporated into the editor!

 :edit: 4: Slight addendum due to new information found below in regards to Rydia vs. Golbez.
« Last Edit: August 29, 2013, 10:09:23 AM by Grimoire LD »

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,682
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #455 on: August 28, 2013, 10:17:52 PM »
Double-Post: Humongous update to the previous posts, with the info. required to have the desired PC's take part in special battles. (Except for the final Zemus fights)

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,266
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #456 on: August 28, 2013, 11:33:21 PM »
Good stuff, Grimoire. I hadn't even considered trying to edit special battles, but being able to do so will really help flesh out the story of a hack.

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #457 on: August 29, 2013, 05:11:53 AM »
Awesome work Grimoire! This is fantastic! Only one question though... how does it indicate whether the actor in question is "hide only me" or "hide everyone except for me"?

There's also the question of how it's handling the multi-actor script issue, since right now my script reading routine assumes each script ends at the first FF so it's not reading Golbez' scripts at all.
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,682
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #458 on: August 29, 2013, 08:56:45 AM »
I haven't yet taken a good look at how the behaviors of the scripts are carried out, only that those ID's mean those in that specific event, I'll take a look later on.

As for the second AI script, here is where things get... weird. I changed the values around from one of the Fabul formations to the Final Battle's formations and though I had Cecil and Edward in my party they kept on doing Only FuSoYa's Auto-Battle Script, never Golbez.

This leads me to believe that there is something special to Golbez's actor which tells him and Only him to use the second scripts of Auto-Battle commands.

If I could only figure out how the game calls a character never in the party, I might be able to make more sense of it....

 :edit: Alright, so I figured out how the game decides "Hide" and "Only One". Child Rydia's ID alone have a CMP that is passed through CMP 03. If this CMP is triggered only that character is hidden.

In RAM this is at...

0xE410 - CMP 03 - Rydia's ID
0xE453 - CMP 03 - Rydia's ID

In ROM at....

0x6610 - CMP 03 - Rydia's ID
0x6653 - CMP 03 - Rydia's ID

You may switch these to whatever you please to hide that specific ID during Special Battles, when they're the "unit specially effected".

 :edit: 2: I expected to find Adult Rydia's ID but there might be something else going on there... There is no CMP for 11, Adult Rydia's ID, as far as I can see.

 :edit: 3: Hmm, if I switched instances of Encounters as in Tellah vs. Bard to the slot which should in theory hide Adult Rydia, Golbez vs. Party she's the only one present, I'm not really sure what's going on there.

 :edit: 4: Even if I Force load the Formation of Golbez/Shadow Dragon Rydia still appears to be the only one. (Incidentally the game softlocks at this point. I wonder if this somehow deals with the Paladin CMP's I saw earlier...)

Nope, not one bit... I can't figure out why this is treated so special or how the game actually hides Adult Rydia since by all accounts Adult Rydia should be the only one appearing according to the byte.

 :edit: 5: Stupid repeated, broken battles, grumble, grumble... I was looking at the wrong Golbez/Shadow Dragon formation. No idea though why only Rydia appeared still despite the wrong formation number.

When set correctly it works fine Rydia is not present. But I think there might be something wrong with the Rom I have been using.

 :edit: 6: No, Rom was fine, a clean one did the same thing, hmm... I start the fight and Cecil raises his hand in the air and Golbez doesn't do anything, despite this being his Underground Formation as well. I might just have to use the actual event.

 :edit: 7: Yeah there is something really special about this formation which makes it not function properly outside of its proper place... for some reason, it's strange. In any case forcing the event call to play the Meeting Giott, having Rydia Join works fine.

Oh. I see. That "wrong formation", I was complaining about? That double Golbez/Shadow Dragon one? That's actually the unused one. 01A8 is unused by the game completely and may have been a remnant of earlier plans somehow. Now it just acts as the normal "Only One" battle. It may hint that Rydia was supposed to fight Golbez on her own (which is why Golbez is so terribly weak "dying" with only 3000 HP loss) originally before they added some sort of advanced script that hides her from likely within the battle itself.

So that means you can have one more kind of Special Battle.


« Last Edit: August 29, 2013, 10:06:52 AM by Grimoire LD »

5247846

  • Wing Raptor
  • *
  • Posts: 5
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #459 on: August 29, 2013, 09:14:37 PM »
I want to modify the FFIVCosmeticChanges2 ROM, but it freezes FF4kster.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,682
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #460 on: August 29, 2013, 09:18:12 PM »
It's likely an invalid version of the game, it's possibly unheadered and may not actually be compatible. Is there not also a patch of the Cosmetic Changes? Why not download that and apply it separately?

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #461 on: August 30, 2013, 05:18:13 AM »
I want to modify the FFIVCosmeticChanges2 ROM, but it freezes FF4kster.

FF4kster is not guaranteed to work on any rom other an FF2US v1.1 that either has not been modified at all, or that has been modified only by FF4kster. Changes made by a graphic editor should also be fine. However, any kind of miscellanous patch or usage of another editor, I can make no guarantees as to the behaviour of my editor. There are certain ones I know to be fine (my protect/shell patch, the "spell learning by first letter instead of index" patch, the long range bugfix, probably others) but it can't be assumed.

 :edit:
it's possibly unheadered and may not actually be compatible

Headered/unheadered is no longer an issue for FF4kster.
« Last Edit: August 30, 2013, 05:23:50 AM by Pinkpuff »
Let's dance!

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #462 on: September 02, 2013, 05:44:04 AM »
Hi folks, just a heads-up:

School starts for me tomorrow and thus I'm not sure how much time I'll have for working on this in future. I do still plan to poke at it in whatever spare time I happen to get though. Between all the wishlist topics and such it looks like I'll have a nice clear to-do list to pick and choose from at any given time, and on that note I want to thank everyone who put their time and effort into finding what they could on those topics. It's going to be a huge help and while it may take some time, this editor is going to be awesome (and of course the more info that's found in the meantime, the more awesome it will be ^_^).

I've already started brainstorming some ideas for an FF4 hack I'd like to make whose purpose is to show off all the different capabilities of FF4kster. That will be awesome too and it's helping to keep me motivated to finish this thing and have it be nice and polished in the end.
Let's dance!

Lenophis

  • Forum Overlord
  • *
  • Posts: 1,681
  • Gender: Male
  • I sad
    • View Profile
    • Slick Productions
Re: Developing a comprehensive editor for FF4
« Reply #463 on: September 02, 2013, 09:10:03 AM »
I'm going to sticky this topic, well, because.  :cycle:  If anyone has any objections, let me know and I'll unsticky this thing.

119 bugs fixed and counting.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,682
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #464 on: September 02, 2013, 09:32:45 AM »
Is going to be awesome? It is quite awesome as it stands, haha! Yes, classes start again for me as well. I have been fiddling around with a lot of ideas but I can never settle on an idea to develop enough to preview to the community. From a solo Black Mage mod to an After-After Years mod to trying to make a remake of the first dot hack game in the FFIV system, I think the main thing holding me back is maps for some of these ideas. Good luck in school though!