• Topic Archived
You're browsing the GameFAQs Message Boards as a guest. Sign Up for free (or Log In if you already have an account) to be able to post messages, change how messages are displayed, and view media in posts.
  1. Boards
  2. The Final Fantasy Legend
  3. Mutant growth dissected (megaspoilers?)

User Info: Alex Jackson

Alex Jackson
13 years ago#1
Has this been posted here before? I seem to remember DamageInc mentioning that he had looked at how Mutant growth works via disassembly/debugging, but I don't know how far he got.

Unlike FFL2, Mutants' growth after a battle in FFL is not affected either by the "level" of the enemies you defeated, nor by what items/abilities the Mutant used in the battle. Contrary to what numerous FAQs and reviews claim, using "Strength weapons" does not help Mutants gain more Strength, et cetera.

At the end of a battle, for each Mutant in the party, the game generates a "random" number between 0 and 255 and chooses one of eight growth types based on the number. For ROM hackers, the "bins" for each of the growth types are located at ROM addresses 0x1BF00 to 0x1BF07.

0 to 34 (35/256 chance) Gain a new ability. The 32 abilities that a Mutant can gain are stored at ROM addresses 1BF0F to 1BF4E (each ability is followed by its initial number of uses--why they don't just look the uses up from either of the two other places they're stored in the ROM is beyond me) The game "randomly" chooses an ability, then "randomly" chooses which of the first four inventory slots to put it in (equal chance of each slot). Theoretically, the chance of getting the n'th ability on the list is geometrically distributed with p=0.1 (i.e. 10% chance of getting "ESP", the first ability on the list; 9% chance of getting "BARRIER", the second ability; 8.1% chance of getting "FORSEEN"; et cetera) but because FFL has a crummy pseudorandom number generator with a period of only 256, it isn't really; I'm not sure if it's even possible to gain all the abilities on the list (has anyone ever gotten oDAMAGE or oCHANGE on a Mutant in FFL1?) PROTIP for aspiring game programmers: Don't actually model a geometric distribution (that's the "keep flipping until you get heads and count how long it takes" kind) using a PRNG, even if you have a pretty good one. Use a lookup table--it's faster, more accurate (vastly more so with most PRNG algorithms), and doesn't muck up the state of the PRNG for the next routine that needs to use it.

35 to 68 (34/256 chance) Gain 10-15 HP. For ROM hackers, this range is looked up from ROM address 0x1BF0A--the high 4 bits are the minimum and the low 4 bits are the maximum. After adding, the Mutant's max HP is capped at 999.

69 to 98 (30/256 chance) Gain 1-5 Mana. The range of growth is looked up from ROM address 0x1BF0E. After adding, the Mutant's Mana is capped at 99--this can result in losing Mana if the Mutant was previously buffed above 99 by equipment.

99 to 116 (18/256 chance) Gain 1-5 Agility. The range of growth is looked up from ROM address 0x1BF0D. Capped at 99 afterwards just like Mana, with the same caveat regarding equipment.

117 to 134 (18/256 chance) Gain 1-5 Strength. The range of growth is looked up from ROM address 0x1BF0B. Capped at 99 afterwards just like the other stats.

135 to 142 (8/256 chance) Gain 1-3 Defence. The range of growth is looked up from ROM address 0x1BF0C. Capped at 99 afterwards just like the other stats.

143 to 146 (4/256 chance) This is the one that "shuffles" your abilities' remaining uses (no, the fact that Mutant abilities occasionally do that isn't a bug after all) I haven't figured out exactly how it works yet.

147 to 255 (109/256) Nothing.
My fists have your blood of them.

User Info: DamageInc

DamageInc
13 years ago#2
This is brilliant.

I never got this far when I was messing with it all those years ago. One thing that I'd been curious about was whether they'd actually bothered to enforce a 99 cap on mutant stat growth... I suspected that this was true, but wasn't sure.

Magnificently done!
And so ten centuries solemnly collide...
http://www.mikedebo.ca/

User Info: Alex Jackson

Alex Jackson
13 years ago#3
Here's how the use-shuffling works. It turns out there's a good reason the code had me confused at first...

For each of the Mutant's abilities (skipping abilities like STEALTH that don't have a number of uses), "randomly" choose one of the following four operations (equal chance of each):

1) Subtract the ability's "initial" number of uses from the remaining uses. If the result is negative (which it almost always is, for obvious reasons) set the uses to zero. This code for this operation looks suspicious; it divides the initial number of uses by 4 but doesn't use the result (the register containing it gets overwritten immediately), and it also generates a random number which it doesn't use. If you switched the order of two machine language instructions in the routine, it would instead subtract a random number between 0 and 1/4 the initial number of uses; this makes a lot more sense, and is probably what the routine was actually supposed to do.

