What is Input Buffer?

February 10, 2025

Input buffer is simply a sequence of buttons a user can press before an action is performed.

Problem #1: A player presses the “jump” button right before landing, and nothing happens. If the player was attempting to jump over a dangerous spike, they would need to press the jump button again.

Solution #1: Register the “jump” event right before the player lands, and jump immediately when the player touches the ground.

You might think that humans are super fast at reacting to danger, but it turns out that the average human reaction time is about 250 milliseconds. To put this into perspective, the average monitor refresh rate is 60hz (or about 16 milliseconds per frame). Mathematically speaking, your eyes will see about 15 frames of gameplay before you even think about reacting to anything (that’s a long time).

Our brain compensates for this “delayed reaction” by observing patterns, and reacting to them in a precise, rhythmic sequence. These patterns are created by remember when actions occur, then executing these actions at a predictable time. If you have ever played an instrument, then you have used a form of “input buffer” to reproduce a song.

Problem #2: The player presses the jump button way too early, and accidentally jumps when they did not mean to.

Solution #2: Limit your buffer time.

Lets say you accidentally pressed the jump button while you were falling, but you change your mind. With unlimited input buffer, you would have no other choice but to jump again (even if you were falling for 10 seconds).

To solve this, we limit our buffer time to a few milliseconds. If the average human reaction time is 250 milliseconds, then we should definitely not exceed this timeframe. Personally, I think 50 milliseconds is more than enough for most players.

Finding the right amount of input buffer can take time to develop, but it can greatly improve how your game feels to players.

Stay in the loop

What’s new?

Follow me on Threads to see what I’m working on.