Romhacking.net

Romhacking => ROM Hacking Discussion => Topic started by: RobertAugustdeMeijer on June 10, 2015, 06:16:24 am

Title: Changing the chance to run away in Final Fantasy 1
Post by: RobertAugustdeMeijer on June 10, 2015, 06:16:24 am
According to the GameFaqs board, the formula for running away is this:

Luck > 0...[Level + 15]



Is there a way to change that number 15 into, let's say, 20 or 25? Currently, it's too easy to run away in Final Fantasy Ultra.
(A workaround would be to lower all character's Luck, but I'd rather not).
Title: Re: Changing the chance to run away in Final Fantasy 1
Post by: STARWIN on June 10, 2015, 01:22:17 pm
For details, check Disch's disassembly (http://www.romhacking.net/documents/401/) (bank_0C.asm Battle_PlayerTryRun).

He mentions that the level read is bugged.

Finding the value 15 is easy with this, it is the 0x0F in 0x32402. (or search the image for 18 69 0F AA)
Title: Re: Changing the chance to run away in Final Fantasy 1
Post by: RobertAugustdeMeijer on June 10, 2015, 06:25:42 pm
Hey thanks! I've toyed around a bit with the amount, and 38 seems to be close to what I'm looking for.

I wonder if the '...' in the formula is a number between 0 and 255, and that the number is determined at the start of a fight. I have battles that are really hard to escape and ones that are very easy.
Title: Re: Changing the chance to run away in Final Fantasy 1
Post by: Disch on June 10, 2015, 09:30:39 pm
I wonder if the '...' in the formula is a number between 0 and 255


The ellipsis there is used to indicate a random number between the two values surrounding it.

So  'Luck > 0...[Level + 15]' means "Luck > random number between [0, Level+15]"


The number is not determined at the start of a fight, but rather is randomly generated each time you attempt to run.
Title: Re: Changing the chance to run away in Final Fantasy 1
Post by: KingMike on June 11, 2015, 02:24:50 pm
Hey thanks! I've toyed around a bit with the amount, and 38 seems to be close to what I'm looking for.

I wonder if the '...' in the formula is a number between 0 and 255, and that the number is determined at the start of a fight. I have battles that are really hard to escape and ones that are very easy.
There are some battles formations that are programmed to never let you run.
Title: Re: Changing the chance to run away in Final Fantasy 1
Post by: RobertAugustdeMeijer on June 13, 2015, 08:43:58 am
Yups. In my hack there are very few that are 'unfleeable'. That's why I have to get the running away balance just right!
Title: Re: Changing the chance to run away in Final Fantasy 1
Post by: STARWIN on June 13, 2015, 08:58:39 am
Well, if the level read is bugged in your mod too, then there is quite a lot of randomness involved here. Maybe you just can't get the balance "just right" without changing the whole formula.
Title: Re: Changing the chance to run away in Final Fantasy 1
Post by: Disch on June 13, 2015, 11:57:57 pm
FWIW, fixing the run bug is literally a 1-byte change:

Change offset 0x323FF from 80 to 82
Title: Re: Changing the chance to run away in Final Fantasy 1
Post by: RobertAugustdeMeijer on June 14, 2015, 10:36:46 am
Thanks, but the level read change (80 to 82) has already been done. I'm happy with the results I have now... the game is close to being released  :woot!: