Final Fantasy IV SNES - Critical Hit Bug Fix?

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

Previous topic - Next topic

Lancet

Hello, I was researching this critical hit issue and found this topic. If those who have investigated this bug are able, I have a couple of questions related more to playing the game without any fix for this bug. Also possibly worth saying is I'm actually looking at this on the Final Fantasy Chronicles port of FF4, not SNES or GBA.

Due to the auto-battle aspect of the bug, am I correct in concluding that Rydia will never be able to cause critical hits after the Tellah vs Bard auto-battle, since she can obviously never be in Tellah's slot for that battle? And that due to Edge vs. Rubicant auto-battle, only one character out of Cecil, Kain, Rosa, and Rydia* can keep their criticals? Thus, for an endgame party, only Edge and one other person could possibly have critical hits still enabled?

Second, which byte(s) exactly in character data is the one that is permanently affected by this? It seems like it is 102D and 102E that get zeroed by the dead-entering-battle effect, so are those the permanent data that are affected by this glitch?

Finally, does anyone have a convenient list of each character's actual starting critical rate for the byte(s) affected by the glitch? (Bonus question: outside of this glitch, do these permanent data on the character's base critical rate ever change?)

Any help would be much appreciated.

Grimoire LD

By all appearances, that seems to be the case. With weirdness like this it makes it easy to tell how the critical hit kill equipment theory came into being. People had thought it was a flaw in an unset bit, it turns out it was a flaw with the auto-battle system and the end-of-battle sequence. Much of the final team will lose their ability to use Critical Hits due to this bug.

It appears to be 202D and 202E which is then carried out of battle back to 2D and 2E and set as 00 from thereon out.

This page has the amount http://x11.s11.xrea.com/ff4chrparam.txt it's the second to last value on every line. Of note is that whenever you equip a weapon you double your chance to crit per hit, and when you equip two weapons you quadruple the chance. The reason the glitch destroys all of that is because 0 x 2 or 4 is still 0.

chillyfeez

Holy cow, that website, Grimoire. So much good stuff once Google translate kicks in!
His long have you known about that?
Ongoing project: "Final Fantasy IV: A Threat From Within"

Latest Demo

Grimoire LD

It was only mentioned in the last page, I was shown it then. Is there more of use on the website than just the character stats then?

chillyfeez

There's all sorts of patches, for one thing. Author claims there was an abandoned plan to have monsters run away when their level is significantly lower, and has a patch to reactivate that. Plus an atb meter. It's for ffivj, so won't patch cleanly into ffiius, but I may be able to study it and replicate.
Yeah, just take that url and clip off everything before the slash.
Ongoing project: "Final Fantasy IV: A Threat From Within"

Latest Demo

Lancet

Quote from: Grimoire LD on May 12, 2019, 05:01:25 AM
By all appearances, that seems to be the case. With weirdness like this it makes it easy to tell how the critical hit kill equipment theory came into being. People had thought it was a flaw in an unset bit, it turns out it was a flaw with the auto-battle system and the end-of-battle sequence. Much of the final team will lose their ability to use Critical Hits due to this bug.

It appears to be 202D and 202E which is then carried out of battle back to 2D and 2E and set as 00 from thereon out.

This page has the amount http://x11.s11.xrea.com/ff4chrparam.txt it's the second to last value on every line. Of note is that whenever you equip a weapon you double your chance to crit per hit, and when you equip two weapons you quadruple the chance. The reason the glitch destroys all of that is because 0 x 2 or 4 is still 0.

What are the two different "critical" values, then? According to that table and from what I've seen in cheat engine, DK Cecil and Kain have a value of 2 for 2D and 20 for 2E. So what do those two values do exactly? Are they both related to critical hits? They're both zeroed when the battle ends if a character entered the battle KO'd.

chillyfeez

According to another document on that site, the first value is the critical hit rate, and the second value is the critical hit bonus. I'm sure the "bonus" value is part of a calculation. It would be silly late-game if Cecil's critical hits only added ~35 damage.
Ongoing project: "Final Fantasy IV: A Threat From Within"

Latest Demo

Grimoire LD

How interesting, I'll check that out later. Yes, that is one of the unused formulas, in the current game the monster just dies and says, "Monster ran away". In fact, I re-added it with a "Fear" spell formula. There may have been a piece of data regarding a monster's level against the party's own, but I never found it, so there may have been some code which was glitched that failed those checks at all turns. (It's FFIV, it wouldn't surprise me).

Its a bonus based on the weapon you have equipped and it is a %buff, but Critical Hit damage is different from normal damage as it takes the normal damage, and increases it by a % of 0 to whatever the max is dependent on the weapon equipped. As memory serves Critical Hit damage % is x2 the power of the weapons, but I can't quite recall.

Lancet

Thank you for the clarifications. It's been a big help in understanding how critical hits work. =)

Gedankenschild

Wow, that Japanese site really has some interesting patches!
The ATB bar one looks nice. Would be interesting to compare the ASM of some of them to the ones done by you guys (like B-button dash).

chillyfeez

I spent a little bit of time recently dissecting the ATB hack that's there. It's pretty ingenious and not too complicated. It won't patch properly into any US version of the game, but I think I might be able to replicate it for User Options.
Ongoing project: "Final Fantasy IV: A Threat From Within"

Latest Demo

Gedankenschild

Nice!
I just now realized the "Item fix" patch also contains a fix for the critical hit bug. Though I'm not sure what exactly it fixes and how... :-[

That page says it has last been updated in 2010. I can't believe all of this stuff has been sitting there for so long and pretty much no one over here learned about it until now...

Giud

Quote from: Gedankenschild on May 29, 2019, 11:28:57 AM
Nice!
I just now realized the "Item fix" patch also contains a fix for the critical hit bug. Though I'm not sure what exactly it fixes and how... :-[

That page says it has last been updated in 2010. I can't believe all of this stuff has been sitting there for so long and pretty much no one over here learned about it until now...

Thank God for Google Translate,though  ;D I've been looking at that FFIV Advance analyzer and it has a lot of useful data, but it doesn't have the event data offsets which I desperately need :'(

chillyfeez

Quote from: Giud on May 30, 2019, 01:22:31 PM
Thank God for Google Translate,though  ;D I've been looking at that FFIV Advance analyzer and it has a lot of useful data, but it doesn't have the event data offsets which I desperately need :'(
That must be documented somewhere. I don't really know ffiva like I do the SNES version, but I'm pretty sure there are people out there who have messed around with it...
Ongoing project: "Final Fantasy IV: A Threat From Within"

Latest Demo

Giud

Quote from: chillyfeez on May 30, 2019, 10:39:48 PM
That must be documented somewhere. I don't really know ffiva like I do the SNES version, but I'm pretty sure there are people out there who have messed around with it...

Sadly, FFIV Advance seems to be under-documented, especially compared to FFVa and FFVIa. The problem with event data is that they've changed the event codes so just looking for the same hex values from the SNES game doesn't really do anything.