øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=2173.msg24761e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index6988.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=profile;area=showposts;u=20e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index6988.html.zxþhh^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ0Pd< OKtext/htmlISO-8859-1gzip0|Ö< ÿÿÿÿÿÿÿÿWed, 11 Mar 2020 04:45:10 GMT0ó°° ®0®P®€§²ð®ýhh^ÿÿÿÿÿÿÿÿ)<  Two new patches: Better Dice, No X In Fight

Poll

Do you think the regular Dice should share the Fixed Dice's matching bonus?

Yes
No

Author Topic: Two new patches: Better Dice, No X In Fight  (Read 1356 times)

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Two new patches: Better Dice, No X In Fight
« on: March 03, 2016, 07:32:31 PM »
Hi! I've got a doubleheader for you today! These two new patches aren't necessarily bug fixes, depending on your point of view, but odds are you'll find them useful.

The first patch, Better Dice, makes two tweaks to the damage algorithm used by Setzer's Dice weapons. These tweaks are best explained in an organized format.

  • Before: if all three dice rolled with Fixed Dice match, the damage is multiplied by that number. After: this bonus now applies to the regular Dice as well.
  • Before: Setzer will always roll two dice with a 3-in-16 probability for each number between 1 and 4 and a 1-in-8 probability for numbers 5 and 6. After: Setzer will always roll one die with perfect 1-in-6 probability distribution; all other dice will have a 43-in-256 probability for each number between 1 and 4 and a 21-in-128 probability for numbers 5 and 6.

The second patch ensures that the X Fight command is displayed correctly in the command menu. This patch uses free space bytes C1/FFFC-C1/FFFF, C3/FF93-FFA8 and C3/FFC1-C3/FFFF.

:edit: March 4, 2016
I knew that this patch conflicted with Assassin's "Recapture the Glory" patch, but I didn't think it would conflict in any way that breaks the functionality of that patch or the game. Now that I know better, I've uploaded a new set that adds compatibility.

:edit: March 6, 2016
Add new patches that make the first tweak above optional. The reverse patch can be applied to remove either version.

:edit: April 23, 2016
Added a bug fix: the Offering relic is supposed to cut damage in half, but it doesn't do so with the Dice weapons. It will if the new version is applied. I will also write a new separate patch soon that includes only that bug fix.

:edit: December 26, 2017
By request, I added a secondary set of patches that, in addition to changing "Fight" to "X Fight", also change "Jump" to "X Jump" if the Dragon Horn is equipped.
« Last Edit: December 26, 2017, 06:03:42 AM by 13375K31C43R »
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

TheNattak

  • Garula
  • *
  • Posts: 203
  • Gender: Male
  • Mike
    • View Profile
    • Return of the Dark Sorcerer
Re: Two new patches: Better Dice, No X In Fight
« Reply #1 on: March 04, 2016, 01:02:19 AM »
Good ones man! Thanks.

assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: Two new patches: Better Dice, No X In Fight
« Reply #2 on: March 05, 2016, 07:31:09 AM »
i suspected they'd conflict too, but see you dealt with that quickly.  :cookie:  LOL at the neverending Contents list.  i've actually been holding off 8+ years on fixing a known flaw in Jump Megafix (which has a hefty Contents list of its own):

Quote
If you equip Genji Glove, (Fixed) Dice in the left hand, and some other weapon in the right hand, and do a Jump attack that uses the Dice, the animation will always show whatever's in the right hand instead. (What it should show is a bare hand, as that's how the vanilla game illustrates Jump+Dice.)  One day, I'll remedy this.

because i dreaded making an extra version to be compatible with "Recapture the Glory".  so your steps in this aspect are appreciated and certainly not envied.  when i do eventually address it: do i dare also make a version that's compatible with "Better Dice"?  would attempting this collapse the solar system?

impressive space savings, btw.

re "WTF?!" code comment: they couldn't use the original hit rate value, which is the dice count.  i suppose they could've set a new hit rate near the end of the function.

the way they put 0Fh in $B6 and compare the nibbles to $B7 so normal Dice will always fail seems pretty deliberate to me.  i've always thought they wanted to reward only 3 matching dice, because the chance of this happening is rare, around 6 times less than that of 2 matching normal dice.  then again, your lenient application of this bonus partially balances out normal Dice always missing the Die3 multiplier.  this weapon has been regarded as a joke, so the new balance might be welcome.

a larger question is what "Fixed" in the name meant in the first place.  does it refer to the matching roll bonus?  or does it refer to the third die not being weighted against you (so an UN-fixing, really)?  or both?

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: Two new patches: Better Dice, No X In Fight
« Reply #3 on: March 06, 2016, 12:44:35 AM »
Quote
i suspected they'd conflict too, but see you dealt with that quickly.  :cookie:  LOL at the neverending Contents list.  i've actually been holding off 8+ years on fixing a known flaw in Jump Megafix (which has a hefty Contents list of its own):

Quote
If you equip Genji Glove, (Fixed) Dice in the left hand, and some other weapon in the right hand, and do a Jump attack that uses the Dice, the animation will always show whatever's in the right hand instead. (What it should show is a bare hand, as that's how the vanilla game illustrates Jump+Dice.)  One day, I'll remedy this.

because i dreaded making an extra version to be compatible with "Recapture the Glory".  so your steps in this aspect are appreciated and certainly not envied.  when i do eventually address it: do i dare also make a version that's compatible with "Better Dice"?  would attempting this collapse the solar system?

I don't know what exactly this extra fix will entail, but I hope it doesn't end up being too difficult for you.

Quote
impressive space savings, btw.

Thanks! :)

Quote
re "WTF?!" code comment: they couldn't use the original hit rate value, which is the dice count.  i suppose they could've set a new hit rate near the end of the function.

I was just making a joke there. Don't worry about it. :wink:

Quote
the way they put 0Fh in $B6 and compare the nibbles to $B7 so normal Dice will always fail seems pretty deliberate to me.  i've always thought they wanted to reward only 3 matching dice, because the chance of this happening is rare, around 6 times less than that of 2 matching normal dice.  then again, your lenient application of this bonus partially balances out normal Dice always missing the Die3 multiplier.  this weapon has been regarded as a joke, so the new balance might be welcome.

You do make a good point, but I'm still a bit hesitant to believe that they denied the matching bonus to the regular Dice on purpose. They've made similar goof-ups in other areas; for example, the event scripting remedied by my "Returner's Day Off" patch. Also, other sources I've seen, including the FF Wiki and Terii Senshi's algorithm list, claim the matching bonus should apply to both sets of Dice. Then again, Terii Senshi also wrote an algorithm FAQ on GameFAQs that says the opposite. Maybe I should branch this patch out to both possibilities.

Quote
a larger question is what "Fixed" in the name meant in the first place.  does it refer to the matching roll bonus?  or does it refer to the third die not being weighted against you (so an UN-fixing, really)?  or both?

Eh, I'm not going to trifle myself with naming conventions like that.
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

koala_knight

  • Tunnel Armor
  • *
  • Posts: 166
  • Gender: Male
    • View Profile
Re: Two new patches: Better Dice, No X In Fight
« Reply #4 on: March 06, 2016, 09:11:41 PM »
The original name of the Fixed Dice in Japanese was Dice  of Trickery or Dice of Fraud so they should give you an unfair advantage somehow. Whether that should be the matching values bonus or not I don't know.

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: Two new patches: Better Dice, No X In Fight
« Reply #5 on: March 06, 2016, 09:16:40 PM »
The irony there is that in real life, they'd be known as "loaded dice". However, if anything, they're loaded against you because the odds of rolling 5 or 6 are lower than each of the other numbers. It could also simply refer to the fact that they're more powerful than the regular Dice because there's three of them (and the matching bonus probably also factors into that).
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

koala_knight

  • Tunnel Armor
  • *
  • Posts: 166
  • Gender: Male
    • View Profile
Re: Two new patches: Better Dice, No X In Fight
« Reply #6 on: March 06, 2016, 09:32:23 PM »
Yeah. Loaded Dice would definitely have been a better localization.
Out of curiosity, why not just make all the dice have a perfect 1 in 6 chance for all numbers? That would be the closest to real life wouldn't it?
Also, maybe it would be a good idea to make the probability adjustments and the bonus for regular dice into separate patches so people can just choose which ones to use?

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: Two new patches: Better Dice, No X In Fight
« Reply #7 on: March 06, 2016, 09:47:00 PM »
I really don't think it's possible. The problem is that 6 doesn't divide evenly into any power of 2, so any binary PRN will be skewed. The game achieves it with one die by using a frame counter which is always valued 0-59, so there's 60 possible combinations and 60 / 6 = 10. I did see another method that's specifically tailor-made to set the PRN less than a certain value, so arguably I could have asked it to give me a number between 0 and 5, but even that wouldn't be perfect. It would just change the unlikely numbers from 5 and 6 to 3 and 6. The only potential alternative I can think of is adding together three PRNs and dividing their sum by 6, but I'm not sure that even that would work and right now I'm not interested in doing the math to find out.

At the very least, I was able to calculate that my algorithm reduced the variance on one of the still-skewed dice by a factor of 256.
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: Two new patches: Better Dice, No X In Fight
« Reply #8 on: March 06, 2016, 10:11:31 PM »
Actually, now I know it wouldn't because the number of permutations would still be a power of 2 no matter how many PRNs I add together.
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: Two new patches: Better Dice, No X In Fight
« Reply #9 on: March 07, 2016, 06:28:23 AM »
Quote
I don't know what exactly this extra fix will entail, but I hope it doesn't end up being too difficult for you.

thanks.  it involves having the Dice special effect reinstate the attacking hand to the top bit of $B6 when it ends, so my bugfix's Jump animation code can look at it.  istr concluding that the Dice Toss animation ignores that bit, so it won't be a casualty of the change.  accounting for (an)other patch(es) will be difficult in the tedious way.

----------

koala_knight: thanks for the info.

----------

Quote
At the very least, I was able to calculate that my algorithm reduced the variance on one of the still-skewed dice by a factor of 256.

yeah, that's close enough.  who's to say that the weight of the die paint is perfectly balanced out by the lost weight of the die indentations? :P

that said, i think if you make a random # 0-65535 and MOD that by 36 for your "combined roll" value, you will have an even lower variance from ideal.  the downside is, because the spare 16 RNG values are going to a _combined_ roll value, Die X is now being tinily weighted contingent on Die Y's value, and vice versa.  whether that oddity matters more than the advantage of getting closer to 1/6ths, i dunno.

iow, you're squaring both the quantity of extra RNG values, and the much larger denominator.

now, i'm not suggesting you waste time or code space on this method.  it's been purely a thought exercise.
« Last Edit: March 07, 2016, 06:41:54 AM by assassin »

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: Two new patches: Better Dice, No X In Fight
« Reply #10 on: April 23, 2016, 05:25:36 PM »
Bumping this for the new version.
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: Two new patches: Better Dice, No X In Fight
« Reply #11 on: December 26, 2017, 06:04:08 AM »
:bump: Added an option to No X In Fight!
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings