The Legend of Zelda (second quest)

  • Aims for fastest time
  • Manipulates Luck
  • Abuses Programming Errors
  • Uses a game restart sequence
  • Takes damage to save time
  • Uses a level password
  • No predefined saves
  • No Death
  • Genre: Adventure
  • Uses Emulator FCEUX 2.0.2
This run is 4 minutes and 13.60 seconds faster than Sleepz' published movie.
The Legend of Zelda is a game that needs little introduction to most gamers, however, here is a brief description:
The player controls the hero character, Link. Ganon, the prince of darkness, and his army attack the kingdom of Hyrule and steal the triforce of power--a legendary relic handed down to each generation of Hyrule's royalty. Now he needs to obtain the triforce of wisdom, but princess Zelda scattered eight pieces of the triforce of wisdom in dungeons around the game's fantasy setting called Hyrule. The princess also sends her most trustworthy nursemaid, Impa, to find a hero with the courage to face Ganon. Ganon, who is upset by Zelda's plot, captures her and imprisons her at LEVEL 9.
Impa is then cornered by Ganon's minions but rescued by a young man. His name is Link, our protagonist. Impa confides in Link, telling him the story of Gannon and the Princess. Now armed with a quest, but no sword, Link goes forth to save Hyrule. I still wonder how the Princess managed to hide those triforce pieces with all the monsters and locked doors in these dungeons...

Techniques and Technical Information

Luck Manipulation

Luck manipulation is the heart and soul of this run. The most rerecords are used trying to obtain ideal enemy movement in order to quickly kill enemies, bypass them, or damage boost off of them.

Enemy Dropping Patterns

One of the first objectives when starting this run was to determine exactly how the game determines what items enemies drop; with full control of enemy drops, the better we may plan our damage boosting and bomb rationing.
The enemies either drop or do not drop an item based solely on what frame they are killed.
What exactly they drop is more complicated. It is determined by two factors:
  • The type of baddie (they are lumped into 4 categories based on what they are programmed to drop)
  • The number in $052A
$052A increases by one every time an enemy is killed. This chart made by Baxter illustrates the concept better than words:
Knowing which enemies are up ahead, and the value of $052A, it was easier to plan our bomb and life boosts based on what would drop.
For example, some frames are used in LEVEL 6 to kill three bats. This increases $052A's value by three so that the digdogger (eyes) in level 8 will drop us a fairy and a heart, allowing Link to completely refill the health he used damage boosting towards LEVEL 8.
0050 will also count the amount of enemies that are killed, but it will drop to 0 again if Link is hit. Killing a number of enemies (for instance 10) without getting hit will cause $0050 to flip to 0 automatically in which case the item at the chart in the picture will be overwritten by a ‘good’ item such as a 5-rupee, a bomb or a fairy. This is how it for instance was possible to get two 5-rupees at LEVEL 1.

Luck manipulation of enemy movement

There are a few ways to control how the enemies move on screen.
  • When Link enters a room on a different frame, the enemies' initial direction of movement can change. (Waiting before entering next room is done underneath the door, or spread out over the previous room, so that it won’t be very noticeable.)
  • Pausing the game using the select button costs a minimum of two frames, but it can save a lot of time in certain situations because it directly effects how enemies behave.
  • Enemies behave differently based on where Link is on the screen.
Even with all of these techniques to manipulate the monsters, it can still be difficult to control all the baddies in an optimal fashion; consequently, this is where many rerecords are spent. The only way to be sure that a room of blue darknuts, or bunnies, etc is completed as fast as possible is to keep trying to manipulate their movement, while at the same time sparing the least amount of frames. Unfortunately, all said techniques to control monsters' behavior use frames (except Link's position, but it can cost frames to move him for luck manipulation, too).
With this conclusion, it's easy to see that the game lends itself to massive amounts of testing. Generally, one will find that once a certain problem monster has been manipulated to behave in a desired fashion, the rest have all inconveniently changed their minds and are now doing something undesired. The best approach is to keep trying various combinations of the techniques until an optimal one presents itself.

