Submission #5236: Lord Tom's NES The Legend of Zelda in 22:17.53

System Nintendo Entertainment System Emulator FCEUX 2.2.2
Game Version Legend of Zelda, The (USA).nes [PRG0/Rev 0] Frame Count 80384
ROM Filename Legend_of_Zelda,_The_(U)_(PRG0)_[!].nes Frame Rate 60.0988138974405
Branch Rerecord Count 35502
Unknown Authors Lord_Tom
Game The Legend of Zelda
Submitted by Lord_Tom on 9/29/2016 1:21:21 AM

Submission Comments
This movie improves the published any% movie by Baxter and jprofit22 by 1238 frames (20.6s), mainly by solving Link's gambling problem a new route that doesn't use the money making game.
I'll put the Thanks part up top -- since I joined the site in 2007 the runs for this game have been among my favorites. This run hugely benefits from prior player's TAS's and run comments (most notably Baxter, but including many others), as well as others who took the time to share their discoveries on the forums (RAT926 found several optimizations that are exploited here).
Press the CC (closed caption) button to see subtitles with my commentary:

The Route

Old: 3,Reset,MoneyMaking(100),Candle(-60),4,Reset,Bush(100),8,Meat(-100),2,5,Whistle->3,7,Reset,1,Arrow(-80),6,Whistle->1,9
New: 3,4,1,Candle(-60),5,Reset,Bush(100),8,2,Reset,Meat(-60),Arrow(-80),7,6,9
Because the levels are completed in different orders and with different amounts of rupees collected, I found it most helpful to look separately at the time spent in each level, and collectively in the Overworld and Dungeon:
AreaFrame DifferenceRupee Difference
Level 1-148
Level 2-1216
Level 3325
Level 44926
Level 5-2930
Level 6-2471
Level 7-2610
Level 895
Level 9-5-1
Total Dungeon-85150
Total Overworld-387-90
Total Overall-1238-40
I didn't actually start out intending to make this run. I was looking into doing a disassembly and laying groundwork for a possible total control ACE run in May and I figured I should become more familiar with the technical details of the current movies so I'd know what might be most entertaining.
After some initial testing and playing around, it seemed like one or both money making trips could be replaced with good ol' fashioned grinding to save at least a few seconds. I totally got hooked TASing Zelda in the process, and here we are.
A big, not obvious constraint in the routing for this game is the paucity of shops selling needed items. When you're just playing around, it seems you're tripping over them, but when you really can't afford to take detours there are actually very few options that make sense for the Blue Candle and Arrow.
Two test runs got the 60 rupees for the Blue Candle from Levels 3 & 4, with a plan to otherwise use the same route as Baxter & jprofit22. The better of these only looked to save about 2 seconds, though. The key breakthrough was getting the Blue Candle from the shop to the right of Level 5 after completing Levels 3, 4 and 1. This allows the needed money to be gathered much more efficiently (almost entirely from enemies that must be killed anyway) and had many cascading benefits detailed below, notably avoiding a few item switches and 2 shorter walks (3-->4 vs 3-->Reset-->4 and 7-->6 vs 1-->6).
The major question that arose with this route was whether to take a 1-screen detour to buy the 60 rupee Meat in the Blue Ring store, or pay 100 rupees for the Meat outside Level 2. My initial tests seemed to favor the latter, but the combination of one less item swap (no need to swap from Blue Candle to Bombs in Level 2) and discovery of how to avoid a big shopkeeper delay in the Blue Ring shop made Cheap Meat the better bargain.

Item Swaps

