Difference between revisions of "Hookpush"

From ALttP Speedrunning Wiki
Jump to: navigation, search
(General Technique)
(General Technique)
Line 24: Line 24:
 
## Somaria blocks run their code even when the game is paused to the item or S&Q menus. This includes Slot 9 Blocks and how they decrement the value stored at <code>$039D</code> every frame. The Hookshot does not function while the game is paused though, and this quirk allows for more setups. You can, for example, have a counter set to <code>00</code> in Slot 1, which would ordinarily mean the Hookpush will terminate there before it can execute the data stored in Slot 0 (generally a very high counter). BUT if you use the Hookshot and pause the game just after it latches onto something, the Slot 9 Somaria block will be decrementing <code>$039D</code> every frame, meaning when you unpause, the Hookpush will be reading Slot 0. This is a useful way to bypass slots that have data you don't want to use.
 
## Somaria blocks run their code even when the game is paused to the item or S&Q menus. This includes Slot 9 Blocks and how they decrement the value stored at <code>$039D</code> every frame. The Hookshot does not function while the game is paused though, and this quirk allows for more setups. You can, for example, have a counter set to <code>00</code> in Slot 1, which would ordinarily mean the Hookpush will terminate there before it can execute the data stored in Slot 0 (generally a very high counter). BUT if you use the Hookshot and pause the game just after it latches onto something, the Slot 9 Somaria block will be decrementing <code>$039D</code> every frame, meaning when you unpause, the Hookpush will be reading Slot 0. This is a useful way to bypass slots that have data you don't want to use.
 
## Directions aren't displayed on the Ancilla HUD, but these are also very important for Hookpushing. Just like the Hookpush is using the duration counters set by other ancillae, it will also use the direction of other ancillae. When you use an ancilla, the direction Link is facing when he uses it is stored in an array at <code>$0C72</code> at whichever Slot the ancilla is using. For example, if I throw a Boomerang in Slot 3 while Link is facing right, the game will store that information at Slot 3 in <code>$0C72</code>. If I go to Hookpush with a Slot 4 Hookshot, then for the frame the Hookpush is reading data from Slot 3, I will get pulled to the right, no matter what direction I actually used the Hookshot in. We can use this to Hookpush in directions different from wherever we're facing when we use the Hookshot. Generally the most significant direction will be what's stored in <code>$0C72</code> at Slot 0, because this is where the vast majority of our Hookpush frames occur. Want to Hookpush through a wall to your right? Well make sure your Slot 0 Sword Beam was done while Link was facing right.
 
## Directions aren't displayed on the Ancilla HUD, but these are also very important for Hookpushing. Just like the Hookpush is using the duration counters set by other ancillae, it will also use the direction of other ancillae. When you use an ancilla, the direction Link is facing when he uses it is stored in an array at <code>$0C72</code> at whichever Slot the ancilla is using. For example, if I throw a Boomerang in Slot 3 while Link is facing right, the game will store that information at Slot 3 in <code>$0C72</code>. If I go to Hookpush with a Slot 4 Hookshot, then for the frame the Hookpush is reading data from Slot 3, I will get pulled to the right, no matter what direction I actually used the Hookshot in. We can use this to Hookpush in directions different from wherever we're facing when we use the Hookshot. Generally the most significant direction will be what's stored in <code>$0C72</code> at Slot 0, because this is where the vast majority of our Hookpush frames occur. Want to Hookpush through a wall to your right? Well make sure your Slot 0 Sword Beam was done while Link was facing right.
## Ancillae coordinates also aren't displayed on the Ancilla HUD, but can sometimes be a factor in Hookpush setups. You may have noticed in normal gameplay that the Hookshot doesn't always pull you evenly with the object you've Hookshotted. Sometimes there may be a 2px gap between Link and the pot/wall/torch or whatever that you got pulled towards. The game is comparing Link's position with the position of the Hookshot ancilla, and when he gets with 2px of it, the pull will end. This is presumably done to avoid Link clipping much into objects while Hookshotting around, which he would certainly be able to since he's moving 4px/frame while being pulled. So how does this factor into Hookpushing? Well much like with the other data we've talked about, ancilla will store their position at an array (<code>$0C04</code> for x-coordinate, <code>$0BFA</code> for y-coordinate), and these values are what the Hookshot is using for this little anti-clip routine. Except in normal gameplay, it's reading the values from the Hookshot's Slot, but with Hookpushing it'll be reading values set by other ancillae. So how does this impact Hookpush setups? Let's say we want to Hookpush through a wall going north. If possible, we want to set our Slot 0 Sword Beam lower in the room such that its coordinates don't end in the path of our Hookpush. If I Slot 0 Sword Beam against the top wall, then the Hookpush will only work by starting the Hookshot at specific coordinates. Failing coordinates result from the game reading Link as getting too close to the object we've Hookshotted to, such that if the Hookshot continued one more frame, he'd be inside the object. Except the game is looking at the coordinate of the Slot 0 Sword Beam hitting a wall rather than something the Hookshot hit.
+
## Ancillae coordinates also aren't displayed on the Ancilla HUD, but can sometimes be a factor in Hookpush setups. You may have noticed in normal gameplay that the Hookshot doesn't always pull you evenly with the object you've Hookshotted. Sometimes there may be a 2px gap between Link and the pot/wall/torch or whatever that you got pulled towards. The game is comparing Link's position with the position of the Hookshot ancilla, and when he gets with 2px of it, the pull will end. This is presumably done to avoid Link clipping much into objects while Hookshotting around, which he would certainly be able to since he's moving 4px/frame while being pulled. So how does this factor into Hookpushing? Well much like with the other data we've talked about, ancilla will store their position at an array (<code>$0C04</code> for x-coordinate, <code>$0BFA</code> for y-coordinate), and these values are what the Hookshot is using for this little anti-clip routine. Except in normal gameplay, it's reading the values from the Hookshot's Slot, but with Hookpushing it'll be reading values set by other ancillae. Let's say we want to Hookpush through a wall going north. If possible, we want to set our Slot 0 Sword Beam lower in the room such that its coordinates don't end in the path of our Hookpush. If I Slot 0 Sword Beam against the top wall, then the Hookpush will only work by starting the Hookshot at specific coordinates. Failing coordinates result from the game reading Link as getting too close to the object we've Hookshotted to, such that if the Hookshot continued one more frame, he'd be inside the object. Except the game is looking at the coordinate of the Slot 0 Sword Beam hitting a wall rather than something the Hookshot hit.
 
## If you don't want to enter EG, you'll want your EG Check value to be <code>00</code> or you'll want to have [[Exploration Glitch|Weak EG]] set. It's important to note that this watch is viewing the EG Check at Slot 0. This is very relevant for avoiding unintentional EG since you'll typically be using Slot 0 to do the Hookpush, but if you want to enter EG, you can end the push early and use a different slot's EG Check value, which won't be displayed on the HUD. Currently most setups used to Hookpush to EG do use a higher slot with that slot's counter at <code>00</code> or <code>FF</code> (so the Hookpush stops at that slot) but the EG Check for that slot is set above <code>00</code>.
 
## If you don't want to enter EG, you'll want your EG Check value to be <code>00</code> or you'll want to have [[Exploration Glitch|Weak EG]] set. It's important to note that this watch is viewing the EG Check at Slot 0. This is very relevant for avoiding unintentional EG since you'll typically be using Slot 0 to do the Hookpush, but if you want to enter EG, you can end the push early and use a different slot's EG Check value, which won't be displayed on the HUD. Currently most setups used to Hookpush to EG do use a higher slot with that slot's counter at <code>00</code> or <code>FF</code> (so the Hookpush stops at that slot) but the EG Check for that slot is set above <code>00</code>.
  

Revision as of 15:01, 8 June 2021

Hookpush is a Major Glitch that uses Misslotting to alter the values the Hookshot uses to determine how far and in what direction to pull Link when the hook latches onto something. Because the game mostly ignores collision while Link is being dragged by the Hookshot, this can be a very powerful glitch for bypassing walls and other obstacles.

Loose Explanation

Normally, when Link uses the Hookshot, a Hookshot ancilla is loaded into Slot 4 and a counter in that slot will immediately be set to 0 and then increment every frame the Hookshot is extending. When the Hookshot connects with an object to pull Link to, the counter will decrement every frame as Link is pulled to the object. Link is pulled 4px/frame until this counter gets back to 0. But what if we can get the Hookshot to look at different counters outside of its current ancilla slot? That's how this glitch is gonna work.

$039D is a memory address where the Hookshot's current slot value is stored when we use the Hookshot, and it is used to determine which slot's counter the game should use when Link starts getting pulled. A Somaria block placed in Slot 9 will decrement the value at this address every frame. This means that if we have a Somaria block in Slot 9, and we use the Hookshot with no other ancilla loaded, the Hookshot will spawn in Slot 4 and the counter for Slot 4 will increment until the Hook connects with an object. For the first frame of pulling, the Slot 4 counter will be used, but then, because of the Slot 9 block decrementing the value at $039D, the next frame of pulling will read data from Slot 3, the third frame of pulling from Slot 2, then Slot 1, and then finally Slot 0, where it will continually use this counter until it reaches 0.

Through using other ancillae in specific ways, we can manipulate the counters in other slots to get the Hookshot to pull us for extended durations and/or in the incorrect directions. Or even have it pull us to EG.

General Technique

Labeled Ancillae Super Watch
To best learn this and debug problems that may arise, you'll want to use Ancilla Watch in the Practice Hack. Open the Practice Hack Menu, go to HUD Extras, then Super Watch and toggle to Ancillae. This will draw values important to misslotting and Hookpushing on the left side of your HUD. Reference the image to see what these values are.

In order to Hookpush, we want to do a few different things:

  1. Misslot a Somaria Block into Slot 9. This requires a couple of steps:
    1. Get the Search Index higher than 09. There are multiple ways to manipulate the Search Index, and the best way may depend on the specific Hookpush you're doing. However, the most common way to get a value higher than 09 is to quickly use the Lamp 3 times while Link is facing any direction except right. Not many things that crop up in normal gameplay write to this address, and only hard resets will put it back to 0. So you can often set this value way ahead of the exact room/moment where you want to do a Hookpush.
    2. Fill the Front Slots (slots 0-4) with ancillae. This is necessary because Somaria blocks will occupy a Front Slot by default, but we want it to load into Slot 9.
    3. Have a Particle ancilla in Slot 9. When we go to use the Cane of Somaria with the Front Slots filled, the game will use the Search Index to begin a secondary search for where to place our block. The game will take the value of the Search Index and begin looking down from that value, which is why we want it above 09. Particle ancillae (that is 0A, 13, and 3C) can be replaced by other ancillae, and that's exactly what we want to have happen. Since 13 (Ice Rod Sparkles) and 3C (the sparkles on a charging sword, silver arrows, and red boomerang) naturally spawn in the Back Slots, these are generally what we'll use. Charging sword in particular is the most common, since it's convenient and puts 3C in Slots 7-9.
    4. With the Search Index set above 09, all of the Front Slots occupied, and a Particle ancilla loaded in Slot 9, we can use the Cane of Somaria and a block will be loaded into Slot 9. This will appear on the HUD as 2C in Slot 9.
  2. With a block in Slot 9, when we use the Hookshot, the game will look at the counter for the Hookshot's slot for the first frame of the Hookpush and then for each subsequent frame it will use the counter for the next slot down until it reaches Slot 0, where it will stay until the counter at Slot 0 had decremented down to 00. How we choose these counters for the results that we want depends heavily on the context, and if you're looking to learn a specific Hookpush, you can go read the Applications section for info specific to what you're learning. But here are some general notes that can help you understand the manipulations being done:
    1. We'll generally want the counters in the slots between the Hookshot's slot and Slot 0 to be a value other than 00 or FF. If any of these values are 00 or FF, then the Hookpush will end on the frame the game is using that counter. By default the Hookshot will spawn in Slot 4, and if that's what the setup calls for, then you'll want the counters for Slots 1-3 to be any value other than 00/FF. You can also force the Hookshot to load into different slots. If I place a normal Somaria block (defaults to Slot 4) and then Dash Dust (will load in Slot 3), then my Hookshot will spawn in Slot 2. Now the Hookpush will ignore data in Slots 3 and 4, and the Hookshot itself will set a good counter at Slot 2, meaning the player only needs to manipulate the counters at Slots 1 and 0. This can be very useful in some contexts.
    2. Generally we'll want the counter at Slot 0 to be a high value. This is because when the Hookpush gets to the counter in Slot 0, it will use only this counter to pull Link until it decrements to 00, when the Hookpush will end. Because Sword Beams write 4C to their slot's counter, a Slot 0 Sword Beam is often used for this. 4C in decimal is 76, meaning we get a whopping 76 frames of Hookpushing with that value. That's 304px of moving with no collision.
    3. Somaria blocks run their code even when the game is paused to the item or S&Q menus. This includes Slot 9 Blocks and how they decrement the value stored at $039D every frame. The Hookshot does not function while the game is paused though, and this quirk allows for more setups. You can, for example, have a counter set to 00 in Slot 1, which would ordinarily mean the Hookpush will terminate there before it can execute the data stored in Slot 0 (generally a very high counter). BUT if you use the Hookshot and pause the game just after it latches onto something, the Slot 9 Somaria block will be decrementing $039D every frame, meaning when you unpause, the Hookpush will be reading Slot 0. This is a useful way to bypass slots that have data you don't want to use.
    4. Directions aren't displayed on the Ancilla HUD, but these are also very important for Hookpushing. Just like the Hookpush is using the duration counters set by other ancillae, it will also use the direction of other ancillae. When you use an ancilla, the direction Link is facing when he uses it is stored in an array at $0C72 at whichever Slot the ancilla is using. For example, if I throw a Boomerang in Slot 3 while Link is facing right, the game will store that information at Slot 3 in $0C72. If I go to Hookpush with a Slot 4 Hookshot, then for the frame the Hookpush is reading data from Slot 3, I will get pulled to the right, no matter what direction I actually used the Hookshot in. We can use this to Hookpush in directions different from wherever we're facing when we use the Hookshot. Generally the most significant direction will be what's stored in $0C72 at Slot 0, because this is where the vast majority of our Hookpush frames occur. Want to Hookpush through a wall to your right? Well make sure your Slot 0 Sword Beam was done while Link was facing right.
    5. Ancillae coordinates also aren't displayed on the Ancilla HUD, but can sometimes be a factor in Hookpush setups. You may have noticed in normal gameplay that the Hookshot doesn't always pull you evenly with the object you've Hookshotted. Sometimes there may be a 2px gap between Link and the pot/wall/torch or whatever that you got pulled towards. The game is comparing Link's position with the position of the Hookshot ancilla, and when he gets with 2px of it, the pull will end. This is presumably done to avoid Link clipping much into objects while Hookshotting around, which he would certainly be able to since he's moving 4px/frame while being pulled. So how does this factor into Hookpushing? Well much like with the other data we've talked about, ancilla will store their position at an array ($0C04 for x-coordinate, $0BFA for y-coordinate), and these values are what the Hookshot is using for this little anti-clip routine. Except in normal gameplay, it's reading the values from the Hookshot's Slot, but with Hookpushing it'll be reading values set by other ancillae. Let's say we want to Hookpush through a wall going north. If possible, we want to set our Slot 0 Sword Beam lower in the room such that its coordinates don't end in the path of our Hookpush. If I Slot 0 Sword Beam against the top wall, then the Hookpush will only work by starting the Hookshot at specific coordinates. Failing coordinates result from the game reading Link as getting too close to the object we've Hookshotted to, such that if the Hookshot continued one more frame, he'd be inside the object. Except the game is looking at the coordinate of the Slot 0 Sword Beam hitting a wall rather than something the Hookshot hit.
    6. If you don't want to enter EG, you'll want your EG Check value to be 00 or you'll want to have Weak EG set. It's important to note that this watch is viewing the EG Check at Slot 0. This is very relevant for avoiding unintentional EG since you'll typically be using Slot 0 to do the Hookpush, but if you want to enter EG, you can end the push early and use a different slot's EG Check value, which won't be displayed on the HUD. Currently most setups used to Hookpush to EG do use a higher slot with that slot's counter at 00 or FF (so the Hookpush stops at that slot) but the EG Check for that slot is set above 00.

