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

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 #825 on: July 07, 2014, 05:39:40 PM »
The problem isn't with the amount of messages in the last map per se, but with the overall size of bank 2 as interpreted by Ff4kster. If I delete a bunch of text from bank 2 in my ROM, save it, then try later to add new text, Ff4kster thinks all that garbage in the last map is supposed to be there, so it won't let me save the new text.
I presume having the ability to delete entire messages would be a valid fix for this particular problem, though.
« Last Edit: July 07, 2014, 07:48:25 PM by chillyfeez »

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #826 on: July 07, 2014, 07:40:11 PM »
Ah, I see what you mean. The pointer hack should fix that issue as well. I'll give it my best shot. Deleting the last message would probably work but I think you'd have to do it each time you saved which would be annoying.

On another topic, I was messing with the equipment and when I extended the "shield" range and created new off-hand armors, the extra ones seem to mess up the character's attack stats. Can anyone else confirm this? If so I suspect there's some kind of check being made that the left hand equipment is indeed a shield to prevent it from being factored into the attack and hit calculations, which FF4kster neglects to write to when the range is changed...

 :edit: Uploaded the fix to the message range for the last map. Let me know if there are any further issues. I'll update again once I implement the inserting/deleting functionality.

 :edit: And done! Inserting and deleting messages from Bank 2 should work now.
« Last Edit: July 08, 2014, 07:24:40 AM by Pinkpuff »
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 #827 on: July 08, 2014, 09:49:03 AM »
Looks like it's working perfectly!
 :happy:

 :edit: Hmmm... so new issue that seems to have arrived with the latest version.

Now, when you try to edit the speech details of an NPC in the NPC editor, the editor freezes entirely.

Only seems to happen with the most recent release.

 :edit: 2 Just to be sure, I tested with a clean, unmodified ROM and it still happens.
« Last Edit: July 08, 2014, 10:37:12 AM by chillyfeez »

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #828 on: July 08, 2014, 12:14:42 PM »
Confirmed.

Going into the event editor freezes it for me as well. What did I do now...  :isuck:
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 #829 on: July 08, 2014, 02:26:18 PM »
Going into the event editor freezes it for me as well. What did I do now...
I was just going to report that one, too...

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #830 on: July 08, 2014, 05:29:27 PM »
Success!!  :banonsmash:

Phew! That was the scariest mess-up yet...
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,676
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #831 on: July 09, 2014, 01:24:15 PM »
Ah, I see what you mean. The pointer hack should fix that issue as well. I'll give it my best shot. Deleting the last message would probably work but I think you'd have to do it each time you saved which would be annoying.

On another topic, I was messing with the equipment and when I extended the "shield" range and created new off-hand armors, the extra ones seem to mess up the character's attack stats. Can anyone else confirm this? If so I suspect there's some kind of check being made that the left hand equipment is indeed a shield to prevent it from being factored into the attack and hit calculations, which FF4kster neglects to write to when the range is changed...

 :edit: Uploaded the fix to the message range for the last map. Let me know if there are any further issues. I'll update again once I implement the inserting/deleting functionality.

 :edit: And done! Inserting and deleting messages from Bank 2 should work now.

Now this is an odd phenomenon... Yes, items outside of Shields are turned into Shields they effect attack. If you have nothing but the shield equipped it will add the Shield's Defense to Attack instead. But! When it is added to a weapon with power suddenly the effect of the Shield's Attack stats changes to... much higher... and goes up by one for each "shield" this power upgrade starts at 32 with the Iron Helm. In addition it lowers the accuracy of any given weapon by 50%! Now that is definitely bizarre... but there's a lot of special coding involved with this that I'm wondering if it isn't some beta element that they hid by forcing the search to later in the list.

Now what corresponds a 32 (20 in Hex) and above to these other items? Their internal Hex numbers are already much higher than that. This might actually involve a bit of code digging to figure out this anomaly...

Hmm... I unfortunately can't find anything in particular that deals with this issue. In theory it would be a "CMP 6D" but I don't believe such a check exists because the game assumes you would only be equipping shields from thereon out. Why this effects stats in this peculiar manner, that I cannot say. This... might sound crazy, but perhaps those "unused bits" that corresponds to armor type, maybe that will have something to do with it?

 :edit: Ah, I figured out how it's calculated...

It takes the base attack of the character and adds the Helmet's Defense to their Attack. Thereby it was going up by 1's because that's how the Helmets are set up. So in essence anything past a Shield's defenses becomes a weapon with a -50% Attack Penalty as far as the game is concerned.

