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:
- You press attack while your character is still getting up.
- The game cannot run the move yet, so it puts the press in a small queue.
- A hidden frame counter starts.
- On the first frame the character can act, the game finds the press in the queue and fires it.
- 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
- Street Fighter 6. Capcom lists the change on the official Battle Change List for 12.01.2023. The line reads "Changed the input buffer time when recovering from 4 frames to 7 frames." That is a developer widening the window on purpose.
- Celeste. Maddy Thorson wrote about the same idea for jumps in Celeste & Forgiveness: "If you press and hold the jump button a short time before landing, you will jump on the exact frame that you land." This is often called jump buffering.
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:
- Start around 0.1 seconds (6 to 7 frames at 60 fps). Tune by feel, not by a rule.
- Use the press once. Clear the timer when the action fires, or one press will trigger two moves.
- Count in time, not frames, so it feels the same at any frame rate.
- Do not buffer everything. Buffer actions where an early press clearly means "do it next". Do not buffer a press that would surprise the player later.
- Pair it with coyote time. Coyote time forgives a late jump. A buffer forgives an early one.
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