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

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #780 on: April 06, 2014, 06:37:04 PM »
That sounds great! If you need any assistance locating or expounding upon meanings in those locations, please let me know. Some of the targeting for the commands isn't really "there'. A lot of it is set from the individual routines.  And only the ones which I have mentioned before are the exception. Basically, anything that casts a spell can have its target changed. Everything else mostly uses the Fight/Kick Routine.

Sweet, thanks.

So do we know, for example, where to go to change, say, the spells cast by Twin and their probabilities? What about the messages that certain commands display (Aim, Charge, etc); I seem to recall those being found at one point if I'm not mistaken... and I think they could be turned off entirely too, correct? For the commands that require certain equips, can we change the ranges? Turn the requirement off entirely? My to-do list suggests a way was found to modify the status given by Jump, whatever that means... We can change the stat boosted by Boast but what about Charge? Can it double a different stat and/or change the amount it boosts it by?
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,676
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #781 on: April 06, 2014, 09:01:15 PM »
Those are all excellent questions! And the vast majority I have found the answer to.

Changing the spells cast by Twin is a very simple matter. You may even change the chance of failure. (It would change the instruction) and if so desired change That to cast a Third Spell instead of the "Failure" message. In reality its easier to cast Spells than it is to display Messages.

Changing messages is also rather simple, but will likely require a fine tooth comb to find and place each one through the fairly extensive notes. They can be turned off by disabling the command, yes.

You can change the status given by Jump and Charge, but both of their adjoining routines on completion get rid of the afflicted status of Jump and Charge. You could change it to something else, but that still wouldn't prevent the graphic for "Jump" from showing up.

Now equipment ranges for commands were found a long time ago and yes, it is easy to turn it off completely.

Charge doesn't actually boost a Stat. What Charge does is simply applies the status of Charge. There is something in the Fight Routine which looks to see if Charge is on the character and if it is to double the damage dealt (this is also the same routine for Jump as well) While you can change this. It won't do much to change what the Charge routine does... which is apply Charge.

In addition is who is set to Hide. We have the check for Paladin Cover, so it seemed also a good idea to put Auto-Hide as well.

In ROM at... Non-headered

Auto-Hide

0x1A607  - C9 05 (Character ID of the character that, if they happen to have Auto-Hide, will auto-hide even when their menu is shown)

0x1AD56 -  C9 05  (Character ID of the character that will Hide of its own volition when in Critical)

0x1AF0B -  A9 09 (The Command the Character who ordinarily Hides will perform on themselves)


Command Conditions and Equip Ranges


The possibilities are immense! Do you want to make magic require a Staff or Rod equipped? Or for Dark Wave to actually require a Dark Sword? How about a Whip to use Call, or Two Handed Weapon for Jump?

While there are plenty of possibilities, there's only three that can be utilized. You may change Dark Wave's limits to another command and restrict (or expand?) the range of which it can be used (In example, Require Rosa to use a Staff to use a (better?) Pray.)

And the same applies for the other commands! This opens up a lot for me and I hope it helps you all as well!


In ROM this is located at...

