GAME DESIGN KING

What is input buffering? Why an early button press still works

Input buffering is a game design trick where the game remembers a button press you made a little too early, and runs it the moment you are able to act. In Street Fighter 6, Capcom set this window to 7 frames, about a tenth of a second. Your timing was fine. The game waited.

What the game is doing

Normally a game checks your button only on the frame you press it. If your character cannot act right then, the press is thrown away. A buffer changes that:

  1. You press attack while your character is still getting up.
  2. The game cannot run the move yet, so it puts the press in a small queue.
  3. A hidden frame counter starts.
  4. On the first frame the character can act, the game finds the press in the queue and fires it.
  5. If the counter runs out first, the press is dropped.

The number is the key. Capcom's Street Fighter 6 change list for the 1 December 2023 update says: "Changed the input buffer time when recovering from 4 frames to 7 frames." The game runs at 60 frames per second, so 7 frames is about 0.12 seconds. That is about a tenth of a second, not exactly a tenth.

Why it works

Players do not press buttons on the exact frame a move becomes legal. They press when they think they are ready, a little early, because waiting for the perfect frame is hard and feels bad.

Without a buffer, an early press is deleted. The character stands there, does nothing, and eats the hit. The player blames the controller or the game. It feels broken, even though the game did exactly what it was told.

With a buffer, the game agrees with the player's intent. The press was there, so the move comes out. The player feels fast and in control and never learns why.

Real games that use it

So the trick is not only for fighting games. Any game where a move can be blocked for a moment can use it.

How to use it in your game

Keep a timer that starts when the player presses. While it is above zero and the action is allowed, run the action:

const float BufferTime = 0.12f;
float bufferTimer;

void Update(float dt) {
    if (AttackPressed()) bufferTimer = BufferTime;
    else bufferTimer -= dt;

    if (bufferTimer > 0 && CanAttack()) {
        Attack();
        bufferTimer = 0;   // use the press once
    }
}

Tips:

Common mistake: a buffer so long that old presses fire when the player has moved on. If the move comes out after they changed their mind, the window is too big.

FAQ

What is input buffering?

It is when a game stores a button press for a few frames and runs it as soon as the character can act. It stops early presses from being lost.

How long is an input buffer?

It depends on the game. Street Fighter 6 uses 7 frames when recovering, about 0.12 seconds, after Capcom raised it from 4 frames. For your own game, start near 0.1 seconds and tune.

What is the difference between input buffering and coyote time?

A buffer holds a press you made too early. Coyote time allows a press you made too late. Many platformers use both.

Related: Coyote time ยท Hit stop