View Page Source

Back to Page
Revision (current)
Last Updated by Darkman425 on 1/30/2022 4:29 AM
!!The RNG
As with other RPGs, Final Fantasy Legend also has an RNG. It is difficult to manipulate, as it will only increment through actions, or get shuffled by a soft reset. The soft reset RNG manipulation is mostly frame-based, but something like entering a menu can slightly affect it.

Unfortunately, soft resets seem to revert to a default for the ''battle'' RNG, meaning if it's impossible to win after a reset, there's no way to manipulate that short of getting into another battle before the impossible one, and don't reset along the way.

! RNG Addresses
Final Fantasy Legend uses a different address for almost every different effect possible.  There are 128 such addresses, stored in the RAM from {{C300}} through {{C37F}}.  Manipulating one will not affect whether a different action is successful, as almost every action that needs an RNG has its own address it can use.  With no known exception, each RNG address rolls once per use, incrementing by one after each use.  For example, the Mutant growth RNG address, {{C30B}} is rolled once per mutant at the end of every battle; if it is 123 in a party of three mutants, it will increase to 126 after the next battle.

After resetting, each RNG reverts to a value offset from {{C300}}'s by some amount that varies slightly.  The formula for the offset of each value is believed to be%%%
''y'' is the offset amount%%%
''x'' is the difference between the RAM address in question and {{C300}} (e.g., for RAM address {{C30B}}, x is 11)%%%
''b'' is the value of {{C300}} plus some unknown fractional amount%%%

The "unknown fractional amount" in b makes many of the RAM addresses inconsistent, but it also frees up an additional degree of freedom to manipulate luck.  For example, {{C358}}'s offset is +12 3/8.  Roughly speaking, this means that when the game is (soft) reset, three out of eight times {{C358}}'s value will be 13 higher than {{C300}}'s; the five other times, it will be 12 higher.  To check the feasibility of manipulating two addresses simultaneously, simply subtract their offsets.  In the case of {{C30B}} and {{C34B}}, the net offset is +9, meaning {{C34B}}'s value will ''always'' be 9 greater than {{C30B}}'s value and those two addresses are "locked" to each other.  It is therefore impossible to manipulate mutant bonus type and mutant abilities independently.

The following is an incomplete list of RNG addresses used by the game.

||RAM Addr||{{C300}} Offset||Notes||Value Use|
|{{C309}}|+1 17/64 = +1.27|Mutant: HP growth|10 + INT(RNG*5/255) (conjectured)|
|{{C30B}}|+1 35/64 = +1.55|Mutant: Bonus type%%%(Ability, HP, Mana, Agl., Str., Def., shuffle uses, or none)|0-34: New ability; 35-68: HP up; 69-98: Mana up; 99-116: Agl. up; 117-134: Str. up;%%%135-142: Def. up; 143-146: shuffle abilities; 147-255: nothing|
|{{C30D}}|+1 53/64 = +1.83|NPC: Which direction next?|0-42: south; 43-127: north; 128-212: west; 213-255: east|
|{{C30E}}|+1 31/32 = +1.97|Mutant: Ability Uses shuffler|0-42: divide by 2 (then round down) or add 1 if no uses left; 43-127: add original number of uses;%%%128-212: subtract original number of uses; 213-255: reset to original number of uses|
|{{C31B}}|+3 51/64 = +3.80|HP potion RNG|Unknown|
|{{C323}}|+4 59/64 = +4.92|Battle: Run away|0-126: can't run; 127-255: can run|
|{{C325}}|+5 13/64 = +5.20|Flashy enemy fade-in animation| |
|{{C326}}|+5 11/32 = +5.34|Broken; +1 each time Uses Shuffler picks a full decrease| |
|{{C334}}|+7 5/16 = +7.31|Broken; +1 each time the Uses Shuffler picks a full increase| |
|{{C33B}}|+8 19/64 = +8.30|Random battle trigger|Terrain dependent.  Encounter rates include... Glider: 3; Plains: 5; Forest: 6; Swamp: 13; SU-ZAKU (by foot): 64|
|{{C343}}|+9 27/64 = +9.42|Encounter: Which monster groups do you fight?|Seven possible encounters.  Bins are 0-3 (very rare), 4-7, 8-15, 16-31, 32-63, 63-127, 128-255 (common).|
|{{C347}}|+9 63/64 = +9.98|Bonus from STRENGTH or AGILITY items|Unknown|
|{{C34B}}|+10 35/64 = +10.55|Mutant: Which ability does one get?%%%Mutant: Str., Def., Agl., or Mana growth|Ability: Rolled and incremented until the RNG is greater than or equal to 239.%%%Mana, Agl., and Str. growth: 1 + INT(RNG*4/255) (conjectured)%%%Def. growth: 1+INT(RNG*2/255) (conjectured)|
|{{C34F}}|+11 7/64 = +11.11|Probably used for NPCs. Might be used to increment {{C369}} with nearby NPC| |
|{{C352}}|+11 17/32 = +11.53|Rolled when using STENCH in battle| |
|{{C353}}|+11 43/64 = +11.67|Encounter: How many monsters in each group?|Unknown|
|{{C358}}|+12 3/8 = +12.38|Item: POTION's recovery|For POTION: INT(RNG*20/255).  For X-POTION: INT(RNG*60/255).|
|{{C35A}}|+12 21/32 = +12.66|Enemy targeting|Unknown|
|{{C35C}}|+12 15/16 = +12.94|Will a meat drop from an enemy?|Unknown|
|{{C369}}|+14 49/64 = +14.77|NPC: Determines when an NPC will take a step, apparently.|Unknown|
|{{C36F}}|+15 39/64 = +15.61|Mutant: What one of four slots to put an ability?|	0-42: Slot 1; 43-127: Slot 2; 128-212: Slot 3; 213-255: Slot 4%%%Increments only if the effect of address {{C30B}} will actually affect that slot with a valid ability shuffle or change it to a new ability.|