01A48E - C9 05 (Compare with Dark Wave's Command)
01A492 - C9 08 (Compare with Sing's Command)
01A496 - C9 0C (Compare with Aim's Command)
01A49A - C9 10 (Compare with Twin's Command)


01A4F8 - C9 61 (Right Handed - If the Weapon value is this or above this (or 00?) Dark Wave cannot be used)
01A504 - C9 61 (Left Handed -  If the Weapon value is this or above this (or 00?) Dark Wave cannot be used (May be Equipped Hand)

01A50E - C9 44 (Right Handed - If the value is this or above this, Sing can be used)
01A512 - C9 4D (Right Handed - If the value is this or above this, Sing cannot be used)
01A51C - C9 44 (Left Handed  - If the value is this or above this, Sing can be used)
01A520 - C9 4D (Left Handed - If the value is this or above this Sing cannot be used)

01A52A - C9 54 ( - If the value is this or above this Aim can be used.
01A52E - C9 61 (Right Handed - If the values it this or above this Aim cannot be used (Looking for Bow? This would hint that Aim can be used with two Arrows equipped or two bows... well I'll give it a shot... Yep. Looks like it's right. Aim can be used with Two Bows or Two Arrows. An interesting non-check. Good on the programmers.)

 :edit: 2 -

I've taken another look about the surrounding data and I noticed an interesting pattern...

03A2F3 - BD 33 20 (7E2033 the location of the character's Right Hand Weapon)
03A2F6 - F0 07 (???)
03A2F8 - C9 61 (Right Handed Dark Wave Ranges)


Twincast Probabilities...

It might be best to use WindHex and then change it's Displayed Offset to SNES LoRom. for these.

Golbez-FuSoYa Twincast

RAM

$03/E56E   BD 00 20   LDA $2000,x[$7E:2080]   A:0000   X:0080   Y:0005   P:envMxdiZc - Load Character 1's Character ID into A.
$03/E571   29 1F   AND #$1F   A:0089   X:0080   Y:0005   P:eNvMxdizc - -80 to A
$03/E573   C9 13   CMP #$13   A:0009   X:0080   Y:0005   P:envMxdizc - Is it FuSoYa?
$03/E575   F0 04   BEQ $04    [$E57B]   A:0009   X:0080   Y:0005   P:eNvMxdizc - If so branch to 03E57B.
$03/E577   C9 15   CMP #$15   A:0009   X:0080   Y:0005   P:eNvMxdizc - Is it Golbez?
$03/E579   D0 04    BNE $04    [$E57F]   A:0009   X:0080   Y:0005   P:eNvMxdizc - If not branch to 03E57F.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E57B   A9 5E   LDA #$5E   A:0015   X:0080   Y:0005   P:envMxdiZC - Load W. Meteo
$03/E57D   80 19   BRA $19    [$E598]   A:005E   X:0080   Y:0005   P:envMxdizC - Branch Always to 03E598.


Twincast 1/255 Failure...


03/E57F   20 93 85   JSR $8593  [$03:8593]   A:0009   X:0080   Y:0005   P:eNvMxdizc - Jump to Subroutine (where random number seems to be generated)
$03/E582   C9 FF   CMP #$FF A:008F   X:0011   Y:0005   P:eNvMxdizC - Was it FF (or higher)?
$03/E584   90 08   BCC $08    [$E58E]   A:008F   X:0011   Y:0005   P:eNvMxdizc - If not, branch to 03E58E.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
$03/E586   A9 11   LDA #$11   A:00FF   X:0033   Y:0007   P:envMxdiZC- Load x11 into A. (Failed Message)
$03/E588   8D CA 34   STA $34CA  [$7E:34CA]   A:0011   X:001B   Y:0005   P:envMxdizC - Store A in 7E34CA (Battle Message Area)

Twincast Success Probability

$03/E58E   C9 40   CMP #$40   A:008F   X:0011   Y:0005   P:eNvMxdizc - Is it less than 40?
$03/E590   90 04   BCC $04    [$E596]   A:008F   X:0011   Y:0005   P:envMxdizC - If so, branch to 03E596.
$03/E592   A9 41   LDA #$41   A:008F   X:0011   Y:0005   P:envMxdizC - Load Flare into A.
$03/E594   80 02   BRA $02    [$E598]   A:0041   X:0011   Y:0005   P:envMxdizC - Branch Always to 03E598.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Otherwise...

$03/E596   A9 40    LDA #$40   A:0024   X:0064   Y:0007   P:eNvMxdizc - Load Comet

I hope that made sense, if it doesn't. Please let me know and I'll try to use a normal syntax. I was a little rushed for time at the moment.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,234
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #782 on: April 07, 2014, 12:37:27 AM »
All of those $03xxxx offsets are LoROM, not ROM.
In the case of any LoROM offset in the 30000s, subtract 20000 to find its unheadered ROM equivalent (then add 200 for the headered offset).
Since all of the battle mechanics in FF4 are located in the $03/8000 - $03/FFFF range in LoROM, they will be in $01/8200 - $02/01FF in a headered ROM.

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,676
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #783 on: April 07, 2014, 02:04:48 AM »
Did I really say RAM (looks back) Yeah. I did.

I meant LoRom, haha!

That's the reason I suggested WindHex to find their location. Chillyfeez provides a nice alternative translation to that if WindHex isn't desired though.

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #784 on: April 07, 2014, 06:49:24 AM »
Whoa! Talk about coming through! You're my new hero, Grimoire. And it's all laid out in a well-organized, very readable fashion!

Alright you guys are not going to even recognize the command editor when this next update comes out. This is gonna be wicked.
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,676
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #785 on: April 07, 2014, 10:11:45 PM »
That sounds fantastic! Well I've found myself with some time this evening so let me get those messages for you...

(Order of Commands as they appear in LoROM)

Enemy Runs Away (Unused)

$03/E1C1   A9 05   LDA #$05   A:0080   X:0000   Y:0000   P:eNvMxdizc - Load 05 into A. (Ran Away)
$03/E1C3   8D CA 34   STA $34CA  [$7E:34CA]   A:0005   X:0000   Y:0000   P:envMxdizc  - Store A in 7E34CA

Sneak/Steal

Failed and Damaged Steal
$03/E232   A9 1C   LDA #$1C   A:0000   X:0680   Y:001A   P:envMxdiZC - Load 1C into A. (Failed(3))
$03/E234   8D CA 34   STA $34CA  [$7E:34CA]   A:001C   X:0680   Y:001A   P:envMxdizC - Store A in 7E34CA (Battle Message Area)

Failed Steal
$03/E239   A9 1B   LDA #$1B   A:0001   X:002E   Y:0000   P:envMxdizc - Load 1B into A. (Failed(2))
$03/E23B   8D CA 34   STA $34CA  [$7E:34CA]   A:001B   X:002E   Y:0000   P:envMxdizc - Store A in Battle Message Data.

Successful Steal
$03/E2C9   A9 1D   LDA #$1D   A:00CF   X:0004   Y:0001   P:eNvMxdizc - Load Message 1D (Received !Item!)
$03/E2CB   8D CA 34   STA $34CA  [$7E:34CA]   A:001D   X:0004   Y:0001   P:envMxdizc - Store Message in Battle Message Data.

Salve

$03/E2F8   A9 0F   LDA #$0F   A:0003   X:00C0   Y:0030   P:envMxdizC - Load 0F into A. (Not Enough Medicine)
$03/E2FA   8D CA 34   STA $34CA  [$7E:34CA]   A:000F   X:00C0   Y:0030   P:envMxdizC - Store A in Battle Message Data

Regen

$03/E432   A9 36   LDA #$36   A:0003   X:0000   Y:0032   P:envMxdizc - Load 36 into A. (Restoring HP...)
$03/E434   8D CA 34   STA $34CA  [$7E:34CA]   A:0036   X:0000   Y:0032   P:envMxdizc - Store A in 7E34CA.


Twincast

Twincasting Interrupted
$03/E4DB   A9 11   LDA #$11   A:00FF   X:0180   Y:0000   P:eNvMxdizc - Load 11 into A. (Failed(1).)
$03/E4DD   8D CA 34   STA $34CA  [$7E:34CA]   A:0011   X:0180   Y:0000   P:envMxdizc - Store A in 7E34CA  (Battle Message)


1/255 Twincasting Failure
$03/E586   A9 11   LDA #$11   A:00FF   X:0033   Y:0007   P:envMxdiZC- Load x11 into A. (Failed Message)
$03/E588   8D CA 34   STA $34CA  [$7E:34CA]   A:0011   X:001B   Y:0005   P:envMxdizC - Store A in 7E34CA (Battle Message Area)

Gird/Endure

$03/E6A4   A9 3A   LDA #$3A   A:0003   X:0680   Y:001A   P:envMxdizC - Load 3A into A. (Bracing for Impact!)
$03/E6A6   8D CA 34   STA $34CA  [$7E:34CA]   A:003A   X:0680   Y:001A   P:envMxdizC - Store A in 7E34CA (Battle Message Area)

Focus/Boost

$03/E81D   A9 39   LDA #$39   A:0003   X:0000   Y:0005   P:envMxdizc - Load 39 into A (Storing Power...)
$03/E81F   8D CA 34   STA $34CA  [$7E:34CA]   A:0039   X:0000   Y:0005   P:envMxdizc - Store A in Battle Message Data

Pray

Failed Prayer

$03/E85C   A9 10   LDA #$10   A:0003   X:00CE   Y:0000   P:envMxdizC - Load 10 into A (D) (Failed Prayer)
$03/E85E   8D CA 34   STA $34CA  [$7E:34CA]   A:0010   X:00CE   Y:0000   P:envMxdizC - Store A in Battle Message Data.

Sing

(Here's a little bonus to Sing is how to change the conditions for Song of Toad)

$03/E900   AD 83 26   LDA $2683  [$7E:2683]   A:0003   X:0010   Y:0000   P:envMxdizc - Load Caster's Status Byte 1.
$03/E903   29 20   AND #$20   A:0000   X:0010   Y:0000   P:envMxdiZc - Is it Frog?
$03/E905   F0 09    BEQ $09    [$E910]   A:0000   X:0010   Y:0000   P:envMxdiZc -If not, branch to 03E910.

Song of Toad

$03/E907   A9 0B   LDA #$0B   A:0020   X:0010   Y:0000   P:envMxdizc - Load 0B into A (Song of Toad)
$03/E909   8D CA 34    STA $34CA  [$7E:34CA]   A:000B   X:0010   Y:0000   P:envMxdizc - Store A in Battle Message Data.


Song of Mute

$03/E924   A9 0E   LDA #$0E   A:0095   X:0052   Y:0000   P:envMxdizC - Load 0E into A (Song of Mute)
$03/E926   8D CA 34    STA $34CA  [$7E:34CA]   A:000E   X:0052   Y:0000   P:envMxdizC - Store A in Battle Message Data.

Nothing Happened.

$03/E917 A9 00   LDA #$00   A:00C0   X:0054   Y:0000   P:envMxdiZC - Load 00 into A (Nothing Happened.)
$03/E919   8D CA 34    STA $34CA  [$7E:34CA]   A:0000   X:0054   Y:0000   P:envMxdiZC - Store A in Battle Message Data.

Song of Charm

$03/E931   A90D   LDA #$0D   A:005C   X:00BD   Y:0000   P:envMxdizC - Load 0D (Song of Charm) into A.
$03/E933   8D CA 34   STA $34CA  [$7E:34CA]   A:000D   X:00BD   Y:0000   P:envMxdizC - Store A in Battle Message Data.

Lullaby
03/E93A    A9 0C   LDA #$0C   A:0030   X:0054   Y:0000   P:eNvMxdizc - Load 0C into A. (Lullaby)
$03/E93C   8D CA 34   STA $34CA  [$7E:34CA]   A:000C   X:0054   Y:0000   P:envMxdizc - Load A into Battle Message Data.

Recall

Failed Recall

$03/EA61   A9 09   LDA #$09   A:0087   X:0000   Y:0000   P:envMxdizC - Load 09 into A. (Failed)
$03/EA63   8D CA 34   STA $34CA  [$7E:34CA]   A:0009   X:0000   Y:0000   P:envMxdizC - Store A in Battle Message Data.

Bluff/Boast

$03/EADE   A9 12   LDA #$12   A:0022   X:0000   Y:0000   P:eNvMxdizc - Load 12 into A (Intelligence raised!)
$03/EAE0   8D CA 34   STA $34CA  [$7E:34CA]   A:0012   X:0000   Y:0000   P:envMxdizc - Store A in Battle Message Data.

Cry

$03/EB21   A9 13   LDA #$13   A:000D   X:000C   Y:0000   P:envMxdiZC - Load 13 into A. (The crying made the foe hesitant.)
$03/EB23   8D CA 34   STA $34CA  [$7E:34CA]   A:0013   X:000C   Y:0000   P:envMxdizC - Store A in Battle Message Data.


And that should be it! At least as far as my notes avail me.

JCE3000GT

  • Master of FF4
  • *
  • Posts: 1,419
  • Gender: Male
  • Vladof
    • View Profile
    • BlitzKrieg Innovations
Re: Developing a comprehensive editor for FF4
« Reply #786 on: April 08, 2014, 12:10:53 AM »
I'm loving all this data mining and documenting.  My dream is to have Final Fantasy 4 have as much or more to edit than Final Fantasy 6.  :)

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #787 on: April 08, 2014, 03:28:25 AM »
You can change the status given by Jump and Charge, but both of their adjoining routines on completion get rid of the afflicted status of Jump and Charge. You could change it to something else, but that still wouldn't prevent the graphic for "Jump" from showing up.

But you could, say, make it so that Charge adds something else, like Berserk or Blink or something, and then removes... Charging?  :wink:
Could it be given a target and have it add a negative status, like Charm or Stun or something, and then remove... Charging?

And thanks for the message locations; this'll be great. If you wanted to disable the display of a message entirely, I assume changing the "8D CA 34" to all no-ops would do the trick?
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,676
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #788 on: April 08, 2014, 12:11:18 PM »
You could, yes. But in that example there would be no way to resist it, as resisting is done through specific routines. What you could do is make the Charge formula jump to the normal Status Routine and see if it can apply rather than blatantly apply the status on Anything, the problem with this is that formulas that don't cast a Spell or Fight do not access the Mirror Data in 7E6800 and the normal Status Infliction looks for those specific checks... But... if it is Just adding a positive effect like Blink/Berserk/Wall then that would work perfectly fine.

To do that all you would do is change...

$03/E80B   A6 A6   LDX $A6    [$00:00A6]   A:0008   X:0003   Y:0005   P:envMxdizc - Load X from A6 (Character Slot)
$03/E80D   BD 05 20   LDA $2005,x[$7E:2005]   A:0008   X:0000   Y:0005   P:envMxdiZc - Load Slot X's Status Byte 3.
$03/E810   09 08   ORA #$08   A:0000   X:0000   Y:0005   P:envMxdiZc - Add 08 if not already there (Charging)
$03/E812   9D 05 20   STA $2005,x[$7E:2005]   A:0008   X:0000   Y:0005   P:envMxdizc - Store Charging in Slot X's Status Byte 3.

To...

Charge to Image

$03/E80B   A6 A6   LDX $A6    [$00:00A6]   A:0008   X:0003   Y:0005   P:envMxdizc - Load X from A6 (Character Slot)
$03/E80D   BD 06 20   LDA $2005,x[$7E:2005]   A:0008   X:0000   Y:0005   P:envMxdiZc - Load Slot X's Status Byte 4.
$03/E810   09 08   ORA #$08   A:0000   X:0000   Y:0005   P:envMxdiZc - Add 08 if not already there (Image 2)
$03/E812   9D 06 20   STA $2005,x[$7E:2005]   A:0008   X:0000   Y:0005   P:envMxdizc - Store Charging in Slot X's Status Byte 4.

And that would change it into Image. I am not sure though if the blurring graphic would appear, my bet is... probably not, but I might be surprised in that regard.

And you are correct. You can null all of the "store in Message Area" to get rid of the messages on any given Command.

I'm loving all this data mining and documenting.  My dream is to have Final Fantasy 4 have as much or more to edit than Final Fantasy 6.  :)

I think divided between the work, Chillyfeez, Yousei, Pinkpuff, yourself, and myself. We have the potential already to bypass FFVI's rate of knowledge. For instance in VI, I'm not sure there's that much known about Commands and the like. I might be wrong, but it seems that way at a glance.

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #789 on: April 09, 2014, 06:08:36 AM »
I see what you mean now. So probably I'll just leave Jump and Charge alone.

Maybe someday we'll see a module for "coding" commands much like the events, but I won't be attempting that any time soon. Fun to imagine though...
Let's dance!

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #790 on: May 07, 2014, 08:31:10 AM »
Not much progress has been made lately, I'm afraid... first there was exams, then I got spoiled on my birthday ^_^; including receiving Bravely Default as a gift and so... yeah... I've been playing that instead of working on this... but can you blame me? It's SO GOOD!! Anyway now classes are starting up again for intersession.... so who knows how long it'll be before the next update. But just letting you guys know I'm still around and haven't forgotten or abandoned anything ^_^
Let's dance!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,234
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #791 on: May 07, 2014, 12:09:34 PM »
No worries. Even I, who am not involved in any kind of schooling and have a job that is extremely undemanding this time of year, have not been working as furiously on my hacking lately (I figured out that flag business, which is cool, but that didn't actually take very long).
I've been replaying the psx FFs quite a bit lately - one of my go-to activities when I'm bored - I have been getting some good ideas by doing so...

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,676
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #792 on: May 08, 2014, 03:39:19 PM »
Yes, Bravely Default is one of the best RPG's I've played in a very, Very long time. I am glad to see you also got it PinkPuff! It deserves as much support as possible. What a way to update the traditional system, and I'm sure you noticed that so much of the weaponry is based purely off of FFIV.

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #793 on: June 24, 2014, 09:16:16 AM »
Update!!

Solobattles are done (I think, it's been a while) and you can now edit which messages correspond with the commands that can take them. That one is a little rough around the edges at the moment but I wanted to get something out there since it's been so long. Next on the agenda will be adding the extra parameters to the commands (Twin has spaces there for its new parameters, but right now they're just placeholders).
Let's dance!

Eternal248

  • Octomammoth
  • *
  • Posts: 21
  • Gender: Male
  • Forever a fading dream!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #794 on: June 24, 2014, 09:59:46 PM »
Hey Pinkpuff, thanks for this amazing tool! I'm loving it! I do have one concern though, and I apologize if I missed this being addressed elsewhere. I'm playing around with Commands, and every time I scroll down to the one directly beneath Kick, the editor completely crashes. I'm fairly sure my ROM is compatible with the editor, since this is the only issue I've seen so far. Am I totally doing something wrong, or is this a known bug?

Thanks again, your work is astounding!  :happy:
Your acting is about as subtle as a crutch!