The technique of intentionally running out of bombs to avoid going to the menu for an item swap has impressed me since Phil & Baxter used it in their 2007 run. The combination of the time savings, careful planning and confidence that lost bombs will be recovered is just cool. This run skips item swaps in 4 places apart from those used in the published run.
Level 5 Boss (Bombs --> Whistle): Apparently not used in the published run because they do Level 7 next and there isn't a good refill opportunity. I do Level 8 next but am able to get bombs and a blue rupee in the overworld.
Level 2 (Candle --> Bombs): The published run runs out of bombs in Level 8 to equip the Candle so it will be available to burn the bush used to buy Meat en route to Level 2. My route gets the Meat elsewhere, so the Candle is never equipped in the first place.
Overworld to Level 7 (Bombs --> Whistle): There's a lot going on with this one. I have to kill a Blue Leever to avoid a delay showing the Meat shopkeeper. The bomb used does the job, swaps to the Whistle, and gets me a heart while the statue wakes up. Note that once the Meat is owned, running out of bombs swaps to the Meat rather than Whistle. Having the beam sword saves about a second for the coming bomb refill.
Level 7 Digdogger (Bombs --> Whistle): This seems impossible because based on the upcoming enemies and rooms there doesn't seem to be a way to get bombs back. Killing an earlier Red Goriya with a bomb enables a bomb drop from Digdogger via the Bonus Lock strat (see below).

Item Generation


  1. $52a - Item Counter; 0-9, increments when enemy death animation finishes, determines basic item drops
  2. $50 - Bonus Counter; 0-10, increments when enemy hp reach zero; if equal to 10 and an item is generated will reset to 0 and bonus item generated according to $51
  3. $51 - Bonus Item Type; set when $50 reaches 10; value is 1 (bomb) if enemy killed with bomb, 10 (bomb) if Dodongo being killed with sword, else 0 (blue rupee).
  4. $627 - Fairy Counter; 0-255, increments when enemy hp reach zero; if equal to 16 and an item is generated, item will be a fairy and $50 resets. However, $627 resets only when Link is hit, not when fairy generated.
There are 3 modes of item generation:
  • Fairy Bonus: If $627 is exactly 16 when the item drop occurs, the item will be a fairy. $627 only resets when Link is hit, so multiple fairies can be generated at once. However, generating a bonus fairy DOES reset $50 which can be a big inconvenience if you're working toward getting a blue rupee or bomb using $50. Also, a Fairy Bonus overrides any Blue Rupee/Bomb bonus.
  • Blue Rupee/Bomb Bonus: If $50 is exactly 9 when an enemy is killed, $51 will be set depending on the weapon used: bomb ($51=1, item=bomb) other weapon ($51=0, item=blue rupee). The item specified by $51 is guaranteed to drop the next time an enemy that drops items is killed, instead of the basic item drop.
  • Basic item generation: Each enemy slot has its own RNG byte which updates each frame and determines whether or not a basic item will drop. The likelihood varies a bit by enemy group. If a basic item is going to drop, its type is according to $52a and the enemy type, sorted into groups A-D on Baxter's invaluable chart.

Glitches & Strats

Bonus Lock

$50 tracks how many enemies Link has killed without getting hit. When it hits 10, a bonus item is selected for the next item drop and stored at $51. If a Dodongo is killed with a sword, or any other enemy is killed with a bomb, then $51 will be non-zero and the item will be a bomb. Otherwise, $51 remains 0 and the item will be a blue rupee.
The trick is, until an item actually drops, $50 and $51 won't change. So if $50 hits 10 due to killing an enemy that doesn't drop items (e.g. a bat) or Link exits the screen before the item drop, the bonus item choice can be manipulated.
Early on I use this mainly to manipulate blue rupees; once all items are purchased it's used to manipulate bombs.

Manhandla Easy Bonus

It's easy to get a bonus item from Manhandla (4-headed pirahna plant boss) because $50 increments for each head that is killed, and for each FRAME that any weapon hits the center section. So to get a bomb drop, just kill it with a bomb and avoid killing all 4 heads on the same few frames. To get a blue rupee, use the sword and stab the center section for a Bonus Lock and finish it off with a bomb.

Fun With Gels

If you stab a Gel such that it doesn't get pushed back (e.g. if it's against a wall or it's in motion and you stab from the side), $50 will increment without changing $52a. Killing the mini-Gels that split off will also increment $50 but not $52a. This can be helpful to quickly jack up $50, or to fine tune the relationship between the counters.

Fairy Horde

$627 increments on the frame an enemy's hp reach zero, but unlike $50 it only resets when Link is hit, not when a bonus item is generated. If several enemies are killed within a short time such that $627 ends up at 16 before the first item drops, every enemy will drop a fairy. The only limit is the number of enemies you can kill at once; I get five fairies on the screen before Level 1 for entertainment.

