Do games deal ensure all gamepad or keyboard inputs are processed? Input devices are polled anywhere from 125 to potentially 1000 times a second, but games often update 30 to 60 times a second. Say a gamepad sends button data 120 times a second, and the game runs at 30 fps. A player could tap and release a button in between two game frames. Does the game ignore the button in that case? Does it queue it up? If so, what happens when the queued up buttons conflict (i.e. jump, then crouch)?

The answer to your question is "The game generally swallows extra inputs", because that's what makes the most sense. Inputs are parsed by checking controller state from frame to frame. A "button pressed" event is going from "button up" state on frame N to "button down" on frame N+1. A "button held" state is going from "button down" on frame N to "button down" on frame N+1. And "button released" is "button down" on frame N to "button up" on frame N+1. This is how it goes and this is how it has to be because we're building games for humans with human reaction times and human cognitive processing, rather than machines. For competing inputs, we choose a hierarchy of what trumps what. Fighting games, for example, usually have the fierce punch trump the light punch when pressed simultaneously.

Imagine that we did process all those button presses. What could we feasibly do to differentiate them to a human being who takes 200 milliseconds to process that they pressed a specific button and to prime themselves for a visual reaction to that button? There's no visual representation that humans could comprehend that could meaningfully differentiate 120 button presses in a second from 119. In game dev, we're typically not trying to reward or encourage a large number of button presses within a given time frame. We're trying to encourage player execution, which means pressing with intention and timing windows in order to get the results the player wants from the system. This is a much easier and accepted showcase of skill among humans than who can press buttons the fastest.

[Join us on Discord] and/or [Support us on Patreon]

Got a burning question you want answered?

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *