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.