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

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

noisecross

  • FF5 Hacker
  • *
  • Posts: 146
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #15 on: December 12, 2014, 06:51:38 AM »
The edited adresses are the ones I post earlier so C2/855D is not edited in the patch I applied.
I'd like to trace the code to see how the values evolve in an actual battle, but not sure when I'm going to have time to do it.

Digitsie

  • Mom Bomb
  • *
  • Posts: 105
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #16 on: December 12, 2014, 05:10:25 PM »
Would the simplest way to deal be to make an exception where the Goblin Punch is concerned, then?

Or would calculating M that way break everything else?

noisecross

  • FF5 Hacker
  • *
  • Posts: 146
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #17 on: December 13, 2014, 10:29:06 AM »
Hmmm... I have been testing this patch. Only the RPGe v1.1 plus the Fractional M ones.
I cannot reproduce the discussed issue by myself. The Goblin Punch seems to work properly for me.
Find attached the srm used to test the patch.

Jorgur

  • Moderator
  • *
  • Posts: 437
  • Gender: Male
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #18 on: December 13, 2014, 12:56:13 PM »
Apparently it works fine to use Goblin Punch at monsters, but when monsters use Goblin Punch on your party, they do 0 damage. It seems like the monsters use the same method for calculating damage as the characters do, as far as Goblin Punch is concerned. I wonder if this problem occurs in other situations?
« Last Edit: December 13, 2014, 01:02:03 PM by Jorgur »

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 #19 on: December 14, 2014, 06:11:52 AM »
Based on the documents from Fractional M, I think:

[...]

Because '
One more thing you'd need to change re: making M fractional. Since monsters' physical attacks use a fixed value for M (rather than calculating it from the monster's level and stats) you'd have to multiply monster M by 128 before using it. Not a big deal.'

ah, he forgot to do that at C2/85C3.  put a "JSL $D02E68" and two NOPs there.

noisecross

  • FF5 Hacker
  • *
  • Posts: 146
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #20 on: December 14, 2014, 07:58:07 AM »
ah, he forgot to do that at C2/85C3.  put a "JSL $D02E68" and two NOPs there.

I agree. Currently the formula is acting:

Code: [Select]
C2/85C3: BD 62 20     LDA $2062,X
C2/85C6: AA           TAX
C2/85C7: 86 52        STX $52    (M = Monster Attack Multiplier)
C2/85C9: 80 1D        BRA $85E8

And it should act as:

Code: [Select]
C2/85C3: 22 68 2E D0  JSL $D02E68 (M = Monster Attack Multiplier * 128)
C2/85C7: EA           NOP
C2/85C8: EA           NOP
C2/85C9: 80 1D        BRA $85E8

So, to fix that bug the next addresses must be overwritten with:

Code: [Select]
C2/85C3 : 22 68 2E D0 EA EA
« Last Edit: December 14, 2014, 08:48:33 AM by noisecross »

Digitsie

  • Mom Bomb
  • *
  • Posts: 105
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #21 on: December 14, 2014, 09:59:23 AM »
So does that mean the formula needs to be checked for every monster?

noisecross

  • FF5 Hacker
  • *
  • Posts: 146
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #22 on: December 14, 2014, 11:08:45 AM »
Yes and no. Every monster uses the same code to calculate the Goblin Punch damage.

The Goblin Punch damage formula is in fact calculated in the same piece of code for PCs and for monsters.
The PC formula fork in that code is properly edited, but it seems the author forgot to edit also the monsters one.

Currently, the M multiplier when a monster uses the Goblin Punch is 128 times lower than it should be.
Editing the 6 bytes as we said in the C2/85C3 address the M multiplier will be the expected value for every monster using this attack.

Digitsie

  • Mom Bomb
  • *
  • Posts: 105
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #23 on: December 14, 2014, 12:53:35 PM »
I'm a bit uncertain if I've patched the IPS correctly, can you verify?  This is basically the Fractional M patch with the suggested changes, headerless.

(And yes, my first attempt at using an assembly language program, so be warned.)

*edit* removed patch in favor of updated version
« Last Edit: December 15, 2014, 02:00:16 PM by Digitsie »

Jorgur

  • Moderator
  • *
  • Posts: 437
  • Gender: Male
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #24 on: December 14, 2014, 01:01:31 PM »
Does it have the changes to knife parameters as well?

Digitsie

  • Mom Bomb
  • *
  • Posts: 105
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #25 on: December 14, 2014, 01:06:32 PM »
I took the original Fractional M patch, put it on the rom, made the suggested change, then created the IPS patch comparing it off the original ROM.

I -think- it should have the original knife change from the Fractional M patch, as I didn't touch anything else.

Jorgur

  • Moderator
  • *
  • Posts: 437
  • Gender: Male
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #26 on: December 14, 2014, 01:40:01 PM »
Can you make it so the knife parameter change is optional? I never understood why that was part of the fractional M patch in the first place.

Digitsie

  • Mom Bomb
  • *
  • Posts: 105
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #27 on: December 14, 2014, 01:51:06 PM »
I don't know how, to be honest. How is it different from your knife hack, btw?

Jorgur

  • Moderator
  • *
  • Posts: 437
  • Gender: Male
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #28 on: December 14, 2014, 01:58:28 PM »
Quote from: his algo faq
****************************
12.1) KNIVES M PARAMETER BUG
****************************

