This is an improvement of 147 frames over the current Final Fantasy run.
There are several changes that lead to this improvement:
  • The biggest change is in the first boss fight against Garland. I finish the battle faster but don't get a point of luck. This saves over 200 frames and finishes the battle in 3 rounds. But over half of that time is lost throughout the run due to missing that point of luck.
  • It is possible to initiate dialog one frame faster by pressing dir+A. You will walk a step and then interact with whatever is in front of you. It won't work when you need to turn and then talk. Similarly, dir+start saves a frame when I need to go to the menu.
  • I analyzed the NPC movement movement algorithms. As a result, I was able to get the NPC behavior I needed while using fewer frames.
  • Picking Continue instead of Start at the beginning saves one frame.
As a secondary objective the input is as sparse as possible. Over 96% of the frames in this movie have no input. I don't know if anyone has ever considered tracking this, but it has to be some sort of record. I calculated this as frames with input vs frames with no input, so it doesn't matter how many buttons are pressed at once.

Battle Luck

Final Fantasy has a very simple RNG. It simply loops through a list of 256 numbers. Now there are times when I need to be at a certain point on that loop. If I need to wait in battle for it to loop completely around, it would take 512 frames! That is way more than the time saved by skipping luck on Garland. In order to avoid this, I need to manipulate more preemptive battles. This gives more control over the RNG since I can run at any time. However, the "Chance to strike first" message eats up about 20 frames. So that is how missing a point of luck costs time. A smaller factor is the number of enemies; each enemy in the battle takes a frame to draw.
I tried skipping luck again on the Eye. That was too much and led to an extra loop.
The counter that determines your battle luck is at 688A, so if you memwatch that you'll see how the RNG works.
I was able to devise an O(N) algorithm for optimizing the flow of running from each battle. This was nice because I needed to run this a lot to check different possibilities.

NPC Luck

The algorithms that randomize NPC movement are much more random than the battle RNG. There is a counter ($00F0) and an accumulator ($00F4). Every time someone moves, the value of the counter gets added to the accumulator. The direction of movement is determined by the low 2 bits of that sum, so every 4 frames you get the same luck. But there is also an initialization factor where some NPCs may be initialized before others when you enter a room. This is more difficult to control.
The counter counts up when you are in walking mode regardless of whether there are NPCs there. But if there aren't any NPCs then the accumulator won't be changed. When you get into battle it goes up by one and then stops until the battle ends.
There are a few ways to affect things by moving around the NPCs. If you happen to be where they want to move, they will try to move again, changing the accumulator. If you move into the place they are moving from, they move faster. This will cause their next step to be sooner, changing luck later on. Each NPC has a counter that counts down every 15 frames. He moves when it reaches 0. If you bump into them when the counter is 4 or higher, the counter decrements by 4 immediately. This takes a frame, but is the most powerful way to manipulate things since there are limited opportunities for the other methods.
Additionally, the counter counts while you are paused, but NPCs don't move. I can often vary when I go to the menu by some range of steps. So by changing that I can affect luck as well. This is done in Earth Cave when I equip the dragon sword and in Gaia when I use the bottle (for the robot in the waterfall).
This manipulation took a lot of trial and error so I used lua scripting to try a lot of possibilities quickly.

Other Comments

This ended up being a pretty small improvement, but technically it was a big accomplishment. The few frames from NPC manipulation were especially hard-won. I hope all the Final Fantasy fans out there enjoy this!

GabCM: Added Dailymotion module.

DarkKobold: I'm going to be watching this anyway, so I might as well judge it.
DarkKobold: While ~3 seconds over the course of an hour are impossible to spot, I'd been meaning to re-watch Final Fantasy anyway. Nice minor improvement. Accepting as an improvement to the published movie.
GabCM: Will publish this later.


