Difference between revisions of "Ancilla glitches"

From ALttP Speedrunning Wiki
Jump to: navigation, search
(Slots)
 
(20 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Summary ==
 
 
 
This page explains glitches that has to do with ancilla.
 
This page explains glitches that has to do with ancilla.
  
For now, go to [[Spooky Action at a Distance]] for the also-ancilla-related glitch that was found in 2018. This page is a summary of the glitches found mid 2019.
+
For now, go to for the also-ancilla-related glitch that was found in 2018. This page is a summary of the glitches found mid 2019.
  
 
In this game, we use the word ''ancilla'' (plural: ''ancillae'') for objects that Link produces/uses. Some examples are Boomerang, Bombs, Somaria block/spark, Sword spark, and Boots dust.
 
In this game, we use the word ''ancilla'' (plural: ''ancillae'') for objects that Link produces/uses. Some examples are Boomerang, Bombs, Somaria block/spark, Sword spark, and Boots dust.
  
 
Enemies, Heart drops, etc... on the other hand, are sprites.
 
Enemies, Heart drops, etc... on the other hand, are sprites.
 +
 +
== Types ==
 +
Ancillae are a broad category, so this page only covers the broad overview.
 +
 +
Specific types of ancilla-related glitches:
 +
* [[Fake Flippers]]
 +
* [[Spooky Action at a Distance]]
 +
* [[Ancilla Overload]]
 +
* [[Ancilla Misslotting]]
  
 
== History ==
 
== History ==
Line 15: Line 22:
 
Someone mentioned it on Discord after 4-5 months had passed, and the videos were linked into Discord. We started looking more in depth on what was happening, and this investigation produced a few new glitches. All of them having something to do with Ancillae.
 
Someone mentioned it on Discord after 4-5 months had passed, and the videos were linked into Discord. We started looking more in depth on what was happening, and this investigation produced a few new glitches. All of them having something to do with Ancillae.
  
== Some terminology ==
+
== Terminology ==
  
=== Slots ===
+
=== Ancillae & Slots ===
  
When you try to put down a bomb, the game looks for an empty ''slot'' in the game's memory. There's 10 slots for ancillae, which means you can only have 10 ancillae on the screen at any point in time.
+
An ancilla is "A self-acting entity whose routines and existence are established and controlled from the 10 item array at <code>$0C4A</code>." Broadly speaking, these are going to be objects that are spawned by Link's items. Bombs, arrows, the boomerang, fire and ice rod shots, the dust Link kicks up while dashing, etc. -- These are all ancillae.
  
For practical reasons, we've named them slot 0 through slot 9.
+
There are 10 positions in the game's memory for ancillae, and we call these Slots. For practical reasons, we name/number them Slots 0-9.
  
'''Front and Back Slots'''
+
===Front and Back Slots===
  
 
Ancillae won't just choose whichever open slots to occupy. They can be broadly classified into Front Slot Ancillae (these occupy the first 5 slots: Slots 0-4) and Back Slot Ancillae (these occupy the final 5 slots: Slots 5-9). Front Slot Ancillae are generally significant objects in gameplay. Ancillae that load here will be things like Bombs, Arrows, Somaria Blocks, Sword Beams, Dash Dust, etc. Back Slot Ancillae are less significant to gameplay, often being objects that just add a bit of visual flare. Back Slot Ancillae include things like the sparkles that appear on Link's sword when he's charging a spin attack or the sparkles that appear on a shot from the Ice Rod.
 
Ancillae won't just choose whichever open slots to occupy. They can be broadly classified into Front Slot Ancillae (these occupy the first 5 slots: Slots 0-4) and Back Slot Ancillae (these occupy the final 5 slots: Slots 5-9). Front Slot Ancillae are generally significant objects in gameplay. Ancillae that load here will be things like Bombs, Arrows, Somaria Blocks, Sword Beams, Dash Dust, etc. Back Slot Ancillae are less significant to gameplay, often being objects that just add a bit of visual flare. Back Slot Ancillae include things like the sparkles that appear on Link's sword when he's charging a spin attack or the sparkles that appear on a shot from the Ice Rod.
  
'''Particle Ancillae'''
+
===Particle Ancillae===
 
 
Arrows that are stuck in a wall, the sparkles that appear with an Ice Rod shot, and the sparkles that appear with a Silver Arrow, the Red Boomerang, or when Link is charging his sword are all what we call Particle Ancillae. A key attribute of Particles that differentiates them from other ancillae is that they can be replaced. This is an important factor in Misslotting, as we'll see below.
 
 
 
'''Search Index'''
 
 
 
The Search Index is a value in the game that determines where a secondary search begins for placing an object should all its normal Slots be filled. Note that this doesn't mean every Slot has to be filled. If you use a Front Slot ancilla with Slots 0-4 filled (but not all of the Back Slots), the game will then use the Search Index in hopes of finding a particle ancilla it can kick out. Lucky for us, this value can be manipulated. If we want the search to fail, then it can be good to have a low value set. This is used for ancillae overload glitches. If we want to misslot, we can set this value high so that the game searches through the Back Slots when the Front Slots are filled.
 
 
 
The primary way to manipulate the Search Index to high values in speedruns is to get Lamp in Slot 2. This is as easy as just quickly using the Lamp three times, since the first Lamp flame will use Slot 4, the second will use Slot 3, and the third will use Slot 2. The exact value you get from this depends on which direction Link is facing when you do it:
 
* If you face North, the search index will be <code>0D</code> (or 13 in decimal)
 
* If you face West, the search index will be <code>10</code>
 
* If you face South, the search index will be <code>0A</code> (or 11 in decimal)
 
* If you face East, the search index will be <code>07</code>
 
 
 
=== Misslotting ===
 
 
 
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 <code>09</code>)
 
