øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=1975.60e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index62e9.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&board=17.60e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index62e9.html.zxŒ9h^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ °VV$OKtext/htmlISO-8859-1gzip0|ÖV$ÿÿÿÿÿÿÿÿWed, 11 Mar 2020 01:22:44 GMT0ó°° ®0®P®€§²ð®‹9h^ÿÿÿÿÿÿÿÿ¶)V$ FFV patches (and compatibility with each other)

Author Topic: FFV patches (and compatibility with each other)  (Read 31722 times)

Digitsie

  • Mom Bomb
  • *
  • Posts: 105
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #60 on: December 16, 2014, 08:36:36 PM »
I'm almost persuaded by the argument, but what do the damage numbers look like at each level with either approach?

assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: FFV patches (and compatibility with each other)
« Reply #61 on: December 16, 2014, 08:48:52 PM »
re my overflow concerns: okay, i looked at guides to have a sense of what the stats are.  so it's looking like just Goblin Punch is susceptible (and even that hasn't been tested).  now, if i put the planned fix where i think it's going, it'll encompass all sorts of attacks, but should have no effect on those whose damage is already within 16 bits.

to be sure, how many damage boosters (i.e. to Attack or M) can be combined on a single strike?  can Double Grip and SwordDance and Berserk all come into play at once?  also, does dual-wielding indeed cause separate strikes with separate damages, or does it do something dumb like merge the two weapons into a single strike?

noisecross

  • FF5 Hacker
  • *
  • Posts: 146
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #62 on: December 17, 2014, 03:23:52 AM »
(BTW, noise, why is your ips patch larger than mine?)

Because mine seems to be wrong. I'm going to check versions and fix it.
:edit: It's done.

Yes, this seems strange. Just to clarify, what I meant in my request was a patch that adds a fractional M system without affecting the Knife damage formula at all.

The Fractional M system affects the Knife damage formula resulting in a 50% extra damage. I'm assuming you want a Fractional M where the Goblin Punch is fixed and Agility is not taken into account to calculate the knives damage, am I right? The last IPS uploaded by Digitsie is just that.

Anyway, I still prefer my last approach to reward Agility based classes  :laugh:
« Last Edit: December 17, 2014, 04:11:12 AM by noisecross »

noisecross

  • FF5 Hacker
  • *
  • Posts: 146
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #63 on: December 17, 2014, 06:45:05 AM »
re my overflow concerns

To know what stats and mechanics are playing in any attack, reffer to the FFV ALGORITHMS AND STATS FAQ. Tracing the code of a Goblin Punch performed by a PC I found that:

Code: [Select]
Attack = (8 bit) left hand + (8 bit) right hand = (16 bit sum)
     M = (8 bit) level * (8 bit) strength = (16 bit product)
     M = (16 bit) M / 128 + 2 = (16 bit result)
Attack = (16 bit) Attack * 8
Damage = (16 bit) Attack * (16 bit) M = (32 bit product)

if ((16 bits) Damage /* WRONG! */ > 9999)
    Damage = 9999

That last check is done in:

Code: [Select]
C2/9419: A6 2E        LDX $2E
C2/941B: E0 0F 27     CPX #$270F
C2/941E: 90 03        BCC $9423
C2/9420: A2 0F 27     LDX #$270F  (Max Damage = 9999)

so if you are going to patch it, that should be a good choice to start in that point.

Let's suppose then a PC in Lv 97 equipped with Ragnarok + Brave Blade and facing Halicarnaso:

Code: [Select]
Attack = 140 + 150          = 290
     M = (97 * 255)/128 + 2 = 195
Damage = ((290 * 8) = 2320) * (197) = 457040 (Which is a 19 bits number)

An overflow is possible but probably nobody is going to notice it ever. It is very probable (1/8) when a number is so high than one of the three highest bits of the 16 bit capped Damage to be 1, and that means a damage of 9999.

Jorgur

  • Moderator
  • *
  • Posts: 437
  • Gender: Male
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #64 on: December 17, 2014, 06:47:56 AM »
but it's unlikely Square had Agility in that function by accident.  so imho, the best fix tries to figure out in what capacity Agility would've likely been used, while still retaining balance.
It's not quite that simple, you cannot retain balance if you include Agility. By default, in vanilla (unpatched) FF5, Knife based weapons do the exact same damage as Sword based weapons if they have the same attack power (because of the bug, knives sometimes do a little extra). It's a very simple, understandable way to calculate damage - if the weapons have the same attack power, they do the same damage. If, on the other hand, you patch the ROM to include Agility, it becomes a lot more complicated.

Take as an example a Knight wielding a Mythril Sword. You happen to find a MageMasher knife. Normally the two weapons do the exact same damage, but if half the Strength influence is replaced by Agility, the MageMasher will end up doing less damage (because Knight has low Agility).

Maybe this was intended, who knows? However, the fact remains that this is a very serious change to game balance and therefore, in my opinion, should be classified as a game modification, not a bug fix.
Quote
without an extra term in the formula, Knives are more of a poor man's Swords.  they don't really have anything to set them apart.
This is not true. According to instructrtrepe's algorithm guide, all knife based weapons halve the enemy evade stat when used. This alone gives knives an advantage over swords. Another important thing to remember is that almost any job can wield knives. Instead of buying a sword, an axe, a katana and a spear for your warrior character you can simply buy one knife.
Quote
I'm almost persuaded by the argument, but what do the damage numbers look like at each level with either approach?
With (Level*Strength)/128 + 2 (or vanilla FF5), knives do the exact same damage as swords of the same attack power. Every 3-6 levels the attacks become a bit stronger.
With (Level*Strength)/256 + (Level*Agility)/256 + 2, it depends on which job your are using:
- Knight/Samurai/Berserker/Blue Mage will do less damage with knives than with swords
- Dragoon will do a little less damage with knives
- Freelancer/Mystic Knight/Red Mage will have almost exactly the same damage with knives and swords
In a very general sense, low agility jobs will have less damage with knives and high agility jobs will have more.
Quote
I'm assuming you want a Fractional M where the Goblin Punch is fixed and Agility is not taken into account to calculate the knives damage, am I right?
Not quite, what I want is a patch that adds a fractional M system (with Goblin Punch fixed) without affecting the knife damage formula at all.
If my ROM uses (Level*Strength)/128 + 2, and I apply the patch, the formula should still be (Level*Strength)/128 + 2.
If my ROM uses (Level*Strength)/256 + (Level*Agility)/256 + 2, and I apply the patch, the formula should still be (Level*Strength)/256 + (Level*Agility)/256 + 2.
« Last Edit: December 17, 2014, 06:53:55 AM by Jorgur »

noisecross

  • FF5 Hacker
  • *
  • Posts: 146
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #65 on: December 17, 2014, 07:01:58 AM »
Not quite, what I want is a patch that adds a fractional M system (with Goblin Punch fixed) without affecting the knife damage formula at all.

That is not possible... the formula must be edited as the " / 128" operation is delayed in that system. The edition is different in the vanilla game (where you can just overwrite that operation with NOPs) than in a "[...]/256 + [...]/256" (where you should overwrite these operation with "/ 2" instead). And in the end, you have always to change the "+ 2" at the end for a "+ 255"...

Jorgur

  • Moderator
  • *
  • Posts: 437
  • Gender: Male
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #66 on: December 17, 2014, 07:38:32 AM »
Oh, I see, I misunderstood. I somehow thought it was possible to separate the fractional M patch and the knife fix patch, but I guess not. It does indeed seem there will have to be a number of different fractional M patches available.

noisecross

  • FF5 Hacker
  • *
  • Posts: 146
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #67 on: December 17, 2014, 08:34:00 AM »
It does indeed seem there will have to be a number of different fractional M patches available.

Yes, it does.
Currently you have two patches with the Goblin Punch issue fixed. One of them with the original Fractional M knives damage formula philosophy (I have fixed it today in Reply #51) plus one more which ignores agility in the knives damage formula (uploaded by Digitsie in Reply #56).

Jorgur

  • Moderator
  • *
  • Posts: 437
  • Gender: Male
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #68 on: December 17, 2014, 08:42:56 AM »
I just wrote a page on the fractional M patch in the wiki:
http://slickproductions.org/slickwiki/index.php/FF5_Patch:Fractional_M

If you decide to make more patches you could add them to the page.

noisecross

  • FF5 Hacker
  • *
  • Posts: 146
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #69 on: December 17, 2014, 08:55:24 AM »
Nice. I'd like to add two things there:

  1. The Chicken Knife has it's own M formula which, as long as I know, is not bugged
Code: [Select]
M = (Lv * STR) / 128 + (Lv * AGL) / 128 + 2

  2. The original Fractional M and every new version let that formula as it
Code: [Select]
M = (Lv * STR) + (Lv * AGL) + 256    // The "/128" is delayed

No "Agility > Strength" or "Ignore Agility" check is done when we are talking about the Chicken Knife.
« Last Edit: December 17, 2014, 09:00:26 AM by noisecross »

Jorgur

  • Moderator
  • *
  • Posts: 437
  • Gender: Male
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #70 on: December 17, 2014, 09:03:49 AM »
Sure, go ahead! I will be using the "Discussion" sub-page for feedback and further suggestions.

I have also written these pages so far:
http://slickproductions.org/slickwiki/index.php/Final_Fantasy_V_Patches
http://slickproductions.org/slickwiki/index.php/User:Jorgur

It's all still kind of rough, unpolished, but we can improve it over time.

Digitsie

  • Mom Bomb
  • *
  • Posts: 105
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #71 on: December 17, 2014, 09:26:57 AM »
Out of curiousity, is it fair to offer a 'compiled' patch here?

By which I mean, I was thinking of the 'fixes' so far, as well as the translation patches (the original, and the addendum).

Also, I have a suggestion on the patches pages -

Can we list what bytes the patches changes so that you can see what patches overlap, if any, there are? That way you can show the 'compilation' against that.

Jorgur

  • Moderator
  • *
  • Posts: 437
  • Gender: Male
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #72 on: December 17, 2014, 09:34:18 AM »
Out of curiousity, is it fair to offer a 'compiled' patch here?

By which I mean, I was thinking of the 'fixes' so far, as well as the translation patches (the original, and the addendum).
I see nothing wrong with that.

Also, I have a suggestion on the patches pages -

Can we list what bytes the patches changes so that you can see what patches overlap, if any, there are? That way you can show the 'compilation' against that.
That's a good idea, why not add it to the pages?

Digitsie

  • Mom Bomb
  • *
  • Posts: 105
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #73 on: December 17, 2014, 10:14:55 AM »
I'd happily do it if someone can point me towards how to check what assembly codes are modified in an IPS patch against a clean patch, as I can't locate such an utility.

How did you handle it, noise?

noisecross

  • FF5 Hacker
  • *
  • Posts: 146
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #74 on: December 17, 2014, 11:13:26 AM »
I'd happily do it if someone can point me towards how to check what assembly codes are modified in an IPS patch against a clean patch, as I can't locate such an utility.

How did you handle it, noise?

I wrote a (dirty and slow) handmade utility to compare SMC files.  :edit: I have improve the comparator this evening. Sharing here if you want to see it.

You can also figure out what bytes are modified by an IPS reading it with a hex editor. The IPS format is pretty simple http://zerosoft.zophar.net/ips.php
« Last Edit: December 17, 2014, 06:36:12 PM by noisecross »