Ancilla Misslotting

From ALttP Speedrunning Wiki
Revision as of 15:30, 27 August 2021 by Kan (talk | contribs) (Created page with "== Misslotting == A major part of misslotting is Ancilla Overload. See that page for more information on that specifically. This page assumes you understand overload. ===...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Misslotting

A major part of misslotting is Ancilla Overload. See that page for more information on that specifically. This page assumes you understand overload.

Explanation

The game was coded to have certain items in certain slots. Bombs for example, need to be in slot 0 or slot 1. Most other items from Link's inventory were only coded to be in slot 0, 1, 2, 3 or 4 (which we'll call the Front Slots). The Back Slots (slots 5-9) are typically reserved for less "significant" ancillae, such as the sparkle effects that appear while Link is holding a sword charge. However, there are ways to force an item that would normally spawn in a Front Slot into a Back Slot. Since this was unintended from developers (and it doesn't really happen in normal gameplay), unintended things happen.

We call the concept of putting an item into a slot it was not coded to be in mis-slotting (or misslotting).

Broadly, the way this works is to do the following:

  • Set the search index to a value at least one digit above the value of the Slot you want to Misslot to (ex. if you want to Misslot an ancilla in Slot 9, you want the search index above 09)
  • Occupy slots 0-4.
  • Occupy the slot you want to misslot to with a Particle ancillae. Commonly, this will be slot 9.
  • Load the ancilla you wish to misslot. When you do this, the game will see slots 0-4 occupied. It will then reference the search index to look for an available slot to spawn the object in. It will see a replaceable ancilla in slot 9 and will load the object there, giving a successful misslot.

Manipulating the Search Index to High Values

If you read the section on the Search Index, you probably noticed that neither of the two intended routines it's used in lend themselves to setting the Search Index high. This is important because when we fill the Front Slots and use the ancilla we want to Misslot, we want the game's secondary search routine to be looking through the Back Slots. So how do we set it to a high value? By far the most common way is to use a Slot 2 Lamp.

The Lamp sets values to an array at $03C5, but for some reason, this array only has two positions: one for Slot 3 Lamp and one for Slot 4 Lamp. If you go one under this with a Lamp in Slot 2, the Lamp starts setting values to $03C4 -- and that's the Search Index! Since the Lamp's quota is 3 (the game allows 3 Lamp flames on-screen at the same time), you can quickly use the Lamp 3 times, and you'll put a Lamp flame in Slot 2. This will put a specific value into $03C4 depending on which direction Link is facing when the Slot 2 Lamp happens:

  • If you Lamp facing North, the Search Index will be 0D (or 13 in decimal)
  • If you Lamp facing West, the Search Index will be 10 (or 16 in decimal)
  • If you Lamp facing South, the Search Index will be 0A (or 10 in decimal)
  • If you Lamp facing East, the Search Index will be 07

East facing Slot 2 Lamps aren't normally used since 07 isn't a high enough value for most of the useful Misslotting in Speedruns. We typically want to Misslot ancilla into Slots 8 or 9, so we can just use one of the other three options to accomplish this.

Effects

The consequences of Misslotting are generally going to be the result of the arrays that Front Slot Ancillae use as part of their routines not having enough elements for Back Slot Ancillae. This means that when Front Slot Ancillae are loaded into the Back Slot, the memory addresses they modify as part of their routine behavior will be the 'wrong' addresses.

For example: memory address $0394,X (X being the Slot of a Somaria Block) is a variable that figures into the routine of placing Somaria Blocks. When Link places one, the value at this address jumps to 0B before decrementing down to 00. So when you go to place a Somaria Block with no other ancillae on-screen, it will load in Slot 4 by default. The game will add 4 to our base address to get $0398 and modify the values there.

Meanwhile, the Hookshot uses memory address $039D to determine which Slot's duration counter to use while the Hookshot is pulling Link. When Link uses the Hookshot, it will extend and a counter at the Hookshot's Slot will increment every frame until it latches onto something. The game then puts what Slot the Hookshot is in at $039D and the pull starts. The game will now decrement that same counter it was using before as Link is pulled to whatever object he's Hookshotted, and the game knows to use this specific counter because of the value stored at $039D.

But what if we place a Somaria Block in Slot 9? Well now when the game adds 09 to $0394, we get $039D. Well that's the same address the Hookshot is using to see what values should determine how long to pull Link for! This is the basis for how Hookpush works, but all Misslot effects are the result of this kind of behavior.

There's a tutorial on how misslotting works here: https://milde.no/public/alttp/misslots/.

See Consistent setups for misslotting to slot 9.

Weirdshot

Main article: Weirdshot

Weirdshot (sometimes called Hookclip) is the name of a similar glitch in Ocarina of Time speedruns, copied over to ALttP.

The hookshot can pass through one-tile blocks.

What happens is that the hookshot object is traveling in EG for 3 out of 4 frames. There is another variant of this where the hookshot is only traveling in EG. If you hit something in the other layer, it will drag Link to it and also change Link's layer.

Preliminary technical explanation can be found here https://pastebin.com/ua73VDi1, but it's not complete.

Hookpush (Somaria misslot)

Main article: Hookpush

The reason this works is very technical, but basically, the "hookshot dragging Link to an object" code is glitched out and Link is dragged for a longer duration and often a different direction. This code does not check any collision at all, so Link can clip through walls. You can also use this to get Link into EG.

We can completely control the direction, the duration, and whether or not Link should be put into a different layer, by changing the setups.

Tutorial on how to do this consistently: https://milde.no/public/alttp/misslots/

Pastebin: https://pastebin.com/KsRGZNKu.

Hookpush (Hook misslot)

Same application as above, but done by misslotting hookshots instead.

Technical explanation: https://pastebin.com/Z1FanJwK

Overworld Conveyor

By transitioning right after dropping either a Bomb or Somaria (misslotted in slot 9) from taking damage, you can get the conveyor effect while in the overworld. You can get this effect either upwards or downwards depending on the setup.

When this effect is active, you can nudge against any slope and automatically clip from one side of the overworld map to the other, without anything colliding with Link. You can even use your sword and some items while in this noclip mode, while other actions like dashing or moving will let Link collide with things again.

Another application of this is transitioning into an underworld entrance. This gives the same effect as mirroring while on a conveyor belt, except the setup is outside the entrance and can easily be done for all entrances now.

Note that Somaria is not needed for this, it could be done with holding a bomb instead.

Fanfare Skip

Main article: Fanfare Skip

Fanfare Skip is a glitch that can be done while collecting Pendants that will skip most of the cutscene that typically follows grabbing them. For it to work, the following conditions must be met:

  • The pendant is collected with ancilla slots 0-4 filled.
  • A somaria block is misslotted 8 slots higher than the slot the pendant is in. Typically this is done by ensuring the pendant spawns in slot 1 (it will normally try to spawn in slot 3), and then misslotting a somaria block to slot 9.

For more info and specific setups, see the main page: Fanfare Skip

Murderbomb

By putting a bomb into slot 9, we can reset the explosion duration timer indefinitely by simply using a hookshot or producing sword beams.

Overworld Ancilla Persistence Through Transitions

By misslotting a bomb (or anything else), it will still be active after Link transitions.

Example of Spooky Bomb

A silly application of this, but it's the only known one that does anything "useful". File

Arbitrary misslotting

Misslotting an ancilla into a slot that doesn't even exist (slot 10+). Basically, you end up writing values to arbitrary memory at will.

This is the really broken stuff.

Some technical information here: https://pastebin.com/NnRnX4X5