Level Comments

Level 3

Up to the raft is the same. After the reset, I get bombs from darknuts so I can use the Bonus Lock strat for a blue rupee from the boss. Even though it can't be damaged, hitting the boss' center section with a sword/bomb increments $50 each frame. I stab the boss twice to max out $50, locking in a blue rupee drop.
Overall, 34 frames lost for 5 more rupees (15 vs 10).

Overworld to Level 4

It's about 200 frames faster to walk rather than reset; I can do so because I'm using a different shop for the Candle and no Money Making Game.

Level 4

Very efficient blue rupee on the first Gels screen, and I also kill a Gel with 2 sword swipes to increase $50, allowing later blue rupees from a Vires and then a Gel guarding the Ladder. For the room with 10 rupees on the floor, I tried variants grabbing 8, 9 and 10 rupees; 8 is the most efficient grab. Reaching the boss with full life saves 22 frames overall as the beam sword gives a faster first hit on Gleeok. I also use $50 to get a blue rupee from the boss rather than a life refill.
Overall, 49 frames lost, 26 more rupees (28 vs 2).

Overworld to Level 1

It's about 20 frames faster to walk from Level 4 rather than reset, even counting the annoying unavoidable sword swipe to kill an Octorok on the dock. I use a bomb to manipulate item drops by killing 5 Octoroks and drop 5 fairies due to the Fairy Horde trick. This was left in for entertainment; it may cost some time as it does reset $50, but the coming counts all worked out quite well so it's unclear.

Level 1

Skeletons give blue rupees on the right counts, so I take advantage. Since I haven't grabbed any extra heart containers thus far, I have full life after the Bow reset. This enables a minimal-delay blue rupee from stab-shooting a skeleton and also saves about 45 frames not needing a life refill from the boss.
Overall, 17 frames faster, 8 more rupees (16 vs 8).

Overworld to Level 5

Surprisingly, it's only about 100 frames slower to walk from Level 1 --> 5 than Level 2 --> 5. The reason is that with the screen glitch, horizontal travel is faster than vertical travel (no need to traverse the status bar).
I have to dodge around an unavoidable Octorok coming out of Level 1, and avoid damage boosting so I can use the beam sword for a blue rupee on the stairs before the Candle shop. I get another blue rupee with minimal delay (need to wait for the statue to wake up anyway) from the Red Leever outside of Level 5.
Using the secret entrance avoids the level entrance/exit stairs animation (thanks, RAT926), saving about a second total, plus the nearly-free blue rupee.

Level 5

The strat for this level revolves around bomb management: I want to reach the boss with exactly 1 bomb to automatically swap to the Whistle. Avoiding the need for an extra refill requires killing the 3 mummies after the Whistle reset with 1 bomb (and 3 sword strikes) instead of 2 bombs. Happily, due to the bomb delay and decent luck, this actually clears the room 8 frames faster. 2 seconds are saved for the Whistle swap on the boss.
There are no convenient places to get money in Level 5, so I didn't. Overall, 168 frames faster (though about 90 frames will be lost getting bombs and a blue rupee in the overworld).

Reset, Overworld to Level 8

Level 8 is full of Blue Darknuts, so we really need bombs. The only good spot to get them is the screen with the 100-rupee Moblin. Enemy appearance and movements are manipulated, and a simultaneous Candle-Sword strike is used to get both a bomb and blue rupee.
As RAT926 showed, it's slightly faster to enter Level 8 from up in the status bar, and it also glitches the sound nicely.

Level 8

Level 8 is full of difficult-to-kill-with-the-wooden-sword enemies that don't drop blue rupees, so apart from grabbing the room rupee for killing the Manhandla, it's pretty straightforward.
Overall, 12 frames lost, 5 more rupees (5 vs 0).

Overworld to Level 2

This walk is just slightly faster as we don't have to walk right for the shop.

Level 2