TASVideoAgent
They/Them
Moderator
Joined: 8/3/2004
Posts: 15564
Location: 127.0.0.1
This topic is for the purpose of discussing #2960: TheAxeMan's NES Final Fantasy in 1:10:06.81
Banned User
Joined: 8/30/2010
Posts: 500
Location: Argentina Bs. As.
Starting HD encode
[18:51] <scrimpy> Oh, nothing [18:51] <mmarks> oh [18:51] <Nach> I think scrimpy is just jealous of you mmarks
GabCM
He/Him
Joined: 5/5/2009
Posts: 901
Location: QC, Canada
Are you serious?! So much time for an NES game?! An SD encode is online on Dailymotion. Look in the submission text!
Joined: 7/2/2007
Posts: 3960
This has got to be a record not just for sparseness of input, but also for worst improvement : movie length ratio. The movie has been improved by .17%
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Active player (435)
Joined: 9/27/2004
Posts: 650
Location: Canada
Nice. Thanks for making a new run. It's always a good time watching this game. I am still curious why you trade the short sword to the second fighter though during the marsh cave. Does the luck make it better to fart around in the subscreen than to manipulate hits to kill the other fighter? But beyond that the way you played the game is so much better than before and the run is obviously a lot tighter so for sure I'm voing yes.
Ambassador, Experienced player (709)
Joined: 7/17/2004
Posts: 985
Location: The FLOATING CASTLE
Thanks everyone. About the short sword, it really has to be the second person because otherwise there is no good possibility. As it is, the wizards fight pushes its luck to the limit. As far as movie length ratio, I seem to remember some games where a movie was obsoleted by a few frames in heated competition. I think some Mario runs do this.
Personman
Other
Joined: 4/20/2008
Posts: 465
This is a totally uninformed question, but you mentioned that you skip getting a point of luck to save time in battle, and that you tried the same trick again later but it didn't work. Is it totally obvious that skipping it the second time but not the first isn't better, or is that worth trying too?
A warb degombs the brangy. Your gitch zanks and leils the warb.
Ambassador, Experienced player (709)
Joined: 7/17/2004
Posts: 985
Location: The FLOATING CASTLE
Personman wrote:
Is it totally obvious that skipping it the second time but not the first isn't better, or is that worth trying too?
Good question. Yes, I considered this. Skipping luck on Garland cuts the battle by a round, saving about 200 frames. The only advantage to skipping luck on Eye is because it allows for fewer preemptive battles in Ice Cave. But the impact depends on whether or not I got luck earlier. If you get luck both times you can avoid even more preemptives. When I tried skipping luck on the Eye I was about 100 frames further ahead after Ice Cave. But some of that got lost in the Sea Shrine. Then later on in the Sky Palace and Gurgu I had an extra loop of the RNG later on that cost 512 fr. There's only one point in the loop where I can go first and have BANE work against a boss. So if I can't run from battle fast enough and I slip past that before Kary, the only way to get it is to loop back around, taking 512 frames longer. After getting luck on Garland, getting luck again on the Eye allowed for avoiding more preemptives. That's why I did it in the last run.
Banned User
Joined: 8/30/2010
Posts: 500
Location: Argentina Bs. As.
Mister Epic wrote:
Are you serious?! So much time for an NES game?! An SD encode is online on Dailymotion. Look in the submission text!
You will have the mirrors of the encoding?
[18:51] <scrimpy> Oh, nothing [18:51] <mmarks> oh [18:51] <Nach> I think scrimpy is just jealous of you mmarks
GabCM
He/Him
Joined: 5/5/2009
Posts: 901
Location: QC, Canada
mmarks wrote:
Mister Epic wrote:
Are you serious?! So much time for an NES game?! An SD encode is online on Dailymotion. Look in the submission text!
You will have the mirrors of the encoding?
When it's accepted.
Editor, Reviewer, Experienced player (979)
Joined: 4/17/2004
Posts: 3109
Location: Sweden
>Over 96% of the frames in this movie have no input. I don't know if anyone has ever considered tracking this, but it has to be some sort of record. There was some discussion about this a while ago, in Thread #7082: Minimal Presses. bkDJ made a program to check (among other things) how many frames are empty. Get it at http://www.mediafire.com/?a0chh0i0vqi [737] SNES Kirby's Dream Course by gocha in 1:11:36.52 has input for 2.7% of its frames, for example.
Ambassador, Experienced player (709)
Joined: 7/17/2004
Posts: 985
Location: The FLOATING CASTLE
Interesting thread. But their metric is different from the one I was going for (most frames with no buttons pressed). I press the button for one frame then release it. Then I press it again for the next step. Counting their way I could have gotten a lot fewer presses by holding the dir button down. If I did that I could probably beat 2.7%.
Editor, Reviewer, Experienced player (979)
Joined: 4/17/2004
Posts: 3109
Location: Sweden
They mostly talked about number of presses/releases, yeah, but bkDJ's program calculates both, so the number I wrote is comparable to yours: how many frames has any input at all. I watched through the end of the movie to see bosses get killed by BANE. Still funny. :)
Active player (428)
Joined: 9/7/2007
Posts: 329
There are few votes cast for such a popular game. I guess it is a bit hard to watch a lengthy run. I admit it was a bit boring, but that is the game's fault. I cast my yes vote for the improvement (and it only cost me 1 MP :D ) It would be interesting to see how long an abridged video would be where the battles that were run from (Sir Robin!) were cut out.
Player (206)
Joined: 5/29/2004
Posts: 5712
Personally I thought it was the walking around dungeons that got old, and it was nice to see a few of the monsters in each area even if they weren't fought. Say, do lava tiles advance the random number generator a different amount or something? I noticed Axe was taking slight detours just to step on even more of them, but I didn't see the purpose of having minimum health.
put yourself in my rocketpack if that poochie is one outrageous dude
Ambassador, Experienced player (709)
Joined: 7/17/2004
Posts: 985
Location: The FLOATING CASTLE
That's right, damage squares don't advance the counter that controls when you get an encounter. So in Gurgu volcano I go out of my way to get a few more steps on lava as this cuts out an encounter. If I took one more step before reaching the last staircase, I would meet some enemies. All of the encounters are exactly the same as the last run. But different numbers of enemies show up due to different luck.
Post subject: Movie published
TASVideoAgent
They/Them
Moderator
Joined: 8/3/2004
Posts: 15564
Location: 127.0.0.1
This movie has been published. The posts before this message apply to the submission, and posts after this message apply to the published movie. ---- [1714] NES Final Fantasy by TheAxeMan in 1:10:06.81
Player (206)
Joined: 5/29/2004
Posts: 5712
TheAxeMan, can you also explain why this movie appears to be 10 seconds slower than the previous movie but isn't? I noticed Mister Epic added a note about this to the publication, but when I asked about it, he didn't know the reason.
put yourself in my rocketpack if that poochie is one outrageous dude
GabCM
He/Him
Joined: 5/5/2009
Posts: 901
Location: QC, Canada
Bag of Magic Food wrote:
TheAxeMan, can you also explain why this movie appears to be 10 seconds slower than the previous movie but isn't? I noticed Mister Epic added a note about this to the publication, but when I asked about it, he didn't know the reason.
I remember. The reason is the movie file format. FCM, as we used before, has its duration calculated with 60 fps, while FM2, as we are currently using, has its duration calculated in 60.1 fps, which is the NES's frame rate.
Joined: 1/25/2012
Posts: 2
This is probably a stupid question (I know little about Final Fantasy's restrictions) but why did this TAS allow for random encounters? Is it something that can't be avoided?
Ambassador, Experienced player (709)
Joined: 7/17/2004
Posts: 985
Location: The FLOATING CASTLE
That's right, you can't avoid random encounters. There are a lot of tweaks done to reduce them but the possibilities are pretty limited. The encounter algorithm is described in the game resources page (along with a lot of other information), so check that out to learn more: http://tasvideos.org/GameResources/NES/FinalFantasy1.html
Player (80)
Joined: 8/5/2007
Posts: 865
Hey TheAxeMan. I'm (re)watching your run right now. I normally wouldn't go out of my way to ask questions like this, but as long as you're available... Why do you take strange, circuitous paths in some areas? (Right out of Coneria is a prime example, but I also noticed you took a strange path to Melmond.) Also, why do you usually dock your ship immediately rather than getting it as far into the port as possible? I realize there are probably answers to those questions posted somewhere and I trust the quality of your runs. I'm just curious. Edit: It also looks like you have 6000 extra gold for buying the bottle. I wasn't keeping track, but I thought I saw you open a treasure chest worth less than 6000 GP. I'm probably mistaken, though. (Edit 2: As you go on a HOUSE and CABIN buying spree shortly thereafter, I withdraw my complaint.)
Joined: 7/10/2007
Posts: 280
Bobo: See the encounter algorithm. There are certain tiles that can't produce encounters that still influence the step counter, such as in town, or the port tiles. Extra steps are taken to influence the counter before heading into dangerous territory.
Ambassador, Experienced player (709)
Joined: 7/17/2004
Posts: 985
Location: The FLOATING CASTLE
No problem Bobo, I'm always willing to discuss things like this. Both of these take advantage of the fact that the encounter rate is higher in the field than in a dungeon or on a ship (ratio is about 10/8/3). That means sometimes a step will have an encounter if it's taken in the field but if you can somehow get one more step ahead you can cut that encounter out. Or on the ship you can sail a bit more because the step won't have an encounter at sea but it would on land. The long path from Coneria to the bridge is done to cut one step of encounters. You can't really tell unless you use a tool like ffhackster to figure out exactly which squares don't have encounters. That one step cuts out a fight before entering Marsh Cave that would otherwise be a group of shadows that surprises me. I could get that step by entering Elfland, but the animation on entering a town takes more time than this walkaround. The extra sailing on the way to Melmond is another manipulation of the encounter flow. Since the ship moves twice as fast, I can advance the step counter twice as fast. You can tell that the number of steps between fights isn't always the same. This manipulates that to get more steps between some fights. As a result I have one less battle before reaching the point where I do a hard reset outside Earth Cave. I do all this analysis with a script I made. The input is a text file that lists how many steps I take in which areas and the output tells me what enemy groups I encounter in which areas. It can also do regressions where it considers taking extra steps in some areas, doing a power cycle at different points or using some time-saver that adds steps (like walking straight to the bridge). It looks at all the possibilities and uses a cost function to decide which is best. Edit: Not sailing all the way into the dock is also an encounter manipulation. The dock squares on land don't advance the counter but the sea squares right next them do. This is another tradeoff I regressed with my script.
Joined: 8/10/2012
Posts: 3
Location: Florida
to TheAxeMan: I just finished watching your run last night and it inspired me to stop lurking and join the forums just so I could praise you. It was well put together, I suppose, but I've never thought about a TAS as technically entertaining before yours. What really stuck out for me was the depth of the subtitles. You started describing the Kraken fight as long and I reflexively skipped ahead one minute to avoid the tedium of "2 hits, 81 damage" ten times. After the time skip, I saw the subtitles at the top of the screen and immediately jumped back in time. To me, the subtitles were like a director's commentary of a film I've watched too many times. They allowed me to enjoy something I've over-experienced in a new and fresh way. It is my deepest hope that many TASers follow your lead and begin providing expansive subtitles like yours and those found in the Seiken Densetsu 3 run. Perhaps future versions of the emulators will allow programmer comments to be inserted automatically for ease of creating subtitles. Thank you again. Maxwell.