1 2
9 10 11 12 13
Ambassador, Experienced player (708)
Joined: 7/17/2004
Posts: 985
Location: The FLOATING CASTLE
Ah, defense sword is worth thinking about. But doing waterfall first may not be practical due to how encounters work out. It's actually very difficult to avoid non-runnable encounters in the Sea Shrine. Difficult to plan, but that route change is likely to add more encounters to run from. If possible, confuse staff could also be useful for manipulation. Light axe could also be interesting but I doubt it's a big enough jump from flame sword to be worthwhile. Sorry, I didn't explain that the table is all raw random numbers. The number from that table is used to get a number up to 200. Here's how it works:
randInRange(min, max) = ((1+min+max) * rawRand / 256) - min
This is an assembly level function used by just about every random roll in the game. There is a clever sub function implementing 8bit * 8bit -> 16 bit multiplication. Dividing by 256 just means taking the high byte of that result. The hit roll is calculated as randInRange(0, 200). When that number is <= the crit threshold / weapon index then you get a crit. By the way, this same hit roll calculation is done for BANE. The glitch is that a hit roll of 0 succeeds on an immune target. If you look through that table you'll see 00 twice and 01 once. Those are the 3 in 256 values that get you a hit roll of 0 that lets you BANE an immune enemy. Well, it seems like it should be possible to beat Kraken faster but it's not going to be easy.
Active player (434)
Joined: 9/27/2004
Posts: 650
Location: Canada
TheAxeMan wrote:
But doing waterfall first may not be practical due to how encounters work out. It's actually very difficult to avoid non-runnable encounters in the Sea Shrine. Difficult to plan, but that route change is likely to add more encounters to run from.
Ah, fair enough. Even if the Defense cuts the fight in half I can see how it would be easily lost with bad luck. I remember seeing a steps-to-battle list somewhere on GameFAQs, though, and IIRC it works pretty similarly to the encounter list itself, so it's probably possible to simulate both routes at different likely points in the lists and figure out if there's a favorable situation. It would be a lot of work though, I guess.
Ambassador, Experienced player (708)
Joined: 7/17/2004
Posts: 985
Location: The FLOATING CASTLE
Wait, Defense sword can't be equipped by an unpromoted fighter. So that's definitely out. But yes, it's not a problem to simulate both routes or any changes. I still have all the tools I made for the current run to do this. For encounters there are still some details I know about that I haven't seen in any FAQs. Someday I'll get that info out there. Anyway, I can simulate encounters with 100% accuracy so I can figure out how things are affected without having to play through. Edit: A quick go at Kraken with the light axe determines that I could save only one or two turns. There are two light axes in the Sea Shrine and both are about 40 steps out of the way in territory where unrunnable fights are a problem. Of course I wouldn't need to get flame sword but flame sword is only 7 steps out of the way and fits in very nicely to the flow. So I might check how this affects encounters but it's unlikely to work. Another bonus to flame sword is that it hits the elemental weakness for the Blue dragon in Mirage. Monster type weaknesses don't work but elemental ones do. So flame sword does extra damage vs blue dragon while dragon sword does not. Furthermore, resistance to an element doesn't affect physical attacks, just magic. So flame sword does normal damage to Kraken even though he is fire-resistant. Only three weapons have elemental properties: Flame Sword (fire), Ice Sword (ice) and Xcalber (all elements!).
Active player (434)
Joined: 9/27/2004
Posts: 650
Location: Canada
TheAxeMan wrote:
A quick go at Kraken with the light axe determines that I could save only one or two turns. [...] I might check how this affects encounters but it's unlikely to work.
Ah, too bad. I can't believe I didn't even notice the Fighter couldn't equip the Defense Sword. But at least that's more or less all of the useful weapons that are on the way considered, though I am still curious if the Coral Sword's small boost in crit % would do anything. At least the Hand Axe will be helpful.
TheAxeMan wrote:
Monster type weaknesses don't work but elemental ones do. So flame sword does extra damage vs blue dragon while dragon sword does not.
Are you sure about this one? I thought the elemental/monster type strength was simply never checked during the damage calculations even though the types are all set and the calculation itself exists. Something else that occurs to me is that if a monster is stunned or asleep, it increases damage by 25% or something. Although I can't think of a way to make use of it besides perhaps vs garland.
Ambassador, Experienced player (708)
Joined: 7/17/2004
Posts: 985
Location: The FLOATING CASTLE
I tried out coral sword on a few bosses. The extra crit chance might give a small benefit to luck manipulation but because of how the RNG works it doesn't provide any increase in damage. It would add more steps in Earth cave to get it. Another issue is the fact that I need savegame items to manipulate luck. There is a cabin right next to coral sword but there is a cabin and a house in the dragon sword treasure room, plus it's in dwarf cave where there are no encounters. I need both of those before reaching Crescent Lake where I could conveniently visit an item shop. Gaia's item shop is even less out of the way so ideally I'd want to shop there. Anyway, coral sword has long been on my list of possibilities but dragon sword seems to fit in better overall. Elemental weaknesses and monster type weaknesses are two different things. There is a separate byte for each. Lots of weapons have monster type bits set and those don't work. That includes dragon sword vs dragons, coral sword vs sea monsters, etc. But only those 3 weapons have elemental properties. Actually, stunning or sleeping an enemy would be great for luck manipulation in general since I'd be able to manipulate higher damage. But this would require having a mage and buying the spell which takes time and that char will add time running from each battle. Still, it's interesting to consider. One issue is that enemies always wake up from sleep on the next turn and HOLD is a level 3 spell. So this is also a long shot. Another interesting idea is making the second char a thief. Early on he'll help run from battle and later he'll just be there for manipulation. He would probably die on Kraken since he wouldn't be helpful after that. Although he could increase the chances to get a preemptive BANE. I'd need to check if just having a second char is helpful though, it may only be useful if he takes a hit. Problem is that even though it seems like there isn't much difference in ordering two chars to run from battle it adds up over the large number of encounters. He also has to do something during boss fights, adding more time.
Ambassador, Experienced player (708)
Joined: 7/17/2004
Posts: 985
Location: The FLOATING CASTLE
Ok, I put some work into making a hand axe run. Here's the progress up to Astos. http://dehacked.2y.net/microstorage.php/info/900272950/FinalFantasy-2.1-noluck-duo.fm2 The faster fights against the wizards and Astos are quite stylish. Unfortunately, it doesn't make up for the time needed to buy the hand axe in Pravoka. It's close, only a few hundred frames or so. I had hoped that the change in flow would let me cut a fight out. I can but it's no good because I would see wizards in Earth Cave that I can't run from. The best I can do is to save time by sailing all the way into the docks. I also considered fighting the wizards solo. But it takes time to manipulate the pirates battle so two guys die. Beating the wizards requires visiting the inn and getting the hand axe. Plus the battle takes 3 rounds. So while it would be cool it's not faster. I did discover a technique to start dialogue and enter the menu one frame faster each time. Also investigated whether it might be faster to forgo a point of luck to beat Garland faster. After pirates I am about 300 fr ahead this way. But both of these could easily get lost in luck manipulation. So I might investigate but any improvement is going to be pretty minor.
Joined: 7/30/2011
Posts: 129
Location: Watching a TAS in the basement...
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!
I am the future ruler of the world! My forum: http://elderyoshisisland.forumotion.com/
Ambassador, Experienced player (708)
Joined: 7/17/2004
Posts: 985
Location: The FLOATING CASTLE
Here are a few other things we discussed.
TASManiac wrote:
For getting the gold, running from less battles later on might save some time in the Ice Cave where you go a little out of your way to get the chests with gold in them. This would also help with the experience dillemma.
An interesting idea. If we could get enough gold in one or two battles and it lets me avoid going to that 6-chest room it might be worth it. Problem is that's a lot of gold. Too much to get anywhere else.
TASManiac wrote:
As far as I can tell, the fadeout lag is just reloading the map, so it all depends on where you are and isn't random. I'm not completely sure about this but it seems to be the case.
(This was in response to my comment that fadeout lag after running from random battles is the only possible optimization I know about. But I don't know how we can affect it yet.) So by not random you mean not depending on the random counter, right? And by where you are do you mean what area you are in or where you are within that area. I did not consider tweaking the walking route to optimize fadeout lag but that's an interesting idea.
TASManiac wrote:
No route changes come to mind right this moment. Is the order you did the fiends in really the best order? Also, might it be worth it to class change, or would that take too long?
100% sure on both of these. There are only a few ways they could be changed, anyway. Doing fire last is clearly best as Kary can be BANEd and we can fly to the volcano. We could theoretically leave the Sea Shrine after getting the SLAB. BANEing Kraken would save a ton of time over hacking at him, but it's just way too much extra travel. Class change was discussed earlier. Unfortunately, there's just no benefit. Even if you had a mage, it would be a waste of time to get them to a level where a promoted char would get cool spells.
Joined: 7/30/2011
Posts: 129
Location: Watching a TAS in the basement...
Fadeout: I mean what area you are in; the smaller it is, the less fadeout time there seems to be. It doesn't seem to depend on the random counter, although you could try ending battles with different random numbers and see what that produces. No class change is very unfortunate, but something that must be lived with I guess. Looking back a little bit, the Hand Axe is definitely not worth it. It would seem that the Silver Sword isn't either.
I am the future ruler of the world! My forum: http://elderyoshisisland.forumotion.com/
Active player (253)
Joined: 7/30/2006
Posts: 207
Location: Alefgard, USA
Won't be useful in a TAS of this game, but this video is pretty amazing/funny. Fast forward to 3:24 to get to the good part. http://www.youtube.com/watch?v=yUT47Za7lPY Spoiler: Chaos runs away.
Joined: 7/30/2011
Posts: 129
Location: Watching a TAS in the basement...
I know, I already saw it. I was rotfl for a bit.
I am the future ruler of the world! My forum: http://elderyoshisisland.forumotion.com/
Joined: 2/26/2011
Posts: 98
Not a TAS, but definitely more serious than most LPs. The challenge is about taking the minimum number of steps on tiles that random battles can be encountered on, while heading straight toward the next destination, and only the ones that are necessary. In areas without battles, as many steps are allowed as needed, but this doesn't make things that much easier! Chances are that if you have been following this thread that you will be interested in this series of videos. http://www.youtube.com/watch?v=vB0qGBBvgVQ http://www.gamefaqs.com/boards/522595-final-fantasy/61386504
Ambassador, Experienced player (708)
Joined: 7/17/2004
Posts: 985
Location: The FLOATING CASTLE
http://tasvideos.org/GameResources/NES/FinalFantasy1.html Game Resources page is up. It's basically just what TASmaniac posted earlier but formatted a little more conveniently.
Joined: 2/26/2011
Posts: 98
A few posts back I shared some links to a "Minimum steps challenge" LP and discussion of this game. It would be of interest to anybody who is keeping up with this thread, since a lot of the same deep knowledge of the game is necessary to make it. Here is a link that explains the challenge better than I can: http://www.freewebs.com/batiazul3627/ff1-mechanics/minsteps.html Enjoy.
Ambassador, Experienced player (708)
Joined: 7/17/2004
Posts: 985
Location: The FLOATING CASTLE
This was interesting. I was curious to see how complete his knowledge was. He did get the area by Coneria right but missed a couple little tricks. I posted on gamefaqs and linked our game resources page. Still, he's done an impressive amount of planning. I'm pretty sure this would be a terrible goal for a TAS. Maybe if you could get the gold for BOTTLE. Also as he laid it out the power cycle manipulation would be out and you would have to fight a few battles.
Joined: 1/14/2012
Posts: 4
Location: Montreal, Canada
Hi all, I'm the one doing the Minimum Steps challenge. ( I'm also the one who did the single-segment run currently posted at SDA: http://speeddemosarchive.com/FinalFantasy.html ) Axe's post at GameFAQs has redirected me here, so I thought I'd say hello. He also pointed out some things that I should have done had I been more familiar with the TAS side of this game (all the various strange places where there are encounter-free tiles, in particular). Unfortunately it's too late for me to use that knowledge now. The only segment that remains is the Temple of Fiends (which is without doubt the worst one). I've taken a quick look around the rest of this (rather huge) thread just for fun, and there's quite a bit of interesting stuff that's been said. Perhaps the most important detail that I didn't know is that BANE and such really have 3/256 -- and not 1/201 -- of working due to the RNG's biased table. If you guys like RNG manipulation (hmm, something tells me you do :-)), you'll particularly love part 18 of the Min Steps: http://www.youtube.com/watch?v=xSE5HUu8flw Remember that that's done without saved states. The way I see it, it's very possible that the best chance for a lowish level WM to defeat Chaos is to get into such a "loop". TAS considerations notwithstanding. Aaaanyway. Be sure to take a look at the videos. That number of views has gotta go UP!
Ambassador, Experienced player (708)
Joined: 7/17/2004
Posts: 985
Location: The FLOATING CASTLE
Interesting trick with the looping. It does turn out that in a one-on-one fight vs a fiend each round uses just about all the 256 numbers in the RNG. Most of the RNG advances go into the dust that appears on the hits. However, the exact amount depends on how many hits the enemy gets and how many times it needs to pick a target before getting a valid one. If Kary uses magic then it won't form a stable loop. The stability of the loop will also depend on what slot your guy is in because that affects how many times Kary picks a target before getting your living char.
Joined: 1/14/2012
Posts: 4
Location: Montreal, Canada
Would you be able to produce a number of setups that allow cycles like that for all the major bosses in the game? Is it thinkable to get through Lich(2) unscarred in a segmented, low-level, console playthrough with that? Say, if you petrify the right characters before the fight and reorder your party correctly, then is it reasonable to say that the fight is won right the moment that Lich(2) decides to use a physical attack? That, that possibility alone, I'm telling you, could save over 20 minutes in a segmented speedrun (per SDA rules), and change the whole way the end game is planned. Seriously. If anyone knows how to rely on in-battle cycles, that's a gold mine. And I want to know more!! :-0 (Not to create unmeetable expectations, but I believe that it would be possible to do a sub 2 hours console run, my friends.)
snorlax
He/Him
Joined: 5/20/2007
Posts: 174
Location: Wisconsin
I've watched the whole run to this point and found it interesting. Since you currently have spells that you're not at a high enough level to cast, have you considered going back and spending on that money on something that might be able to help you? I'm not sure if you have any useful alternatives though.
Joined: 1/14/2012
Posts: 4
Location: Montreal, Canada
In fact, like I say at the beginning of Part 25, I came back on my decision of buying ARUB after all, and I decided to save my money for the Steel Armor, which I couldn't have afforded otherwise. So I only have L5 spells and below, in reality, but thanks for trying to help. I know sometimes my shopping isn't very clear because I do it at the end of segments, before knowing what resources I'll need for the next one, so I end up redoing it offline and not always saying what I did differently. Keep in mind that all the stuff I mention, I have to mention it in all my failed attempts as well... I'm pretty happy about how I used my money overall. What I'm less happy about is how my exp is distributed. My Fighter being level 18 really doesn't give me any advantage over him being level 16, and the same goes with my White Mage, who could as well have been level 15. That exp should have gone to the Black Belt. Since my videos for Parts 25-30 have been out for a few weeks, I'm not going to redo those segments unfortunately. But the ToFR is really killing me because of that. Ah, well. I'm happy you watched my videos by the way. I hope you've enjoyed! I'm not exactly sure about the format as of yet. Showing my failures, showing my encounter manipulation, it may contain interesting information, but it may also be boring to watch when there's 10 minute of it. I don't know. Next challenge, I'll probably try something slightly different.
Joined: 1/14/2012
Posts: 4
Location: Montreal, Canada
I've uploaded the final segments for this challenge. Links to them can be found on the description page that la mammal mentioned a couple of weeks ago: http://www.freewebs.com/batiazul3627/ff1-mechanics/minsteps.html Unfortunately, I had to make an exception to my "no saved states" rule for the ToF, as it turned out to be very much too difficult with my current setup. So, I segmented the ToF in four parts (using three saved states), which allowed me to retry the harder bosses forcing a minimum of luck (not excessively, I hope). Anyway, you're welcome to watch and leave comments or share the links, if you found this challenge interesting. If I get enough good feedback, I'll make sure to do more audio-recorded FF1 challenges. :-) Cheers!
Ambassador, Experienced player (708)
Joined: 7/17/2004
Posts: 985
Location: The FLOATING CASTLE
Check out the preview for the upcoming album on http://ocremix.org/. Their (awesome) preview video uses footage from my run. It's pretty generic and I don't think anyone else would notice. I'm quite honored because I often listen to OCR while TASing but it would be nice to get an attribution or special thanks for myself or this site.
Editor, Emulator Coder, Site Developer
Joined: 5/11/2011
Posts: 1108
Location: Murka
TheAxeMan wrote:
Check out the preview for the upcoming album on http://ocremix.org/. Their (awesome) preview video uses footage from my run. It's pretty generic and I don't think anyone else would notice. I'm quite honored because I often listen to OCR while TASing but it would be nice to get an attribution or special thanks for myself or this site.
Good grief that's awful. Native emu cap converted to 4:2:0 and then upscaled. Heh heh heh.
Post subject: stair glitch, large skips
Joined: 1/31/2015
Posts: 14
http://youtu.be/TRANAM0udLk A stack corruption bug lets you run the second character's name as machine code. The bug exists in both the NA and J releases, but is easier to exploit in the J release due to the extra characters (including $4c for JMP). Things that I've tested: ice cave skip (early airship), early class change, early xcalbur, save file hacking (by jumping into the save routine with controlled offsets). I have not yet managed to get a credit warp to work because the character set is just short of including the address you'd need. I have a complete, thoroughly commented NA disassembly if anyone is interested in exploring more. J is almost identical except for some minor message printing changes. Details: The game implements stairs in a funny way. Stair tiles can either be "push" tiles that call the dungeon subroutine with a new map and start location, pushing the current position onto the hardware subroutine stack; or "pop" tiles which return from the current invocation of the dungeon subroutine to go back. Two "pop" tiles in the same connected region of a map both go to the same place. This is useful to make all tiles on the edges of towns return to the world map, but doesn't work well in buildings. If there were two separate staircases landing in the same hallway, you'd expect walking down the left one to take you to the left, even if you happened to walk up the right before. So most maps are simple trees, segmented into regions with at most one "pop". But some maps have cycles of warps, like the column maze in ordeals 2 and the ice cave L2->L3 holes. Also, coneria castle uses a push warp from L1->L2 and from L2->L1---otherwise when you warped there from ToF after saving the princess, the stairs down from L2 would go back to ToF not L1. (In these cases you can't pop to go back to the world map, so there's a limited third type of warp tile which looks up and sets one of 16 world positions, jumps just before the main loop and resets the stack pointer. This is why you always end up on the right of coneria castle when leaving even if you entered from the left.) 7 bytes are pushed onto the stack per push warp. The 6502 can only address 256 bytes of stack. So if there's any path with more than 256/7 push warps, the stack pointer will wrap around and start overwriting old stack entries. This could result in corruption if the nested dungeon subroutine calls tried to return, so the game is careful to ensure they don't. Repeatable pop warps after a cycle of pushes are avoided by design. The warp spell also effectively returns from the dungeon subroutine, but only if the stack pointer is below ef. This should make it impossible to return to corrupted stack. Alas for cleverness, the menu message printing subroutine at de36 needs some extra memory so it writes directly to the low part of the stack. To expand certain message placeholders, the subroutine invokes e03e to save its current position in its original message format string, calls itself with a different message, and then calls e04e to resume parsing the original string. e03e dumps the current message pointer and bank into 110, 111 and 112, on the stack. So doing a series of push warps and then entering the menu can cause corruption. The easiest way to exploit this is to walk up and down the coneria stairs 70 times and then enter the menu. If all goes well, on exiting the menu your payload runs, then you get dumped into a glitch shop. You can safely exit la la land by walking out of the castle because of how the stack gets reset when you do that. Note entering the menu again is not a good idea even though my demo video does so to demonstrate the class change. It's also very easy to soft lock. A simple lua script:
-- this is a sloppy little script to walk up and down the coneria castle stairs
-- a number of times and then enter the menu screen
emu.speedmode('maximum')

trips = 70

function walkToY(desty)
  while true do
    y = memory.readbyte(0x2a)
    if y == desty then
      break
    elseif y == 0 or y > desty then
      -- on the world map screen initially y is 0, since this y variable is
      -- only used for inside maps. we need to go up initially to get into
      -- the castle.
      joypad.write(1, {up=true});
    else
      joypad.write(1, {down=true});
    end;
    emu.frameadvance();
  end;
end; 

function press(button, n)
  mask = {}
  for i=1,n do
    emu.frameadvance()
    mask[button] = false
    joypad.write(1, mask)
    emu.frameadvance()
    mask[button] = true 
    joypad.write(1, mask)
  end;
  emu.frameadvance()
end;

-- hard boot
emu.poweron()

-- get through prophecy
press("A", 21);
-- enter whatever for character 1
press("A", 9);
-- use default thief for character 2
--press("right", 3);
press("A", 1);
-- enter a magical name
-- 8a 8b 8c 8d 8e 48 49 4a 4b 4c
-- 8f 90 91 92 93 4d 4e 4f 50 51
-- 94 95 96 97 98 52 53 54 55 56
-- 99 9a 9b 9c 9d 57 58 59 5a 5b
-- 9e 9f a0 a1 a2 70 71 72 73 74
-- a3 a4 a5 a6 a7 7d 7e 7f 7c b9
-- a8 a9 aa ab ac 80 81 82 83 84
-- b0 b1 b2 b3 b4 85 86 87 88 89
-- ad ae af b5 b6 c2 c4 c5 c3 ff

-- some examples:
-- 4c ae 95: class change
-- 4c 84 b2: give airship
press("right", 9);
press("A", 1);
press("down", 8);
press("right", 2);
press("A", 1);
press("up", 6);
press("A", 6);
-- select character 3
press("right", 8);
press("A", 12);
-- character 4
press("A", 15);

-- walk up to two tiles before stairs.
walkToY(13);

-- take trips flights of stairs
for i=1,trips do
  -- the stairs are at y=11 on both the ground floor and the second floor.
  -- first walk to one square away, then walk onto the stairs, then walk off.
  walkToY(12);
  walkToY(11);
  walkToY(12);
end;

-- enter the menu screen
for i=1,15 do
  emu.frameadvance();
end;
joypad.write(1, {start=true});

-- exit the menu screen and glitch shop
for i=1,25 do
  emu.frameadvance();
end;
press("B", 100);

-- show menu for fun
for i=1,25 do
  emu.frameadvance();
end;
joypad.write(1, {start=true});

while true do
  emu.frameadvance();
end;
Player (80)
Joined: 8/5/2007
Posts: 865
Hey, welcotar! Fantastic find! I've gone to work on the NA version, trying to see what we can accomplish with it. You're probably well ahead of me, but what I've got is not especially promising so far. I've copied my notes below. In particular, notice the list of opcodes that are available to us (I've listed them as hex/mnemonic/corresponding character/description):
Player 2 name stored in $312.

8A 8B 8C 8D 8E 8F 90 91 92 93
94 95 96 97 98 99 9A 9B 9C 9D
9E 9F A0 A1 A2 A3 BE BF C0 FF
80 81 82 83 84 85 86 87 88 89
A4 A5 A6 A7 A8 A9 AA AB AC AD
AE AF B0 B1 B2 B3 B4 B5 B6 B7
B8 B9 BA BB BC BD C2 C3 C4 C5

80-8F
90-9F
A0-AF
B0-BF
C0
C2-C5
FF

0123456789ABCDEF
GHIJKLMNOPQRSTUV
WXYZabcdefghijkl
mnopqrstuvwxyz',
.*-|!?

HEX MNM CHR DSC
$90 BCC  G  (branch on carry clear)
$B0 BCS  m  (branch on carry set)
$c5 CMP  ?  (compare accumulator, zero page)
$c0 CPY  .  (comapre Y, immediate)
$c4 CPY  !  (comapre Y, zero page)
$B8 CLV  u  (clear overflow)
$A9 LDA  f  (load accumulator, immediate)
$A5 LDA  b  (load accumulator, zero page)
$B5 LDA  r  (load accumulator, zero page, X)
$AD LDA  j  (load accumulator, absolute)
$BD LDA  z  (load accumulator, absolute, X)
$B9 LDA  v  (load accumulator, absolute, Y)
$A1 LDA  X  (load accumulator, indirect, X)
$B1 LDA  n  (load accumulator, indirect, Y)
$A2 LDX  Y  (load X, immediate)
$A6 LDX  c  (load X, zero page)
$B6 LDX  s  (load X, zero page, Y)
$AE LDX  k  (load X, absolute)
$BE LDX  '  (load X, absolute, Y)
$A0 LDY  W  (load Y, immediate)
$A4 LDY  a  (load Y, zero page)
$B4 LDY  q  (load Y, zero page, X)
$AC LDY  i  (load Y, absolute)
$BC LDY  y  (load Y, absolute, X)
$8A TXA  A  (transfer X to A)
$88 DEY  8  (Decrement Y)
$85 STA  5  (store A, zero page)
$95 STA  L  (store A, zero page, X)
$8D STA  D  (store A, absolute)
$9D STA  T  (store A, absolute, X)
$99 STA  P  (store A, absolute, Y)
$81 STA  1  (store A, indirect, X)
$91 STA  H  (store A, indirect, Y)
$9A TXS  Q  (transfer X to stack pointer)
$BA TSX  g  (transfer stack pointer to X)
$86 STX  6  (store X, zero page)
$96 STX  M  (store X, zero page, Y)
$8E STX  E  (store X, absolute)
$84 STY  4  (store Y, zero page)
$94 STY  K  (store Y, zero page, X)
$8C STY  C  (store Y, absolute)
The good news is that we have access to $90 and $B0, branch on carry clear and branch on carry set, respectively. This means we should almost certainly be able to jump around somewhere within the game's code. The bad news is that the character set is mapped mostly to hex values $80 to $C5, which means we have to jump backward. I guess that's not bad news if the RAM there can be manipulated, but I have some information on that... Character 2's name is stored in address $312. I verified directly by running a trace that, indeed, that is where the code is executed from. Using the BCS instruction, the only addresses we have access to are $294 (corresponding to character 2 name "m0**") up to $2D9 (corresponding to character 2 name "m?**"). (You may want to check my arithmetic for both of those.) Unfortunately, RAM in that range seems to be stuck with values like $F8 and $F0 most of the time. I fired up TheAxeMan's current publication to see if those values change at all and so far I've only seen them change appreciably when he enters the Circle of Sages, after which they go bonkers. If we can manipulate the values there, it will still obliterate half the game. As yet, however, I still don't understand what's being stored there. So my questions/comments for welcotar are as follows:
    1) I'd very much like to see the disassembled ROM! PM me or post it publicly. 2) If you happen to know, what is stored in address range $294-$2D9? I'll research it myself in the meantime, but so far I'm stumped. 3) What happens if you climb the stairs, say, another 70 times? Since 256 and 7 are coprime, maybe we have some leeway as to where the stack corruption takes us. I'm not very good with assembly language and it's hard for me to interpret what you've written, so I'm exploring that very slowly. 4) The glitch actually sets the program counter to $30A and it eventually increments to $312. What is in the $30A-$311 range? In my latest test, the first three instructions were garbage ($80) but the instruction at $310 happened to be $01 00 corresponding to ORA ($00, X). If as many as 8 more bytes can be directly manipulated, I'm confident we can get arbitrary code execution to work.
For anyone who would like to experiment with a modified version of welcotar's script that works on the NA version of Final Fantasy, you may find a copy here: Download FF_ACE.lua
Language: lua

-- this is a sloppy little script to walk up and down the coneria castle stairs -- a number of times and then enter the menu screen emu.speedmode('maximum') trips = 70 function walkToY(desty) while true do y = memory.readbyte(0x2a) if y == desty then break elseif y == 0 or y > desty then -- on the world map screen initially y is 0, since this y variable is -- only used for inside maps. we need to go up initially to get into -- the castle. joypad.write(1, {up=true}); else joypad.write(1, {down=true}); end; emu.frameadvance(); end; end; function press(button, n) mask = {} for i=1,n do emu.frameadvance() mask[button] = false joypad.write(1, mask) emu.frameadvance() mask[button] = true joypad.write(1, mask) end; emu.frameadvance() end; -- hard boot emu.poweron() -- get through prophecy press("A", 28); -- enter whatever for character 1 press("A", 9); -- use default thief for character 2 --press("right", 3); press("A", 1); -- enter a magical name -- 8A 8B 8C 8D 8E 8F 90 91 92 93 -- 94 95 96 97 98 99 9A 9B 9C 9D -- 9E 9F A0 A1 A2 A3 BE BF C0 FF -- 80 81 82 83 84 85 86 87 88 89 -- A4 A5 A6 A7 A8 A9 AA AB AC AD -- AE AF B0 B1 B2 B3 B4 B5 B6 B7 -- B8 B9 BA BB BC BD C2 C3 C4 C5 -- some examples: -- 4c ae 95: class change -- 4c 84 b2: give airship press("right", 2); press("up", 2); press("A", 1); press("left", 2); press("up", 2); press("A", 1); press("A", 6); -- select character 3 press("right", 8); press("A", 12); -- character 4 press("A", 15); -- walk up to two tiles before stairs. walkToY(13); -- take trips flights of stairs for i=1,trips do -- the stairs are at y=11 on both the ground floor and the second floor. -- first walk to one square away, then walk onto the stairs, then walk off. walkToY(12); walkToY(11); walkToY(12); end; -- enter the menu screen for i=1,15 do emu.frameadvance(); end; joypad.write(1, {start=true}); -- exit the menu screen and glitch shop for i=1,25 do emu.frameadvance(); end; press("B", 100); -- show menu for fun for i=1,25 do emu.frameadvance(); end; joypad.write(1, {start=true}); while true do emu.frameadvance(); end;
Edit: Here's a quick update to report on what I thought was a promising lead. I discovered that a flag at $62CA dictates whether the black orb is present in the Temple of Fiends. I cheated it to 0 (corresponding to it being gone) and the tile is not traversible. I suppose you really do need the four orbs shining to step forward through the altar. Oh well. Of the other skips we might reasonably execute, I'm wondering whether it would be better to get the early airship (it may depend where it shows up) or skip the air orb, which would also obsolete the Waterfall, Leffein, and parts of the Sea Shrine and the return to Melmond.
1 2
9 10 11 12 13