In the assembly code, it does appear that the formula for M for Knives was
meant to be:

M = (Level*Strength)/128 + (Level*Agility)/128 + 2

However, due to two lines being in the wrong order, only the first byte of
(Level*Agility) is used, instead of the whole 16-bit value.

As an example, let's say your Level is 32 and your Agility is 4.

Level * Agility = 4 * 32 = 128 = 0080h as a 16-bit number.

The first byte of 0080h is 80h = 128.

Divide by 128 = 1

Thus, Level 32 and Agility 4 gives you + 1 M

Now, use Level 32 and Agility 96:

Level * Agility = 32 * 96 = 3072 = 0C00h as a 16-bit number.

The first byte of 0C00h = 00h = 0
Divide by 128 = 0

Thus, Level 32 and Agility 96 gives you 0 bonus to M

So, since the maximum value the first byte of any 16-bit number can be
is FFh = 255, the maximum bonus to M is 255/128 = 1 (round down all fractions).

If you're interested in fixing this bug, use a Hex Editor to edit the FFV ROM
and make the following changes:

The original data at offsets:

$28313: A5
$28314: 26
$28315: C2
$28316: 20

Change these values to:

$28313: C2
$28314: 20
$28315: A5
$28316: 26

(Make a backup of your ROM, first, of course!!!!)

This will make the formula for M be:

M = (Level*Strength)/128 + (Level*Agility)/128 + 2

This change will affect any Attack type that uses the Knives Damage Parameters.
This includes Knives, Bows, Whips, Rising Sun and Full Moon, but not Maneater
or AntiMagic Bow.

Also note, that this gives a noticeable boost in power to any job that uses
those weapons.  Usernamehere from the FFV SNES Message Board has observed that
this fix makes them too powerful for his tastes.  For an alternate but more
complicated fix, you can try the following:

Original values:

$282FD-$28304: 18 69 02 00 85 0E 7B E2
$28305-$2830C: 20 AD E2 7B 85 24 AD E5
$2830D-$28314: 7B 85 25 20 F1 00 A5 26
$28315-$2831C: C2 20 20 BB 01 18 65 0E

$10308A-$103091: 00 00 00 00 00 00 00 00
$103092-$103099: 00 00 00 00 00 00 00 00

Change to:

$282FD-$28304: 85 0E 7B E2 20 AD E2 7B
$28305-$2830C: 85 24 AD E5 7B 85 25 20
$2830D-$28314: F1 00 C2 20 A5 26 20 BB
$28315-$2831C: 01 22 8A 2E D0 69 02 00

$10308A-$103091: 18 C5 12 B0 03 4A 80 04
$103092-$103099: 46 0F 66 0E 65 0E 18 6B

This will make the formula for M be:

If Agility > Strength, M = (Strength*Level)/256 + (Agility*Level)/128 + 2
Otherwise, M = (Strength*Level)/128 + (Agility*Level)/256 + 2
Quote from: the fractional M patch readme
FINAL FANTASY V FRACTIONAL M PATCH

System: SNES
Game ROM applied to:  Final Fantasy V (J).smc

Compatibility:  Original ROM or ROM translated with RPGE 1.10 English translation patch.  Other translations may be compatible but not guaranteed.

Contact info: instructrtrepe@hotmail.com

This .ips patch modifies the damage algorithms in FFV so that damage range increases are more "smooth".  This patch shouldn't change game balance or game difficulty.  However, small changes in Strength or Level should have a more noticeable effect on the amount of physical damage that character can do and small changes in Magic Power or Level should have a more noticeable effect on the amount of magical damage that character can do.

This patch also fixes a damage bug with knives, bows, whips, rising sun and full moon.  The formula for M is changed to:

If Strength > Agility,
M = (Strength*Level/128) + (Agility*Level/256) + 2
Otherwise,
M = (Strength*Level/256) + (Agility*Level/128) + 2

Notice how it makes Knife based weapons stronger?
My hack simply sets M = (Strength*Level/128)  + 2

Digitsie

  • Mom Bomb
  • *
  • Posts: 105
    • View Profile
Re: FFV patches (and compatibility with each other)
« Reply #29 on: December 14, 2014, 02:14:55 PM »
Would it work if I just used the patch, then put the knife patch over it?