News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Final Fantasy IV SNES - Critical Hit Bug Fix?  (Read 6493 times)

8.bit.fan

  • Full Member
  • ***
  • Posts: 174
    • View Profile
    • 8-bit fan's Hacking Projects
Final Fantasy IV SNES - Critical Hit Bug Fix?
« on: November 15, 2018, 03:12:31 am »
Hi Everyone!

So lately I've been reading up on and learning more about FF4's mechanics and algorithms, and one of the bugs I've noticed that still hasn't been addressed is the Critical Hit bug that causes players to PERMANENTLY lose the ability to do critical hits in the game! Crazy!

So, has anyone attempted to fix this critical(pun intended) bug for the game? It seems that the different ways that a player could lose the ability for good is just crazy and would be nice to have a fix for it.

Here are some info that I found on this issue:

"Some weapons prevent critical hits from occurring at all, and there's a bug where this bit is not unset when the weapon is removed."
https://gamefaqs.gamespot.com/snes/588330-final-fantasy-iv/faqs/54945

"Lose Critical Attack Ability: There are two ways to lose critical attack ability. The first is to be in the group and be in a position where in the next "auto-fight" (such as when Tellah fights Edward or Cecil fights Kain) the character's spot is not taken up by one of the NPC fighters. Meaning that in the case where Golbez and FuSoYa are fighting against Zemus, if there is a character on the team that still has crit, he can keep his critical attack by being in the same position as either one of those characters. Or he would lose it if he was in a different position. However, it was later also discovered that the characters that aren't in the "auto-fight" will retain critical attacks IF and only if the group on the right dies.

The second way to lose critical attack ability is to be dead when a fight starts. In both these cases there is no way to regain critical strike ability. Not by saving and reseting the game, powering off, sleeping in an inn, leaving the party, or any other number of ways you could think of. The ability to critical strike is lost forever if either of these conditions are met."
http://tasvideos.org/2033S.html

http://ziggyny.blogspot.com/2012/01/final-fantasy-iv-bugs.html
https://gamefaqs.gamespot.com/boards/522596-final-fantasy-ii/59917210

Does anyone have any idea on how the bug can be fixed?

Cheers!  :beer:

8-bit fan
In the year of 200X, a super robot named Mega Man...

chillyfeez

  • Hero Member
  • *****
  • Posts: 722
    • View Profile
Re: Final Fantasy IV SNES - Critical Hit Bug Fix?
« Reply #1 on: November 18, 2018, 07:10:59 am »
Never knew this bug existed.
I spent a lot of time researching how to fuck with FFIV, but not much on how to fix it.
People on the slick forum used to reference various bugs regularly and I would just kinda smile and nod.
I'm a bit surprised it was never addressed. There are a lot of bugfix patches out there for ffiv...
That being said, given a complete list of instances that trigger the bug, I'm sure I could create a patch (or isolate a way) to fix it.
Do those links provided in the OP list all of the triggers for the bug?
Might take a bit of time. I work retail, and it is now officially Thanksgiving week, which means I'm about to spend about a month and a half exhausted.
Ongoing project: "Final Fantasy IV: A Threat From Within"

Latest Demo

8.bit.fan

  • Full Member
  • ***
  • Posts: 174
    • View Profile
    • 8-bit fan's Hacking Projects
Re: Final Fantasy IV SNES - Critical Hit Bug Fix?
« Reply #2 on: November 19, 2018, 01:45:08 am »
Never knew this bug existed.
I spent a lot of time researching how to fuck with FFIV, but not much on how to fix it.
People on the slick forum used to reference various bugs regularly and I would just kinda smile and nod.
I'm a bit surprised it was never addressed. There are a lot of bugfix patches out there for ffiv...
That being said, given a complete list of instances that trigger the bug, I'm sure I could create a patch (or isolate a way) to fix it.
Do those links provided in the OP list all of the triggers for the bug?
Might take a bit of time. I work retail, and it is now officially Thanksgiving week, which means I'm about to spend about a month and a half exhausted.
Hey chillyfeez!
If you're capable and up for it that would be tremendous!!
But seeing that you're busy with work so no worries...just whenever you're feeling up for it! :)