This level is great since Ropes only take 1 hit so the Wooden Sword actually feels useful! The most interesting fight here was the Moldorms (fire snakes).
After much frustration, I disassembled their damage-taking routine to see how they work. It's very counter-intuitive. Each segment has 32 hp (2 sword strikes) and its own invulnerability counter. If you kill a segment that is NOT at the end, the game instead nukes the end segment, then restores the original segment to full hp and also makes it temporarily invulnerable. Making matters worse, damage is checked from the head back -- so whereas hitting all 5 segments with a bomb SHOULD kill them all, it actually follows this logic:
  1. Damage segment 1 (head): nuke seg 5, head now invulnerable
  2. Damage segment 2: nuke seg 4, seg 2 now invulerable
  3. Damage segment 3: it's now the tail, so it gets killed
So you end up with 2 segments at full health and a half-second invulerability period. Not ideal, and slower than the Published run's approach using the Candle.
A faster strat is to hit the first 2 segments with the sword while waiting for the bomb to detonate.
  1. Damage segment 3: nuke seg 5, seg 3 now invulnerable
  2. Damage segment 4: it's now the tail; nuked
  3. Segment 1 invulerability wears of: nuke seg 3, seg 1 invulnerable
  4. Segment 2 invulnerability wears off: it's now the tail, nuked
This leaves only the head after the bomb detonates, and the room is cleared 14 frames faster than in the published run.
Overall, 120 frames faster, 6 additional rupees (21 vs 15).

Reset to Level 7

Here I take the route's big detour -- going 2 screens north and back again to buy the Meat and Arrow. Killing the first Blue Leever to appear resets a counter ($29) that would otherwise cause about a 2-second delay for the shopkeeper to appear. Using my last bomb also swaps to the Whistle for Level 7.
The heart from the Blue Leever restores the beam sword, which significantly speeds killing a Moblin after I'm done shopping to get bombs. (Incidentally, it's not feasible to use a $50 bonus to get a bomb refill from a red octorok; killing the Level 2 Dodongo with the sword always resets $50 to 0.)

Level 7

Most time was saved by running out of bombs on Digdogger to swap to the whistle, saving about 2 seconds. Because bombs are needed before they could normally be refilled, I set up a Bonus Lock by killing an earlier Goriya with a bomb then leaving the room before it drops an item. The result is a bomb refill from the first mini-Digdogger killed with the sword.
The published run kills the mini-Digdoggers with 2 bombs. I have to finish them off with 4 sword stabs and wait for the bomb refill, so overall the strat saved 1 second.
I manage another bomb refill by manipulating a Dodongo in the next room over next to the righthand wall. The Dodongo gets stunned by the bomb, and I stab it with the sword, setting up a Bonus Lock bomb from the Wallmasters (hands) in the next room.
Wallmasters show up at fixed times provided you're along the wall on the relevant frame, so there's no rush in killing them, other than the last one.
7 frames were saved on the boss by simultaneously pressing A+B to lay a bomb and stab, saving some walking delay. Overall, 137 frames faster.

Overworld to Level 6

It's about 10 seconds faster to get to Level 6 from Level 7 vs Level 1 (as done in the published run, not counting time shopping). The published run couldn't do this, however, because when it completes Level 7 it has neither Bow (Level 1) nor Arrow (purchased en route from Level 1 to 6).
It's possible to manipulate a damage boost up off a Peahat on the stairs to Level 6. However, I removed it because you then lose time not having the beam sword for the room where you have to kill all the bats and the luck was really bad, so it's faster to take other damage boosts.
Using the secret entrance saves a net of 8 frames.

Level 6

The whole time I was TASing this run, I had in the back of my head 'I hope fighting Blue Wizzrobes isn't as hard as it looks.' Yeah, no. Those rooms are REALLY hard; Blue Wizzrobes have 160 hp, requiring 2 bombs and 2 sword strikes each for an optimal kill. It's even worse when Like Likes are there too; they have 144 hp, so need 2 bombs and 1 sword.
I also appear to have had worse luck with Red Wizzrobe placement, especially in Level 9. Unlike other enemies, their initial location can be manipulated by delaying one or more frames, but that doesn't mean they'll show up where you want them!
I was able to improve a few rooms by decent numbers of frames, but the main improvement is a better bomb refill -- the published run takes a refill from Red Wizzrobes that otherwise wouldn't have to be killed. I use 1 more bomb but only get refills from enemies that need to be killed, saving about a second.

Overworld to Level 9