2) Add the "initial" number of uses to the remaining uses. If the result is greater than 99, set it to 99. Like the previous operation, it looks like this routine was actually supposed to add a random number between 0 and 1/4 the initial number of uses.

3) Halve the remaining number of uses, rounding down. If the result is zero, set it to 1. This actually adds 1 use if the ability was completely depleted.

4) Restore the number of uses to the initial number.

Note: the "initial" number of uses is the one stored in the item/ability battle data in ROM bank 6, not the one stored with the item/ability names in ROM bank 5. In the Japanese version of the game it doesn't matter since the two are consistent with each other, but in the English version there's one ability (and several items) for which the two differ, due to carelessness by the localization team.
My fists have your blood of them.

User Info: bri_of_esc

bri_of_esc
13 years ago#4
This is quite interesting... I've been trying to understand this game's mechanics for a while... It seems weird, but the anomalies were one of the reasons I kept on playing this game... The mistranslations (and apparently copious programming issues) always kept the player trying to discover what was going on...

It's nice to see this game is still getting some attention. Old game mechanics are trivial yet somehow riveting. Also of note is that this is probably better than the entire Mutant FAQ, which this contradicts in numerous areas...

And I just got O-change last week, for the first time. It overwrote Quake. Great.
Role Playing, RPG creation, RPGmaker Resources, Idiocy... And Team Olympus now in Beta!
http://www.wombatrpgs.tk

User Info: Travincal

Travincal
13 years ago#5
Alex, are you a statistician? Just curious, because most people don't know what a pmf for a geometric distribution is.

User Info: Alex Jackson

Alex Jackson
13 years ago#6
My field is biology, actually, which means I have a certain amount of (much more practical than theoretical) knowledge of statistics. Also, I doubt most people reading this thread even know the term pmf (which I never used).

In plain English, the way the game chooses which Mutant ability you learn is by checking each ability in order, with a 1 in 10 chance to learn that ability and 9 in 10 chance to skip to the next ability and test it the same way. If the game had a "perfect" random number generator (which is impossible with a software algorithm) such that each random number generated was completely independent of the preceding ones, the probability to learn each ability would be:

First ability on list 0.1
2nd ability on list: 0.9 * 0.1
3rd ability on list: 0.9 * 0.9 * 0.1
4th ability on list: 0.9 * 0.9 * 0.9 * 0.1
5th ability on list: 0.9 * 0.9 * 0.9 * 0.9 * 0.1

..et cetera.

I can't believe I forgot to include the ability list. The 32 abilities you can learn, in order from (nominally) commonest to rarest, are:

ESP
BARRIER
FORSEEN
ELECTRO
STENCH
FLAME
MIRROR (10)
ARMOR
ICE
STEALTH
KINESIS
THUNDER
POWER
HEAL
GAS
xFIRE
oFIRE
BURNING
SL-GAZE
TELEPOR
P-FANGS
HYPNOS
LEECH
P-BLAST
oPAR/WP
MIRROR (3)
GAZE (stone)
GAZE (confuse)
QUAKE
GAZE (death)
oDAMAGE
oCHANGE
My fists have your blood of them.

User Info: DamageInc

DamageInc
13 years ago#7
Heh... my undergraduate was in bioinformatics / computational biology :D

All this time I thought there was a FLARE ability for mutants, but I guess I was just deluding myself.

And so ten centuries solemnly collide...
http://www.mikedebo.ca/

User Info: Alex Jackson

Alex Jackson
13 years ago#8
Maybe you were thinking of FFL2? I've seen guides that erroneously claim STEAL, EXPLODE and P-SKIN are learnable by Mutants (all of which are in FFL2), so you wouldn't be the first to get the two games mixed up.

After dumping the Mutant ability lists from both FFL and FFL2, I've noticed a conceptual difference between Mutants in the two games. In FFL1 Mutants don't learn "magic"--none of the abilities that have spellbook versions are on the Mutant list (notice that Mutants get FLAME and THUNDER, not FIRE and ELEC) In FFL2, on the other hand, nearly all the "spellbook" abilities are learnable by Mutants.
My fists have your blood of them.

User Info: _Kaz

_Kaz
12 years ago#9
Bump?
(Boy, this makes the Mutants of the game seem like walking boggle tumblers... which they really do play like.)

~Kaz
Fighter: "Mr Pibb", "Dr Pepper".. I'm onto you..
Kaz Fact: Welcome to Version 2.0!
  1. Boards
  2. The Final Fantasy Legend
  3. Mutant growth dissected (megaspoilers?)
  • Topic Archived

GameFAQs Q&A