To be honest, the instances that are mentioned in the links above are somewhat confusing to me. On one of the scenarios, a character would have to be in the same slot as the character of the auto battle, but that's impossible because the character in the auto battle would be in the same slot as when he/she was in your party. For example, in the Edward vs Tellah fight, Tellah is in the same slot as when he was in your party, so none of your other party members can be in the same slot! So...I don't get it. What do you think about this?

As far as an exhaustive list of auto battles, I think I can get that for you off of ff4kster if you need. Let me know! :)

Cheers! :beer:
8-bit fan
In the year of 200X, a super robot named Mega Man...

chillyfeez

  • Hero Member
  • *****
  • Posts: 722
    • View Profile
Re: Final Fantasy IV SNES - Critical Hit Bug Fix?
« Reply #3 on: November 19, 2018, 09:20:28 am »
Well, I can get a list of all of the autobattles, too, but does it ONLY happen during autobattles? Your OP seemed to indicate there are a bunch of different ways it can occur.
Ongoing project: "Final Fantasy IV: A Threat From Within"

Latest Demo

8.bit.fan

  • Full Member
  • ***
  • Posts: 174
    • View Profile
    • 8-bit fan's Hacking Projects
Re: Final Fantasy IV SNES - Critical Hit Bug Fix?
« Reply #4 on: November 20, 2018, 12:23:46 am »
Well, I can get a list of all of the autobattles, too, but does it ONLY happen during autobattles? Your OP seemed to indicate there are a bunch of different ways it can occur.
Think another way to permanently lose ability to critical is to equip a weapon that has the 'no critical' bit, once you do you lose the ability to critical even if you swap the weapon back to one that can critical. So for example - Adult Rydia rejoins the party with the whip equipped, which has the 'no critical' bit, so no matter what Adult Rydia can never do critical. Another example is if Cecil still has the ability to critical at endgame, if you equip him with the Ragnarok, he will permanently lose the ability to critical because the Ragnarok has the 'no critical' bit.

November 20, 2018, 12:25:31 am - (Auto Merged - Double Posts are not allowed before 7 days.)
Oh and another way to permanently lose the critical ability is if a character is dead at the start of a battle. So for example, if Edge is killed in a battle, and you don't revive him before the start of the next battle, he'll lose the ability to critical permanently.
In the year of 200X, a super robot named Mega Man...

chillyfeez

  • Hero Member
  • *****
  • Posts: 722
    • View Profile
Re: Final Fantasy IV SNES - Critical Hit Bug Fix?
« Reply #5 on: November 20, 2018, 10:33:27 am »
Hmm... based on the varied ways the "bug" can occur, it is likely the product of three separate coding oversights, based primarily on the fact that the character's critical hit percentage is stored in the character record in RAM and is not supposed to ever change. This, it is loaded from ROM when the character first joins, but that byte of ROM is never referenced again.
Come to think of it, I'll bet all subsequent entries in the final fantasy series avoided a similar issue by tying critical hit percentage to the weapon instead of the character.

So okay, when I get a chance I'll look into figuring out exactly when the percentage gets zeroed out (that is, isolate the exact time the bugs occur). Then we can work on fixing it/ them.
Ongoing project: "Final Fantasy IV: A Threat From Within"

Latest Demo

Grimoire LD

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
Re: Final Fantasy IV SNES - Critical Hit Bug Fix?
« Reply #6 on: November 21, 2018, 01:31:09 am »
I looked, heaven knows, I looked. In the character's stats there is a Critical Hit Byte which is never deactivated. It is dependent on an initial value, then depending on the weapon's strength (then if you have two weapons it x4) or Bow and Arrow the value changes, but it is never set to 0. I could not find what really caused this in the programming. I am also still a little unsure how accurate all of those "Critical Hit Lost" issues are. I know that it is related to an unknown weapon bit, but I cannot say more beyond that.