Applications

Chicken House to Witch Hut

This Push is currently done in All Dungeons MG as a way to quickly get a Green Potion. The Boomerang is also collected for help with later tricks, but it isn't involved in the setup for this trick.

Technique

  • Have your Search Index set above 09. As per usual, this can be set ahead of this room where we're doing the trick, and it saves time to do so. The videos begin with a good value set already.
  • Position Link between the barrels above and below him. Face left and place a Bomb. You'll now have a Bomb 07 in Slot 1.
  • Hold Sword out and quickly place a block, blast the block, and place another one. The Bomb you have in Slot 1 will combine with the four beams from the block blast 01 to fill up the Front Slots. Holding your sword will put sparkle ancillae 3C in Slots 7-9, and your 2nd Block 2C should be placed into Slot 9.
  • While walking towards the Boomerang chest, tap A for Dash Dust and immediately place another block. This will put 1E in Slot 4 and 2C in Slot 3. The dust before block is important because if we just place a block, it will load into Slot 4, which will delete our Slot 9 block. Additionally pay attention to where the block is placed in the videos. This isn't too precise, we just want east beam to have some travel room when we blast the block later, and if you place it just anywhere, it can interfere with the values we'll want after blasting.
  • Currently the Boomerang is collected in the category that uses this trick, but if you didn't want to collect it, that's fine as it doesn't really factor into the setup. You will want to wait for the bomb to explode before doing the next step though.
  • Now we want to blast the block and quickly slash twice. Note how in the videos, Link is moved to the left a bit before facing back right to do this sequence. We want to avoid doing these inputs on x-coords 178 or 177 and we also want Link facing right, especially when we're slashing. The block blast will fill Slots 1-4 with somaria beams 01 and the first sword beam 04 (it'll have this ID since we're beaming straight into a wall) will be put in Slot 0, where it will write 4C into that Slot's counter. If your block placement was good, then the 2nd slash you do will happen after the north, south, and west somaria beams have despawned, leaving just the east beam occupying Slot 4. This will put another sword beam 04 in Slot 2, and a sword sparkle ancilla 26 in Slot 3. This will set the counters in Slots 2 and 3 to 4C and 04 respectively.
  • We now have our values set, but if you're familiar with Hookpush mechanics at all, you'll probably notice a wrinkle: Our counter at Slot 1 is at 00. If we just use the Hookshot normally, then the Hookpush will stop early. To compensate for this, we'll want to pause when the Hookshot latches onto the chest. In the AD route, we want Lamp next, which is what the videos menu to. You can also Select Buffer, which you may be forced to do if you pause early. Because we want to skip Slot 1's data, you have a 3 frame window to pause once the Hookshot connects with the chest. If you miss, you can just retry.

Fish Room Hookpush

Hammerbridge Hookpush

Hellway Skip Hookpush

Ice Fairy Room Hookpush

Ice Entrance EG

Kakariko Shop to Ice Cave

This Hookpush is currently used in the All Dungeons MG Speedrun as a way to collect Ice Rod quickly. It also has a useful side effect of easily getting 10 Bombs.

Technique

  • First make sure your Search Index is set high. This can be done well before coming here, and in the videos, it's already set to a good value.
  • Place a Cane Block in the room. It's good to make sure that when you pop the block all four beams have plenty of room to travel before hitting a wall and despawning. You should now have object 2C in Slot 4.
  • Hold sword and then quickly pop the block, dash dust, and place another block. The beams from the Somaria block (objects 01) will occupy Slots 1-4, your dash dust (object 1E) will occupy Slot 0, and the second block you place (object 2C) will be placed in Slot 9.
  • In the current speedrun where this Hookpush is used, bombs are bought here. Although the "item get" is an ancilla, it doesn't actually factor into this setup.
  • Dash dust and place a regular block. This will put 1E in Slot 4 and then another block (2C) in Slot 3. This is important because we want another block, but if we just place one, it will be put in Slot 4. Slot 4 blocks will delete blocks in Slot 9 (very bad).
  • Pop the block and quickly slash right twice directly into the wall. Somaria beams (01) will occupy Slots 1-4. Your first slash will have a Sword Beam wall-hit (04) in Slot 0. It's essential this 1st slash is done before any of the Somaria beams despawn, otherwise it won't get put in Slot 0. Also note that we really want this to just be a Sword Beam wall-hit. If we spawn a full Sword Beam (object 0C), your Slot 0 counter will be good, but the EG Check (the red number on the ancillae HUD) could be set to non-zero, and we really don't want this. After the Sword Beam wall-hit, the counter for Slot 0 should now be 4C. We want our 2nd slash to come after two of the beams have despawned (the top and right ones). The bottom and left ones should still be there in Slots 2 and 3. A new sword beam will spawn in Slot 4, and a slash sparkle ancilla (26) will spawn in Slot 1, which will set the counter there to 04.
  • Now just dash dust and slash while walking south to the bottom right corner of the room. This will put dash dust (1E) in Slot 4, a Sword Beam (0C) in Slot 3, and a Slash Sparkle (26) in Slot 2. This should set the counter in Slot 3 to 4C and the counter in Slot 2 to 04.
  • All of our values should be set now. Check that the counters in Slots 1-3 are non-zero and that the counter in Slot 0 is 4C. If so, you were successful and you just need to Hookshot the torch from the bottom right corner of the room.