! RNG Table
All random numbers with the exception of those used in battles (which are poorly understood) are pulled from the same RNG table.  This table has a period of 256 and runs through all values from 0 to 255.

In the following table, the row indicates the first byte while the column indicates the second byte.  For example, if RAM address {{C30B}} is 162 (A2 in hex), the RNG will roll a (decimal) value of 88.

| ||0||1||2||3||4||5||6||7||8||9||A||B||C||D||E||F|
||1|156|185| 7 |82|116|254|239|74|204|201|168|194|91|17|192|69|
||2|252|217|167|205|212|222|112|213|211|233| 8 |93| 4 |49|32|154|
||7|220|134|56|109|180|62|175|117|243|118|232| 2 |27|209|255|250|
||9|99|70|248|173|139| 1 |16|181|51|54|87|61|164|238|63|186|
||A| 3 |38|88|50|43|33|143|42|44|22|247|162|251|206|223|101|
||B|92| 6 |71|237|52|65|208|245|140| 9 |104|125|155|174|128|122|
||F|35|121|199|146|75|193|80|138|12|137|23|253|228|46| 0 | 5 

Here is the same table in hex format:
| ||0||1||2||3||4||5||6||7||8||9||A||B||C||D||E||F|

Some tricks and quirks that would be good to keep in mind.

! The game only accepts input at a minimum of pairs
If you hold down a button for a single frame, the game won't even process it. You must hold each button you want to press for two frames rather than one.

The game uses AND logic, so ''releasing'' a button for a single frame gets a reaction.

In effect, turbo button pressing would be {{AA.AA.AA.AA.}} and so on.

! Resets are faster than running
An optimal run away takes around 20 frames longer than an optimal reset. In addition, it is possible to manipulate {{C33B}} into giving you a high step count before another battle using a reset.

! GEN-BU Skip
Have a Mutant learn TELEPOR before you fight GEN-BU. After you put the three KING items on the statue, use TELEPOR to get to the tower. Because you didn't walk on a certain trigger tile, poor GEN-BU never gets a chance to fight you.

! STONE Book -- The Instant Art Kit
Bosses are immune to the PARA element, which includes many status effects and instant death. However, most have no immunity to the STONE element, in which petrification acts like instant death anyway.

The earliest you can get a STONE Book is in World 3, in a shop in the hidden town.

! SAW Glitch
The SAW is an instant death item and a monster ability. Both the ability on a BEETLE or WARRIOR and the actual item has a chance to hit based on strength. It also has an additional requirement, in that your strength must be ''less'' than the enemy's defense for it to even work.

There are four battles where you can't STONE the boss, but have access to the SAW item. It's these battles where the SAW can prove useful.

! Vital Hit Rate
The battle RNG insists on resetting back to a default state after a reset. As such, the first action will always hit or miss depending on how accurate it is.

For status spells, your Mana needs to be at least Enemy Mana-4 to guarantee a hit from the first shot. Most endgame bosses have a Mana of 100, so in order to petrify them in the first action, you need 96 Mana by the endgame.

For the SAW item, you need Str. of 75 or higher to hit first thing. Keep in mind that if your Str. is above the enemy's Def., it will ''never'' hit!

! Forced battles notes
|{{1-1 P-FROG}}|82|Yes|Yes| |
|{{1-1 KINGSWRD}}|103|Yes|Yes| |
|{{1-2 SKELETON%%%0-2 ASIGARU}}|20%%%20| %%%Yes|Yes%%%Yes| |
|{{1-1 STEWARD}}|20| Yes | Yes| |
|{{1-1 GEN-BU}}|250| |Yes|Can be skipped by TELEPOR|
|{{1-1 SEI-RYU}}|600| |Yes|No stoning item possible at this point|
|{{1-3 MOSQUITO}}|150|Yes|Yes| |
|{{1-1 GARLIC%%%1-1 SABERCAT%%%1-1 P-WORM}}|231%%%202%%%231|Yes%%%Yes%%%Yes|Yes%%%Yes%%%Yes|Gah, 3 durable groups|
|{{1-3 SABERCAT}}|202|Yes|Yes| |
|{{1-1 BYAK-KO}}|1000| |Yes|STONE book available by this time|
|{{1-3 ATOM ANT}}|295|Yes|Yes| |
|{{1-1 EVIL EYE}}|606|Yes|Yes| |
|{{1-1 MACHINE}}|1000| | |First forced enemy immune to STONE|
|{{1-1 SU-ZAKU}}|1500| |Yes| |
|{{1-1 ASHURA}}|2000| | | |
|{{1-1 GEN-BU2}}|1500| | | |
|{{1-1 SEI-RYU2}}|1750| |Yes| |
|{{1-1 BYAK-KO2}}|2000| |Yes| |
|{{1-1 SU-ZAKU2}}|2500| |Yes| |
|{{1-1 CREATOR}}|5000| | | |