chillyfeez

  • Hero Member
  • *****
  • Posts: 722
    • View Profile
Re: Final Fantasy IV SNES - Critical Hit Bug Fix?
« Reply #7 on: November 21, 2018, 09:55:17 am »
Oh, so the character's critical byte is never zeroed out at all?

Interesing.

Something must change in SRAM somewhere... Maybe setting a breakpoint to a particular weapon' s byte that contains the "No critical" bit then equipping only that weapon...

Is the bit that we're assuming is the "no critical" bit the unknown bit 1 here, 8bit?
http://rb.thundaga.com/data/weapon_bits.txt
That is, does that look like an accurate list of the weapons that permanently disable criticals?

I haven't had a chance to do anything yet, but the mystery is getting intriguing.
Ongoing project: "Final Fantasy IV: A Threat From Within"

Latest Demo

Grimoire LD

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
Re: Final Fantasy IV SNES - Critical Hit Bug Fix?
« Reply #8 on: November 21, 2018, 03:57:50 pm »
To my recollection it is Bit1 that is responsible for it, yes. It's a shame that Slickproductions appears to be down permanently, thankfully I had the good sense to archive my hacking topic (until page 23) and my AI Indexes, let's see here...

What makes this glitch so difficult to pindown is if you hack the equipment in, there is no problem. Equip/Dequip it all still works fine. The Silence Staff addsx2 Crit Chance along with all other normal weapon types. So... I don't know what is happening there.

8.bit.fan

  • Full Member
  • ***
  • Posts: 174
    • View Profile
    • 8-bit fan's Hacking Projects
Re: Final Fantasy IV SNES - Critical Hit Bug Fix?
« Reply #9 on: November 21, 2018, 05:15:23 pm »
Hey chillyfeez and Grimoire LD!

So I did some testing and yes, bit 1 is the one responsible for no-critical on a weapon. I added bit 1 to many of the endgame ultimate weapons for my hack because I thought it had 'ultimate weapon properties' as Ragnarok has it also. Silly me. So, after realizing this whole no-critical thing, I updated my hack by removing that bit to the weapons and lo, Edge started doing critical with the Ultima Weapon! So, perhaps that information IS WRONG about permanently losing critical if you equip a weapon that has the no-critical bit 1?
In the year of 200X, a super robot named Mega Man...

chillyfeez

  • Hero Member
  • *****
  • Posts: 722
    • View Profile
Re: Final Fantasy IV SNES - Critical Hit Bug Fix?
« Reply #10 on: November 21, 2018, 05:39:47 pm »
For the record, Lenophis says slick isn't down permanently, just indefinitely.
Apparently the server it's hosted on is an old and terrible machine and he is working slowly but surely on transferring the db to something more viable for the 21st century.
This all from a recent discussion on the slick productions discord channel.

When you say, "if you hack the equipment in..." Do you mean that if I use ff4kster to create a new weapon that has that bit, that new weapon won't permanently disable criticals, but weapons that have the bit set in vanilla will do so?
Ongoing project: "Final Fantasy IV: A Threat From Within"

Latest Demo

Grimoire LD

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
Re: Final Fantasy IV SNES - Critical Hit Bug Fix?
« Reply #11 on: November 21, 2018, 07:12:15 pm »
I meant a clean FFII rom with no changes. I used Rydia to test this, with geiger I switched a Rod in the inventory for the Silence Staff and equipped it, saw it increased Critical Hit chance by 1 (perhaps it was x2, but Rydia starts with a 1% crit chance.) I changed the critical hit chance manually in battle and there were no issues to be found.

