Here is a compiling of info (courtesy of Axe) that would be useful for a TAS:
Much information was learned from the algorithm FAQs on gamefaqs. The Game Mechanics Guide recently posted by AstralEsper is probably the most comprehensive algorithms guide. There have also been great FAQs written by paulygon and patbuns. FFhackster is also a great source of information. I also did a lot of assembly analysis myself to learn more details and some of the information here hasn't been posted anywhere before. I'll concentrate on info useful to a TAS. Because of how the run turned out there were a lot of areas I didn't need to explore in a whole lot of detail. But it is important to figure out every detail of the encounter system.
Known glitches and quirks
-Status immunities aren't 100%
Basically, this means that no enemy is immune to status effects including instant death. There is a loophole in how the immunity affects the calculation of whether or not the attack works. This is explained in more detail in the BANE section.
-Sword weaknesses don't work
Coral swd, were swd, rune swd, ice swd, etc were all supposed to do extra damage to some enemies. But they don't.
-Dark status does nothing
Absolutely no change when you have dark status.
-One levelup per battle
If you get enough experience for two levelups, you will only get one right away. You will catch up with the next victorious battle.
-Possible to make bosses flee with FEAR
An enemy runs when:
EnemyMorale - (2 * LeadCharLevel) + randInRange(0, 50) < 80
(See below for how random numbers are generated.)
I haven't investigated when the calculation actually takes place.
Each enemy has a morale level ranging from 105 for cowardly WOLFs to 255 for bosses.
FEAR reduces an enemy's morale by 40. The effect is stackable with multiple casts.
Bosses go through the same run mechanics as normal enemies. But because of their high morale they will not run unless affected by FEAR. It was discussed on the forums here:
http://tasvideos.org/forum/viewtopic.php?t=1421&postdays=0&postorder=asc&start=40
-Black belt's defense rating
On leveling up, a black belt's defense rating is set to 2*level. This gets reset when you visit the armor screen. However, if you don't visit the armor screen you can keep the armor rating and still get any special effects from equipped armor.
Encounter Algorithms
-Encounter table traversal
A counter at $00F5 changes with each step. It may go down or up depending on the value of $00F6. When the high bit is 1, it decrements, otherwise it increments.
Whenever $00F5 hits 0, $00F6 is updated by adding A0. It starts out at FF (on FCEU-may differ on a real NES or other emulators). So the order that the table is traversed goes like this:
down, down, up, down, up, up, down, up, down, (then it repeats)
Encounter table: (All values in hex. Located in $F100 in memory)
1F A6 DE BA CC 12 7D 74 1B F3 B4 88 F8 52 F4 07
90 AB B3 BD AA 55 28 BC 8A 6D 0E C4 83 A9 3B 76
20 7C 09 92 FD 4A A8 F0 61 E3 F2 69 6C BB 38 C3
AE B7 43 84 78 23 7B 9B 2D DB 3E 91 CF 02 2A B6
86 EE 9C 8E B8 6F 1A 57 05 E9 73 31 D2 D9 1D FB
94 9D B1 0A 3A 11 5A 47 95 2C 44 E0 6A 8C 5B 7A
A7 5D 36 70 E5 C7 49 DC 68 97 D8 66 A3 0F B0 9F
03 D6 77 16 13 30 25 3C 10 17 AD 98 6B 2F D7 A1
FF A4 EB 51 FE 27 8D 93 D5 3D F6 08 75 E1 A5 46
63 F5 4D DA 32 AF 40 37 D3 C0 89 67 06 21 6E 81
B5 A0 4F 0C 2E E7 1C 58 85 E8 59 CE 35 CB 1E C6
2B 9A E6 DD F1 EC 96 CA AC 00 50 C9 4C FC 14 7E
56 80 D0 79 BF 29 87 48 24 19 C5 22 71 7F 72 0D
CD 8F BE 3F 9E 34 ED 53 54 04 62 A2 C2 41 5E 82
4B 26 5C 42 65 99 4E 60 8B F7 0B 33 DF D1 64 C8
C1 01 EF F9 FA E4 5F 18 B9 B2 39 D4 15 E2 EA 45
--Thresholds for different areas
For each step, the value accessed in that table is compared with a threshold set for that area. If tableValue <threshold> hitThreshold, miss. No damage.
If hitRoll <= hitThreshold, it's a hit!
hitDamage = damageRoll - targetAbsorb
if hitDamage < 1 then hitDamage = 1
If hitRoll <= critThreshold, it's a critical hit!
hitDamage = hitDamage + damageRoll
If the attacker has multiple hits, repeat, accumulating more and more damage. Enemies have a number of hits stat. For players, number of hits is floor(hit / 32) + 1
Notes:
When hitRoll is 0 it will always be a critical hit. So there's at least a 3/256 chance.
Critical hits deal decent damage regardless of target's defense but can do even more damage when the target has low defense.
-BANE
--If hitRoll <= successThreshold the enemy is killed.
--As in the physical attack, hitRoll comes from randInRange(0, 200). The successThreshold is based on the enemy's magic defense.
--If enemy is immune to poison, successThreshold = 0. So when hitRoll is 0 you always succeed, even when the enemy is immune. This is the essence of the immunity bug.
--There are 3 entries in the table that will give 0 from randInRange(0, 200): the two 0s and the 1. So the chance to BANE an immune enemy is 3/256.
--If we look more specifically at a fight with one living hero in slot 1 vs a poison-immune boss, there is only 1 possible starting seed that will allow the hero to go first and succeed.
-Levelup
--Depending on class and level, you either gain each stat unconditionally or have a 25% chance.
--To make the roll, an rand8bit number is generated.
--The roll for luck succeeds when the low two bits are 0. So 25% chance.
--I didn't look as closely at anything else.
-One character
So if you put everything together you can see why one character is optimal for a TAS. Two characters would have more chances to run, but the chance to run is very high after just a few levels. The third and fourth chars have reduced chances to run. In a fight it's possible to manipulate a miss from the enemy and a strong hit from one low-level char. But at extremely low levels the second char would be much less effective. Finally, you can manipulate stats if you concentrate on one char. Otherwise it's not practical given all the other things that need to be manipulated.
We will be collaborating to create an improvement to Axe's current run.
The impossible shall be made possible!