Luck manipulation and gambling

There is a 4 frame rule at the gamble door (as well as all other doors that lead from the overworld to the underworld). The gamble rupee value can only be manipulated based on what frame the gambling den is entered at. So keep trying every 4th frame until desired rupee value is available. Getting the 50-rupee in the middle is obviously the fastest.

Combat and Movement Techniques

Combat and movement is fairly straightforward in Zelda, but there are some tricks to help save time.

Link's Movement

Some facts:
  • Link can only move and face one of four directions--up left right and down--at a given time.
  • He can only change direction on every 8th X or Y coordinate.
  • These pixels where link can move any direction (i.e. {64,64}, {64,72}, {56, 64}, Let's call them a crossroad coordinate.
  • Link moves at roughly 1.5 pixels per frame (there is sub pixel positioning).
  • The memory addresses for Link's X,Y position are $0070 and $0248 respectively. Due to sub pixel positioning, when moving these addresses generally increase/decrease in this pattern: 1,2,1,2,1 etc
There is a timesaving technique in regards to the sub pixel positioning. Link can move through an in screen block of area every 6 frames except when moving up followed by right, right followed by up, down followed by left or left followed by down. In said case, Link moves at 5 frames per in screen block (8 x or y coordinates constitute a block in game). This is the explanation for zigzagging up and right or down and left--it saves one frame every 8 coordinates.
  • Screen scroll glitch:
Sleepz posted this glitch some time ago, but it has yet to be used in a published TAS. In the overworld, just before entering a new screen, press a direction to Link's left or right for one frame when Link only has 5 more coordinates to reach the next screen scroll. It allows Link to wrap around the screen so that he is now on the opposite side! The timesaving implications are lucrative, especially considering the fact that link can wrap around the entire map, entirely skip the lost woods, and access areas that may otherwise be obscured by water or mountains.
  • Similarly, the above technique may be used to get inside obstacles (blocks, bushes, etc), and sometimes allows Link to bypass areas that he would normally need to walk around. The first example of this is in dungeon 2: Link is able to enter the inside of a block from the top, and then exit the block from the right side. This is not easily performed during console play as it requires frame by frame input (it does not use left+right or anything). Due to the fact that Link can move halfway ‘below’/’inside’ solid blocks normally, this trick allows Link to pass through diagonally placed solid blocks.

Combat Techniques

  • Pressing A + B with bombs equipped allow link to use his sword and deploy a bomb simultaneously--a very useful move on enemies that take multiple blows to kill. It’s especially useful since Link is unable to do anything for a few frames when using his sword, a bomb or another item.
  • On a crossroad coordinate, Link may face any direction while thrusting his sword. Useful in striking multiple enemies that are on various sides of the hero.
  • On a crossroad coordinate, press Left, Right, and A. Link will attack diagonally up and left!
  • When hitting an enemy with the sword on the exact frame that a bomb explodes, the enemy will get damaged by both at the same time. This trick is used often to avoid enemy invulnerability time.
  • When moving over the ladder or leaving a room, Link can use his sword while he is moving. This is especially useful for collecting pickups when leaving the room after for instance a bossfight.
  • When fighting digdoggers (eye boss monsters), lay a bomb and quickly swap to the whistle. Blow the whistle, and the bomb's detonation timer will continue to count down despite the fact that all enemies and actions are paused while the whistle is in use. The bomb will instantly detonate once the whistle is finished playing, instantly exploding on the small eyes spawned by the large eye. (Bombs take 40 frames to detonate, memory address $0038 or $0039)

Route

The route begins much like Sleepz' run, but ends differently. Here's the brief description
  • LEVEL 1
    • Acquire rupees for gambling
    • Heart Piece for damage bumps and the white sword
    • Triforce Piece 1
    • Reset
  • LEVEL 2
    • Along the way...
      • Gamble
      • Get Candle (needed for opening a 100 rupee cave after level 2 and opening level 7)
    • Pick up the whistle
    • Pick up Heart Container for White Sword
    • Pick up Triforce Piece 2
  • LEVEL 6
    • Get ladder. (useful in level 4 and level 5 and this particular level order, needed for entering level 8 on the way to level 4 also)
    • Leave for now; bow and arrows needed to finish
  • LEVEL 8
    • Along the way...
      • Pick up the bracelet; it's needed to open up LEVEL 4 so we can get the raft, and consequently the bow in LEVEL 5.
    • Use stepladder to enter
    • Triforce Piece 3
  • LEVEL 4
    • Along the way...
      • White sword (in this quest plenty of bosses which make it worthwhile to collect this)
    • Pick up the raft for LEVEL 5 and the bow, which is required to finish 6 and 7
    • Triforce Piece 4
    • Reset
  • LEVEL 5
    • Pick up Bow
    • Triforce Piece 5
    • Reset
  • LEVEL 3
    • Along the way...
      • Use the secret road man in cave for speed
    • Triforce Piece 6
  • LEVEL 7
    • Triforce Piece 7
    • Whistle to the lake by lost woods
  • LEVEL 6
    • Triforce Piece 8--complete triforce now
  • LEVEL 9
    • Silver Arrow
    • Ending

Extra

It was also possible to glitch up the level 9 graphics due to entering it before the game expected it. Due to the frame rule of 4 frames, the glitching of the graphics can be avoid by entering a frame later, without losing any time. Fortunately it was possible to hexedit the version with the glitched level 9 graphics (it completes the game in the exact same amount of frames):

Personal comments:

Morrison: I lost motivation on this project numerous times and just disappeared for long stretches of time. I apologize to Baxter for this, as it is the main reason the run took such a long time to make. While I was away, he finished the dungeons 5, 3, 7, 6 revisited, and 9 all by his lonesome, so about half the run wasn't even a collaboration, but a solo effort. Hats off to you :) I'm not certain my name should even be on the project anymore. I am just glad to see it completed. Baxter is a great TASing partner. Trying to beat the times on his WIPs is not an easy task; he's quite thorough and patient. :) I had a lot of fun spending time with him in irc while we were doing all the testing. Big thanks to all previous Zelda TAS authors, Baxter, Phil, Sleepz namely.
Baxter: The Legend of Zelda is one of few games in TASing where I both really like the results as well as the process. Researching routes, and optimizing rooms can both be quite fun. While the main idea of the fastest completion of a room might be the same, the specifics are not. Due to a change in the order of completion of the levels (…53769 instead of …56379) all of these levels had to be redone (level 5 also). Having to redo stuff that’s was completely optimized before is not fun, and this is when you notice that not each room can be done the same. Even though it’s called luck manipulation, there are frames required to manipulate this luck, and sometimes real luck is needed in the process. When redoing these levels, you constantly gain and lose frames to a previous version in each room, while they both may have been completely optimized for each initial conditions. It’s definitely a bit different from most other games, but very fun nonetheless. The cooperation with Morrison was very fun, and he was a great partner. He often mentioned options I hadn’t thought of, and produced very accurate work. It was too bad that he lost his motivation for TASing, but more because I really enjoyed working with him than that I had to do more work myself. Thanks to everyone who showed their interest in this TAS, which is always a great help.

mmbossman: Excellent planning, execution, and entertainment; Great job guys. Accepting as an improvement to the published "2nd quest" movie.
Bisqwit: Encoding. My first FM2 encode :)
Bisqwit: Unclaiming the encode, because I can't figure out why mencoder refuses to render the libass subtitles in the movie, and I have too little time to debug it.