Oh, yes... that explains it... It's now Read as a weapon, in a complete sense. The Evasion becomes Accuracy (hence why it seemed it was negative accuracy), the Defense becomes Attack,  But that seems to be it, you can't cast Spells with them (likely because out of Index as that Index would then read Shield Magics as their Magic Evasion) and they have no graphics, as one would expect.

Is this intended behavior? It's rather difficult to say. That it seems so complete seems to hint that it is, but at the same time it's just the Weapon Statistics over Armor.

Unfortunately I have not located where this additional CMP would be that would search it for Shields...

Or maybe I found it already?

03F36B in LoRom/HiRom (best to use WindHex for finding this) there is still a CMP of 6D when it should read the newly changed range, so you can equip new "shields" in battle.
« Last Edit: July 09, 2014, 02:03:33 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 #832 on: July 10, 2014, 07:20:11 AM »
Unfortunately I have not located where this additional CMP would be that would search it for Shields...

Or maybe I found it already?

03F36B in LoRom/HiRom (best to use WindHex for finding this) there is still a CMP of 6D when it should read the newly changed range, so you can equip new "shields" in battle.

Changing this didn't allow me to equip the other shield equipment in battle... did it work for you?
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,676
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #833 on: July 10, 2014, 11:11:55 AM »
Hmm... yeah it worked for me, just fine. It is C9 6D 0B 04, right?

Oh wait... hmm, this is strange. If you came into the battle with the Helmet/Shield equipped the game would read it as re-equippable. But if the Helmet/Shield is in your inventory it shows up as darkened and unequippable. What does this even do then? Hmm...

Ah! I found it! It took a bit more data-diving than I had thought, but I found, at least, the way to equip Helmet/Shields in battle... there's more index checks at...

03A165 - C96D - This controls whether the index will show up as lightened as well as equippable (granted you can actually equip them, of course)

03F36B - C96D - This allows you to actually equip the helmet if the above is fulfilled (and not just if you have de-quipped and requipped it in battle)

That solves that mystery! Now onto the other...



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 #834 on: July 10, 2014, 12:20:03 PM »
Just to be clear, Grimoire, are those LoROM offsets?

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,676
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #835 on: July 10, 2014, 12:24:03 PM »
They are indeed, just as above (I thought I noted that, apparently I did not, eh heh). If you're using a headered ROM just add (or subtract?) 200 to the final amount to find them.

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #836 on: July 11, 2014, 05:25:44 AM »
Yup, now it works!

If you're using a headered ROM just add (or subtract?) 200 to the final amount to find them.

Subtract 20000 and add 200 to get the rom address for a headered rom. E.g. 3F36B would be 1F56B.
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 #837 on: July 11, 2014, 12:25:03 PM »
That works for anything in the 30000 block in LoROM, but the whole story is a bit more complicated than that...
Something like, for every 8000 in ROM address, add an extra 8000 for the LoROM
Code: [Select]
ROM            LoROM
----------------
0000           8000
8000           18000
10000          28000
18000          38000
20000          48000

...I'm pretty sure that's how it works, and of course that's assuming an unheadered ROM

(sorry, Pinkpuff, that was probably borderline off-topic)

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,676
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #838 on: July 12, 2014, 09:37:53 PM »
Alright! I think I've finally solved this conundrum and it dealt nothing with ranges or anything like that, but instead it writes to an exception, this is normally used while dual-wielding. Shields... somewhere... have an innate 80 which is looked at, and it is this which decides whether the game increases defense or offensive capabilities. Weapons and other types or armor do not have this 80.

Yes, here is a prime example of what I mean...

Iron Shield -
8001 1400 8000 0400

80 - Magic Evade/Metallic
01 - Defense
14 - Evasion
00 - Magic Defense
80 - Will This Item Grant Defense if Held - Negative Hex If So/Along with other elemental/race matters. 80 is the Very Important Part though and is the key to using other Items as Shields.
00 - Status/Element resistance
04 - Equip Index
00 - Bonus Index

You will notice that the helms and all other armors (and items in the game...) lack this negative portion of the byte. That's likely something you'd want to add to the editor, hehe.

Now that I think about it though, that's a pretty neat way to go about it. This way the player can have "weapons" that don't necessarily add to attack and "shields" that don't necessarily have to add to defense.
« Last Edit: July 12, 2014, 10:58:11 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 #839 on: July 14, 2014, 06:57:06 AM »
Awesome, that seems to work!

Right now I'm just getting it to write the appropriate flags for the shields automatically based on whether its index falls in the defined shield range, but I will certainly make that independently editable soon.

There will be an update in the very near future, with another little surprise thrown in there.  :wink:
Let's dance!