Mire Entrance EG

Skull Woods EG

If you want to go to Mothula directly after getting Fire Rod, Hookpushing into EG is the fastest way. There are a couple of different ways to set this up depending on the category/route.

Zeroing Search Index

This setup is useful in All Dungeons MG because the next segment in the run is Ice Palace, and the fastest way to Ice Palace is to Ancillae Overload Fake Flippers to swim in Lake Hylia. This method gets us into EG and sets our Search Index to 00, which is important for doing that Fake Flippers later.

Technique

  • As per usual, have the Search Index set above 09.
  • Hold < out of the door and turn back right to place a block above the doorway. When we blast the block, we want the bottom beam to have a little travel room, and if we don't place it above the doorway, it'll hit the bottom wall and despawn too quickly. This will place a block 2C in Slot 4.
  • Hold straight < until Link is roughly at the corner of the statue. We're aiming to sword beam to the right on an 11 pixel x-coordinate window: 038-043. Because we have a block in Slot 4 already, this beam will go in Slot 3, and if done on that x-coordinate window, it will set the EG Check for Slot 3 to a non-zero value. This EG Check isn't drawn on the ancillae HUD, so you just have to know that you got it. If you're on emulator and want to see this visually, you can RAM Watch the address for Slot 3's EG Check: $03A7.
  • When you beam, you want to continue holding B so that Link begins holding a sword charge. This will put sparkle ancillae 3C in Slots 7-9.
  • Before the Sword Beam has time to hit the right wall and disappear, we want to quickly blast the Somaria Block and then place a new one. This will put Somaria beams 01 in Slots 0, 1, 2, and 4 (Sword Beam should still be in Slot 3), which fills up the Front Slots. The new block we place should be placed into Slot 9.
  • Now we're gonna walk up and place the Bomb we'll use to do Skull Woods Bomb Jump. While waiting for this Bomb's fuse, we're going to overload the Front Slots and not use any Particle ancillae. This means the Search Index will fail to find a placement for a new ancilla, and it will be decremented down to 00. The Bomb 07 we place to jump goes in Slot 1. Immediately place another Bomb - this will go in Slot 0. Sword Beam 0C across the room to the right so that it has a bit of room to travel. This beam will go in Slot 4. Dash Dust 1E (goes in Slot 3) and use the Hookshot 1F (goes in Slot 2) into the left wall. All the Front Slots are now filled and when the Hookshot hits the wall, the game will want to load a Wall Hit Ancilla 06 as the Hookshot tinks the wall, except there's no room for one. The Search Index will run its search and find no particle ancillae to overwrite, and this will put the Search Index at 00.
  • Do a Bonked Bomb Jump to cross the gap. It doesn't matter if you're within 2px of the gap and can just stand and take the hit, we need a Bonk Ancilla to happen. The Dash Dust 1E from your dash will still be in Slot 4 when you start bonking, so the Bonk Ancilla 1D will go in Slot 3. This will set the counter at Slot 3 to FF, which is what we want. Pickup the Fire Rod.
  • Now just Hookshot a wall and you should enter EG. The Hookpush will get to where it's reading Slot 3 data and terminate because we have an FF counter there, and it will pull us into EG because our EG Check at Slot 3 is non-zero.

Swamp Entrance to Mothula Crystal

TR Entrance EG