As it turns out, it's faster by about 15 frames just to walk, rather than Whistle over to Level 1. This is fortunate, since with my route, the Whistle won't take me to Level 1.
It would have been EVEN faster, of course, if not for the presence of an unmanipulatable (and I tried, oh how I tried!) Peahat on the $%@! stairs down from Level 6, giving me a negative boost on slow terrain.
I agonized over whether to take 0, 1 or 2 damage boosts from the statues on the way. They're not ideal since statues do 1 heart damage and taking the boosts limits the number of up-right turns. It's pretty close, but as the luck works out it seems faster to take 2 boosts and manipulate more life refills in Level 9. I was happy with that outcome since I think entertainment-wise it looks pretty bad-ass to go into Level 9 with only 1 heart.

Level 9

Some good, some bad. I enter with 1 heart and 6 bombs, compared to the published run's 5 hearts and 7 bombs, and end up finishing 5 frames faster after spending 2 frames time-entertainment tradeoff on Ganon.
Because of the number of tunnels and not needing to finish with full life, damage boosts are a much bigger consideration than in prior levels. Compared to the published run, my route gets 2 more heart refills and takes 2 hearts less damage to make up for starting with 4 fewer hearts. In a couple of rooms I made up time by boosting off damage-free bubbles. The room before the Silver Arrow was also slower due to luck and having 1 less bomb. Overall, I was 20 frames slower up to Patra.


This fight was MUCH harder than I expected. My initial attempt, using common-sense strats as well as I could, ended up over 100 frames slower than the published run. Many tedious hours followed trying to match and then improve that time. Basically, the satellites rotate counter-clockwise and all must be killed before the main body can be attacked; each takes 6 hits with the wooden sword. So the key is to try to move clockwise around the boss as well as you can without missing any opportunities to damage a satellite (since you'll end up waiting for its invulnerability period at the end).
I ended up shaving 4 frames off the satellites, and another 7 by striking the main body on the next frame after the last satellite is killed, rather than having to walk to take another swing. 3 more frames are saved by getting 1 pixel inside the doors leading to...


I always wondered why Ganon was killed at the bottom left. Since you have to grab the tri-force after he dies, it would seem faster to manipulate him to die closer to the door. Looking at the code this is fairly definitively not possible -- his logic is really dumb.
You can't see it, of course, but left to his own devices, Ganon walks around the room like a regular creature. When he's damaged, of course, he becomes visible for 64 frames. Once that time elapses, regardless of where he is he'll teleport either to the bottom left or bottom right. This destination alternates every frame, so if you hit him again as quickly as possible, he'll always reappear in the same place.
For (slight) entertainment, but more for just throwing in a little Ganon variety, I lose 2 frames to let Ganon change positions twice. With an optimal sword strike, Link can just barely follow Ganon from side to side without losing more time.
Five frames are saved in the fight taking the initial stab with a Left + Right + A, enabling me to get in the first attack without walking as far.
Three more frames are saved on the coup de grace by stabbing and firing the Silver Arrow simultaneously. If you're standing far enough away, the arrow will still do its job.

Miscellaneous Questions

Red Candle?

Much slower. The reason is that defeating Level 7 requires both the Whistle and Meat. The Meat must be purchased, and a Candle is needed for the game's easiest money grab (the 100-rupee Moblin bush).

White Sword?

A little bit slower. At first glance, this is actually really close -- the time savings on the Level 8 Gleeok, Level 2 Moldorm, Level 7 Digdogger & Aquamentus, and Level 9 Patra and Ganon comes within 2 seconds of offsetting the time to grab it after Level 5. It's possible there are about 2 seconds available from faster fights, particularly with Blue Wizzrobes.
The problem is that having the necessary heart containers (5) to grab the White Sword means grabbing boss heart containers in Levels 1 and 5. Not having the beam sword after resets will the lose additional time getting overworld bomb refills after the 100 rupee bush and just before Level 7.

Samsara: High profile September continues spectacularly. Judging.
Samsara: This has been a hell of a year for unexpected, insane improvements, this one being no exception. Accepting as an improvement to the published run.
fsvgm777: Processing.

Last Edited by fsvgm777 on 10/6/2016 5:33 PM
Page History Latest diff List referrers