* 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.
 
 
 
==== Effects ====
 
 
 
The consequences of Misslotting are generally going to be the result of the variables that Front Slot Ancillae use being unavailable 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 <code>$0394,X</code> (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 <code>0B</code> before decrementing down to <code>00</code>. 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 <code>$0398</code> and modify the values there.
 
 
 
Meanwhile, the Hookshot uses memory address <code>$039D</code> 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 <code>$039D</code> 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 <code>$039D</code>.
 
 
 
But what if we place a Somaria Block in Slot 9? Well now when the game adds <code>09</code> to <code>$0394</code>, we get <code>$039D</code>. 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]].
 
 
 
== Ancilla overload ==
 
These ones don't use misslotting. Most ancillae spawn in slot 0-4.
 
 
 
=== Heart Despawn Glitch ===
 
 
 
A method to despawn heart containers, making our Low% runs lower. This was decided to be a minor glitch.
 
 
 
{{VideoBox
 
| title = Example of Heart Despawn Glitch
 
| file= File:Low_hpskip_armos.mp4
 
| width = 340
 
}}
 
 
 
This one does not use misslotting, but was a random discovery during our investigations into misslotting. It works by filling up ancilla slots in clever ways that only despawn the heart container, but not the pendant/crystal that follows (else you would softlock on most bosses where doors are closed and menues not possible).
 
 
 
Pastebins: https://pastebin.com/aNApJZLz https://pastebin.com/BeBFwZX6
 
 
 
=== Misslotting ===
 
Misslotting an ancilla into an ''ancilla slot'' it was not coded to be in (slot 5-9).
 
 
 
==== Hookclip ====
 
 
 
''Weirdshot'' is the name of a [http://zelda.speedruns.com/mm/tech/weirdshot similar glitch] in Ocarina of Time speedruns, copied over to ALttP.
 
 
 
The hookshot can pass through one-tile blocks.
 
 
 
{{VideoBox
 
| title = Example of Weirdshot
 
| file= File:Gthookclip.mp4
 
| width = 340
 
}}
 
 
 
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|Hookpush}}
 
 
 
{{VideoBox
 
| title = Example of Hookpush
 
| file= File:Wonkaspike.mp4
 
| width = 340
 
}}
 
 
 
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.
 
 
 
{{VideoBox
 
| title = Example of Hookpush
 
| file= File:Hookpush hookmisslot.mp4
 
| width = 340
 
}}
 
 
 
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.
 
 
 
{{VideoBox
 
| title = Example of Overworld conveyor effect
 
| file= File:OwConveyorEffect.mp4
 
| width = 340
 
}}
 
 
 
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.
 
 
 
