Input Buffering

Input buffering is a common practice in many older games. The term refers to the practice of holding a button before it is needed to be pressed, so that on the first frame that input is checked, the button press goes through, avoiding the need for frame-perfect button presses. StarTropics is unique in that nearly every input in the game can, and often should, be buffered. As such, buffering is the arguably the most important mechanic to understand and use everywhere possible, and in many cases, learning to buffer more effectively will lead to faster runs more than any other single tactic. While each of the cases below show a different use case, the underlying mechanic is the same.

The Buffering Mechanic
Input buffering in StarTropics relies on the interplay of two concepts: blocking timers, and fresh/stale button presses. Below will be an overview of each of these concepts, with a more in depth coverage at the bottom of the page.

Timers
At its heart, StarTropics is a game that runs on timers. These timers can be grouped into two groups: Blocking and Non-Blocking. Non-Blocking timers, such as the global timer, dictate things like enemy spawns, the RNG, and other functions not related to input from the player, and are not relevant to the following discussion. Blocking timers, such as those used to dictate movement, or play animations, stop the game from accepting some or all input until they reach a particular state. The frame after a button is pressed, the game checks if a blocking timer is active. If it is, the input is ignored, but the state of the button press is not changed. The first frame the blocking timer runs out, any fresh button press will be accepted by the game as the next input.

Button Press State
Simply, when a button is pressed, the game keeps track of whether it has been held since the action it performs. For example, if you start pressing A for a jump, the game will check if a blocking timer is active that blocks the jump action. If so, holding A will have the game start Mike jumping on the first available frame. Once the game starts Mike jumping, the A press is marked as stale and ignored until it has been released for at least 2 frames.