Frame rule

From ALttP Speedrunning Wiki
Revision as of 15:07, 7 June 2019 by Kan (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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.