Difference between revisions of "Frame rule"

From ALttP Speedrunning Wiki
Jump to: navigation, search
 
(One intermediate revision by the same user not shown)
Line 7: Line 7:
  
 
== Staggered frame rules ==
 
== Staggered frame rules ==
Staggered frame rules are ones which follow the game's main frame counter and another value. Almost sprite interaction to damage Link and every ancilla interaction with sprites is on a staggered frame rule. In these cases, the value used is the index of the sprite or ancilla. First, the index is exclusive OR'd with the main frame counter. If the bottom 2 bits of the new value are both 0, then the interaction check proceeds.
+
Staggered frame rules are ones which follow the game's main frame counter and another value. Almost all sprite interactions to damage Link and all ancilla interaction with sprites are on a staggered frame rule. In these cases, the secondary value used is the index of the sprite or ancilla. First, the index is exclusive OR'd with the main frame counter. If the bottom 2 bits of the new value are both 0, then the interaction check proceeds.
  
 
This table shows how sprite slot determines the offset for the most common frame rule—interacting with Link.
 
This table shows how sprite slot determines the offset for the most common frame rule—interacting with Link.
Line 20: Line 20:
 
|-
 
|-
 
! rowspan="4" style="vertical-align: middle; border-top: none;" | Index
 
! rowspan="4" style="vertical-align: middle; border-top: none;" | Index
| 0 || 4 || 8 || 12
+
| 0 || 1 || 2 || 3
 
|-
 
|-
| 1 || 5 || 9 || 13
+
| 4 || 5 || 6 || 7
 
|-
 
|-
| 2 || 6 || 10 || 14
+
| 8 || 9 || 10 || 11
 
|-
 
|-
| 3 || 7 || 11 || 15
+
| 12 || 13 || 14 || 15
 
|}
 
|}
  
 
== Personal frame rules ==
 
== Personal frame rules ==
 
Personal frame rules are one which follow a timer exclusive to whatever is performing the action. An example of a personal frame rule is with [[buzzblob]]s, which dance around when buzzing based on their buzzing timer.
 
Personal frame rules are one which follow a timer exclusive to whatever is performing the action. An example of a personal frame rule is with [[buzzblob]]s, which dance around when buzzing based on their buzzing timer.

Latest revision as of 15:07, 7 June 2019

A frame rule is a set of logic used to constrain the number of actions to a specific period of recurrence. Frame rules come in 3 main classes: strict, staggered, and personal.

Strict frame rules

Strict frame rules are ones which follow the game's main frame counter exactly. Actions that use the same strict frame rule will always be able to sync up, if they are to be performed together.

An example of a strict frame rule is gibdo turning, which always happens every 8 frames, when the main frame counter is a multiple of 8.

Staggered frame rules

Staggered frame rules are ones which follow the game's main frame counter and another value. Almost all sprite interactions to damage Link and all ancilla interaction with sprites are on a staggered frame rule. In these cases, the secondary value used is the index of the sprite or ancilla. First, the index is exclusive OR'd with the main frame counter. If the bottom 2 bits of the new value are both 0, then the interaction check proceeds.

This table shows how sprite slot determines the offset for the most common frame rule—interacting with Link.

Shared frame rules
4n+0 4n+1 4n+2 4n+3
Index 0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15

Personal frame rules

Personal frame rules are one which follow a timer exclusive to whatever is performing the action. An example of a personal frame rule is with buzzblobs, which dance around when buzzing based on their buzzing timer.