I am glad to know that Slick is not down permanently and that Lenophis is still looking for a solution to the problem. I did not know there was a discord. Things have been very busy (I am only posting because I don't have school) but it is good to know all the same. We really do have a lot to learn from FFIV:Enterprise in terms of where we take the future of FFIV hacking.

chillyfeez

  • Hero Member
  • *****
  • Posts: 722
    • View Profile
Re: Final Fantasy IV SNES - Critical Hit Bug Fix?
« Reply #12 on: November 21, 2018, 11:57:42 pm »
Wait, what's FFIV:Enterprise?
Ongoing project: "Final Fantasy IV: A Threat From Within"

Latest Demo

vivify93

  • Hero Member
  • *****
  • Posts: 960
  • White Wizard
    • View Profile
Re: Final Fantasy IV SNES - Critical Hit Bug Fix?
« Reply #13 on: November 22, 2018, 12:39:09 am »
I assume he means FFIV: Free Enterprise, a randomizer that gives you the Enterprise to start with. Lots of strides in FFIV hacking have been made thanks to them as well as the Lunarian Shuffle; I know that there's a hack in the works for detailed equip menu info, designed for Lunarian Shuffle.
All my life I've tried to fight what history has given me.

chillyfeez

  • Hero Member
  • *****
  • Posts: 722
    • View Profile
Re: Final Fantasy IV SNES - Critical Hit Bug Fix?
« Reply #14 on: November 22, 2018, 08:38:02 am »
Oh yeah, right. I do know of Free Enterprise.
I don't think I'm familiar with Lunarian shuffle.
Detailed equip menu would be pretty sweet. I did this once as a way to address the issue of no in-game equipment info:
https://youtu.be/mKXhlxPgvLA

... Sorry about hijacking your thread, 8bit  :-[
Ongoing project: "Final Fantasy IV: A Threat From Within"

Latest Demo

8.bit.fan

  • Full Member
  • ***
  • Posts: 174
    • View Profile
    • 8-bit fan's Hacking Projects
Re: Final Fantasy IV SNES - Critical Hit Bug Fix?
« Reply #15 on: November 23, 2018, 02:56:57 pm »
No worries Chillyfeez ;)
I'm actually enjoying all the different discussions on the game :)
In the year of 200X, a super robot named Mega Man...

Rodimus Primal

  • Hero Member
  • *****
  • Posts: 850
    • View Profile
Re: Final Fantasy IV SNES - Critical Hit Bug Fix?
« Reply #16 on: November 23, 2018, 03:07:19 pm »
Interesting. So if it happens to be weapons that are set to Bit 1, then is it only THOSE weapons that cannot do critical hits? Perhaps it has to do with the coding of just that Bit.

Swordmaster

  • Jr. Member
  • **
  • Posts: 18
    • View Profile
Re: Final Fantasy IV SNES - Critical Hit Bug Fix?
« Reply #17 on: November 23, 2018, 08:54:43 pm »
What I am about to say could very well be incorrect, as human memory is notoriously unreliable.  However, if I am recalling correctly, there are a few minor differences between an untouched FF2US ROM and one that has been loaded into FF4kster.  The only thing I can recall at the moment, however, is the behavior of the Cockatrice Summon.  In an untouched ROM, it only petrifies.  After being loaded into FF4kster, it causes 1 HP of damage in addition to petrification.  It's been a long time since I've played the untouched ROM, so I could just be misremembering.  My point, though, is that FF4kster may need to be ruled out as the culprit for the Critical Hit Bug.

chillyfeez

  • Hero Member
  • *****
  • Posts: 722
    • View Profile
Re: Final Fantasy IV SNES - Critical Hit Bug Fix?
« Reply #18 on: November 23, 2018, 11:38:44 pm »
You are right that ff4kster makes changes to the ROM even if the user makes no edits.

However...

This topic on gamefaqs is from 2011. Pinkpuff didn't start working on ff4kster until 2012.
So the bug definitely is not related to or caused by ff4kster.
Ongoing project: "Final Fantasy IV: A Threat From Within"

Latest Demo

Swordmaster

  • Jr. Member
  • **
  • Posts: 18
    • View Profile
Re: Final Fantasy IV SNES - Critical Hit Bug Fix?
« Reply #19 on: November 24, 2018, 06:05:58 pm »
Ah, sou desu ka...  Thanks, chillyfeez.