{{VideoBox
 
| title = OW Conveyor into UW OoB clips & EG
 
| file= File:ConveyorOobFromOw.mp4
 
| width = 340
 
}}
 
 
 
Note that Somaria is not needed for this, it could be done with holding a bomb instead.
 
 
 
==== Fanfare Skip ====
 
{{Main|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 ====
 
 
 
{{VideoBox
 
| title = Example of Murderbomb
 
| file= File:Murderbomb.mp4
 
| width = 340
 
}}
 
 
 
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.
 
 
 
{{VideoBox
 
| title = Example of Spooky Bomb
 
| file= File:SpookyBomb.mp4
 
| width = 340
 
| description = A silly application of this, but it's the only known one that does anything "useful".
 
}}
 
 
 
=== 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.
 
 
 
{{VideoBox
 
| title = Arbitrary Code Execution
 
| file= File:Ace.mp4
 
| width = 340
 
}}
 
  
{{VideoBox
+
Arrows that are stuck in a wall, the sparkles that appear with an Ice Rod shot, and the sparkles that appear with a Silver Arrow, the Red Boomerang, or when Link is charging his sword are all what we call Particle Ancillae. A key attribute of Particles that differentiates them from other ancillae is that they can be replaced. This is an important factor in ancillae glitches, as we'll see below.
| title = Crystals out of nowhere
 
| file= File:Freecrystals.mp4
 
| width = 340
 
}}
 
  
Some technical information here: https://pastebin.com/NnRnX4X5
+
===Search Index===
  
== Categorization of ancilla related glitches ==
+
The Search Index is what we call value at <code>$03C4</code> in the game's memory. It determines where to begin a secondary search if the game can't find an open Slot to place a new ancilla. The exact logic that happens with the Search Index is important, so let's look at the steps:
 +
# You go to use a Front Slot ancilla, but Slots 0-4 are already filled. What does the game do now?
 +
# Decrement the value of the Search Index by 1.
 +
# If the Search Index is now negative, set it to the quota of the ancilla we're trying to place, minus one (ie. we can have two bombs on screen at the same time, meaning the quota for bombs is 2 and also meaning that if this step was run while we're trying to place a bomb, the resulting Search Index value would be <code>01</code>)
 +
# Now the game looks at the Ancilla Slot corresponding to whatever the Search Index value is. It will search from this Slot down to Slot 0 looking for Particle ancillae it can overwrite with the ancilla we're trying to use. If it finds one, it will replace it, and the Search Index will be set to the value of whichever Slot this replacement was done at. If not, the new ancilla won't be loaded in and the Search Index will now be decremented all the way to <code>00</code>.
  
* Uninitialized altitude
+
To look at an example:
** Spooky Action Glitch
+
# We try to place a Somaria block, but Slots 0-4 are filled with [bomb, bomb, wall arrow, boomerang, dash dust]. Our Search Index is at <code>04</code>
* Overloading slots
+
# The Search Index is decremented to <code>03</code>.
** Despawn
+
# The Search Index is not negative, so this step isn't used.
*** Splashless fake flippers
+
# Our Search Index is <code>03</code>, so the game looks at Slot 3, where there's a Boomerang. That's not a particle, so the search moves down the list. At Slot 2 is a wall arrow. Hey that's a particle ancilla. The game will despawn that and load our Somaria block in its place. Our Search Index is now <code>02</code>.
*** Heart Delete
 
** Misslotted Ancilla
 
*** Slot 5-9 misslot
 
*** Weirdshot
 
**** Weirdshot (Alternating Layer)
 
**** Weirdshot (Opposite Layer)
 
*** Hookpush
 
*** Murder Bomb
 
*** OW Conveyor
 
** Slot 10+ misslot
 
*** ACE
 
*** etc. Anything can be done in theory.
 
  
Some glitches in different "categories" use similar methods for its exploit.
+
In addition to checking for available Slots for ancillae, there is another routine the Search Index is involved in, and it has to do with Wall Arrows. If the player tries to create more than 3 wall arrows on-screen, the Search Index will be set to <code>04</code>, and the index will decrement as the game looks for Wall Arrows to replace with the new Wall Arrow.

Latest revision as of 15:34, 27 August 2021

This page explains glitches that has to do with ancilla.

For now, go to for the also-ancilla-related glitch that was found in 2018. This page is a summary of the glitches found mid 2019.

In this game, we use the word ancilla (plural: ancillae) for objects that Link produces/uses. Some examples are Boomerang, Bombs, Somaria block/spark, Sword spark, and Boots dust.

Enemies, Heart drops, etc... on the other hand, are sprites.

Types

Ancillae are a broad category, so this page only covers the broad overview.

Specific types of ancilla-related glitches:

History

Yuzuhara found that using items in certain combinations created weird effects, like getting two somaria blocks/bombs, having bombs explode indefinitely etc. He did not understand how it worked, and it was mostly not known about in the Discord at the time, but he posted everything on his twitter account here

Someone mentioned it on Discord after 4-5 months had passed, and the videos were linked into Discord. We started looking more in depth on what was happening, and this investigation produced a few new glitches. All of them having something to do with Ancillae.

Terminology

Ancillae & Slots

An ancilla is "A self-acting entity whose routines and existence are established and controlled from the 10 item array at $0C4A." Broadly speaking, these are going to be objects that are spawned by Link's items. Bombs, arrows, the boomerang, fire and ice rod shots, the dust Link kicks up while dashing, etc. -- These are all ancillae.

There are 10 positions in the game's memory for ancillae, and we call these Slots. For practical reasons, we name/number them Slots 0-9.

Front and Back Slots

Ancillae won't just choose whichever open slots to occupy. They can be broadly classified into Front Slot Ancillae (these occupy the first 5 slots: Slots 0-4) and Back Slot Ancillae (these occupy the final 5 slots: Slots 5-9). Front Slot Ancillae are generally significant objects in gameplay. Ancillae that load here will be things like Bombs, Arrows, Somaria Blocks, Sword Beams, Dash Dust, etc. Back Slot Ancillae are less significant to gameplay, often being objects that just add a bit of visual flare. Back Slot Ancillae include things like the sparkles that appear on Link's sword when he's charging a spin attack or the sparkles that appear on a shot from the Ice Rod.

Particle Ancillae

Arrows that are stuck in a wall, the sparkles that appear with an Ice Rod shot, and the sparkles that appear with a Silver Arrow, the Red Boomerang, or when Link is charging his sword are all what we call Particle Ancillae. A key attribute of Particles that differentiates them from other ancillae is that they can be replaced. This is an important factor in ancillae glitches, as we'll see below.

Search Index

The Search Index is what we call value at $03C4 in the game's memory. It determines where to begin a secondary search if the game can't find an open Slot to place a new ancilla. The exact logic that happens with the Search Index is important, so let's look at the steps:

  1. You go to use a Front Slot ancilla, but Slots 0-4 are already filled. What does the game do now?
  2. Decrement the value of the Search Index by 1.
  3. If the Search Index is now negative, set it to the quota of the ancilla we're trying to place, minus one (ie. we can have two bombs on screen at the same time, meaning the quota for bombs is 2 and also meaning that if this step was run while we're trying to place a bomb, the resulting Search Index value would be 01)
  4. Now the game looks at the Ancilla Slot corresponding to whatever the Search Index value is. It will search from this Slot down to Slot 0 looking for Particle ancillae it can overwrite with the ancilla we're trying to use. If it finds one, it will replace it, and the Search Index will be set to the value of whichever Slot this replacement was done at. If not, the new ancilla won't be loaded in and the Search Index will now be decremented all the way to 00.

To look at an example:

  1. We try to place a Somaria block, but Slots 0-4 are filled with [bomb, bomb, wall arrow, boomerang, dash dust]. Our Search Index is at 04
  2. The Search Index is decremented to 03.
  3. The Search Index is not negative, so this step isn't used.
  4. Our Search Index is 03, so the game looks at Slot 3, where there's a Boomerang. That's not a particle, so the search moves down the list. At Slot 2 is a wall arrow. Hey that's a particle ancilla. The game will despawn that and load our Somaria block in its place. Our Search Index is now 02.

In addition to checking for available Slots for ancillae, there is another routine the Search Index is involved in, and it has to do with Wall Arrows. If the player tries to create more than 3 wall arrows on-screen, the Search Index will be set to 04, and the index will decrement as the game looks for Wall Arrows to replace with the new Wall Arrow.