Final Fantasy IV SNES - Critical Hit Bug Fix?

Started by 8.bit.fan, November 15, 2018, 03:12:31 AM

Previous topic - Next topic

8.bit.fan

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...
http://www.8bitfan.info/
FF4 Ultima Discord: https://discord.gg/4MqjwJt

chillyfeez

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

Quote from: chillyfeez 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.
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...
http://www.8bitfan.info/
FF4 Ultima Discord: https://discord.gg/4MqjwJt

chillyfeez

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

Quote from: chillyfeez 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.
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...
http://www.8bitfan.info/
FF4 Ultima Discord: https://discord.gg/4MqjwJt

chillyfeez

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

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

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

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

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...
http://www.8bitfan.info/
FF4 Ultima Discord: https://discord.gg/4MqjwJt

chillyfeez

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

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

Ongoing project: "Final Fantasy IV: A Threat From Within"

Latest Demo

FlamePurge

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.
Check out and discuss my projects

chillyfeez

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

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...
http://www.8bitfan.info/
FF4 Ultima Discord: https://discord.gg/4MqjwJt

Rodimus Primal

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

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

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