Editor, Expert player (2330)
Joined: 5/15/2007
Posts: 3933
Location: Germany
Out of curiosity, is the screen wrap glitch used in the current first quest TAS?
no. I forgot to post my comments.^^ Very nice run. I especially liked the parts where the screen glitch was used, and how you just went through some walls sometimes. I'm looking forward to the 1st quest run. And a question: I don't know whether I saw it in Sleep'z demonstration or in some other video, but I saw Link going through the top of the screen horizontally (like here: http://www.youtube.com/watch?v=SioisShS7Q0 ) and now I was wondering if it can be used to skip even more parts of the map by using that black part on the top as a bridge. But I'm sure this has already been tested or the way the screen glitch was done in the run was already the most effective way.
Skilled player (1410)
Joined: 5/31/2004
Posts: 1821
MUGG wrote:
And a question: I don't know whether I saw it in Sleep'z demonstration or in some other video, but I saw Link going through the top of the screen horizontally (like here: http://www.youtube.com/watch?v=SioisShS7Q0 ) and now I was wondering if it can be used to skip even more parts of the map by using that black part on the top as a bridge. But I'm sure this has already been tested or the way the screen glitch was done in the run was already the most effective way.
The top of the screen resembles part of the screen underneath. something like, top half isn't used, it's swapped half a tile to the left. Then it's just like a part of the screen underneath pasted above, so sometimes your movement is very limited there. There weren't any particular cases where we found it to be profitable to walk here to scroll sidewards... maybe in the first quest, we'll see ;)
Player (21)
Joined: 10/14/2005
Posts: 317
Great job guys! Incredible glitches, combat techniques, and route planning. Here are two points which relate only to style:
  • Why not have the glitched level 9 version as the main submission? It's awesome having the flying Impas, Moblin Patra, and Princess Zelda as a Pols Voice.
  • This doesn't save time, but in one of these Zelda movies I'd like to see a shot fired in the Ganon window of opportunity.
Joined: 7/28/2005
Posts: 339
moozooh wrote:
Morrison wrote:
The second quest has 'invisible' doors. You just run into a wall sometimes where a door would be if there was a door, and eventually you can run through it :)
To think Nintendo would be guilty of one of the most outrageous level design offenses… :)
Oh, come on now. In February 1986, that was A-OK. ;)
Joined: 7/2/2007
Posts: 3960
Kles wrote:
moozooh wrote:
Morrison wrote:
The second quest has 'invisible' doors. You just run into a wall sometimes where a door would be if there was a door, and eventually you can run through it :)
To think Nintendo would be guilty of one of the most outrageous level design offenses… :)
Oh, come on now. In February 1986, that was A-OK. ;)
To be fair, there are ways to do this "right", and this game did it properly the first time, anyway. In dungeon 2, you can see the room that the first "invisible door" leads to, and it's clearly meant to be accessed from there; some experimentation with the wall on the other side should eventually get you through. Once you know such doors exist, it's a matter of looking at the map combined with trial and error to find out how to go forward -- and several bombable walls in the first quest require a similar approach.
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Joined: 4/3/2006
Posts: 269
Very entertaining run! The glitch that "go down but ended up at the top of the screen" was nice. YES vote!
Joined: 3/11/2008
Posts: 583
Location: USA
Derakon wrote:
Kles wrote:
moozooh wrote:
Morrison wrote:
The second quest has 'invisible' doors. You just run into a wall sometimes where a door would be if there was a door, and eventually you can run through it :)
To think Nintendo would be guilty of one of the most outrageous level design offenses… :)
Oh, come on now. In February 1986, that was A-OK. ;)
To be fair, there are ways to do this "right", and this game did it properly the first time, anyway.
There's also the old man who says "GO TO THE NEXT ROOM" and one where there's a straight corridor from a door to a wall.
Joined: 2/25/2006
Posts: 407
Excellent job, works fine on the (U) (PRG 0) rom :)
Ryzen 3700X, ASUS Crosshair VIII Hero (WiFi) Motherboard, 32GB 3600MHz RAM, MSI Geforce 1070Ti 8GB, Windows 10 Pro x64 http://tasvideos.org/Nach/FranpaAlert.html
Joined: 6/26/2007
Posts: 147
Nice job. Congrats on obsoleting one of the few remaining Famtasia runs.
Joined: 4/19/2008
Posts: 31
Location: Chicago
franpa wrote:
Excellent job, works fine on the (U) (PRG 0) rom :)
I would hope so, considering that's the ROM they said was used :)
Joined: 2/25/2006
Posts: 407
Ah, FCEUX said the checksums didn't match.
Ryzen 3700X, ASUS Crosshair VIII Hero (WiFi) Motherboard, 32GB 3600MHz RAM, MSI Geforce 1070Ti 8GB, Windows 10 Pro x64 http://tasvideos.org/Nach/FranpaAlert.html
Skilled player (1410)
Joined: 5/31/2004
Posts: 1821
Bisqwit: I noticed in your encode of the first quest movie by Phil and me that when leaving screens in dungeons, Link is visible. This shouldn't be the case, and I would really like it if you could avoid this somehow for this movie. There is a position Link can take 'underneath' the door where he is completely not visible (last frame before leaving the room)... to avoid showing seemingly pointless waits for luckmanipulation inside rooms, these waits were usually made underneath these doors where Link is not visible (so the luck manipulation is not noticable. I want to add to that that is also just looks strange. The left shows how it is supposed to look, and the right shows your encode for the current first quest movie. Could this please be fixed for this movie?
Former player
Joined: 12/5/2007
Posts: 716
For the record: this can be "fixed" by not allowing more than 8 sprites per scanline ("--nospritelim 0" for the SDL build of FCEUX or to be found via Config -> Video for the Windows build).
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Thanks for the information, Baxter & ShinyDoofy. This is the first time I hear of a NES game abusing the 8 sprites per scanline hardware limit purposefully.
Joined: 4/25/2004
Posts: 498
Bisqwit wrote:
This is the first time I hear of a NES game abusing the 8 sprites per scanline hardware limit purposefully.
Same here. o_O I always wondered why so many previous emulators messed that up...guess they weren't emulating that limitation. :p
Dwedit
He/Him
Joined: 3/24/2006
Posts: 692
Location: Chicago
Gremlins 2 also did the "8 sprites on a scanline to mask sprites" trick for the intro movie.
Post subject: Movie published
TASVideoAgent
They/Them
Moderator
Joined: 8/3/2004
Posts: 15602
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. ---- [1205] NES The Legend of Zelda "2nd quest" by Baxter & Morrison in 24:59.83
Banned User
Joined: 12/23/2004
Posts: 1850
Dwedit wrote:
Gremlins 2 also did the "8 sprites on a scanline to mask sprites" trick for the intro movie.
Tecmo's football game does it as well, if I remember correctly. There are likely many others.
Perma-banned
Banned User
Joined: 12/23/2004
Posts: 1850
*110332 <Xkeeper2> nice. *110345 <Xkeeper2> whatever genius decided to tablefy that thing in the first page of that thread royally fucked it up. What I'm talking about (Opera 9.6) Edit: It fucks up in Firefox 3 as well, before you bring up OMG USE FIREFOX TISBETTER!!!!!. I guess it's too hard to just leave things that work alone.
Perma-banned
Joined: 7/2/2007
Posts: 3960
Yep, that's one messed-up table (FF3 on Ubuntu here). Just, y'know, confirming that XKeeper is not, at this moment, a raving loon. :)
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Banned User
Joined: 12/23/2004
Posts: 1850
Aye. It actually looks correct on the submission page, but I prefer reading the forum variant for sans-serif fonts.
Perma-banned
Banned User
Joined: 8/2/2008
Posts: 420
Location: italy
Former player
Joined: 12/5/2007
Posts: 716
Xkeeper wrote:
What I'm talking about
Same for Konqueror 3.5.9.
Morrison
He/Him
Former player
Joined: 8/2/2006
Posts: 195
Location: USA
AVI looks great! Thanks.
twitch.tv/Retrogaming2084
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
I guess it has something to do with me not updating the forum css yet. Sorry about that. It has now been fixed.