ThoNohT / NohBoard

A Keyboard Visualizer
GNU General Public License v2.0
976 stars 168 forks source link

Input delay? #165

Closed Koblasco closed 2 years ago

Koblasco commented 2 years ago

I just downloaded Nohboard and decided to test how accurate it is by recording Obscure at 120 fps. One of the characters has a [SPACEBAR] prompt as soon as you hold the aim button (shift key) so this prompt and the shift key on Nohboard should appear in the same frame but nohboard registers inputs 2, 4 or 6 frames later than expected seemingly at random (although it is sometimes correctly [synchronized).

Koblasco commented 2 years ago

Tested on Obscure 2 also. Nobboard definitely shows inputs with a delay.

ThoNohT commented 2 years ago

By default NohBoard runs at 30fps, so that would explain a delay. You could try to increase the frame rate by opening NohBoard.json and setting UdpateInterval to 8, which would make it run at 125fps. Do note that NohBoard is not optimized like most games are, running it at this high a frame rate could cause performance issues, but you can always experiment with what is acceptable.

Koblasco commented 2 years ago

I see. It was my mistake to not check the json first. Setting the update interval to 8 increased the amount of correct inputs and lowered the delay of incorrect ones to 2 frames. I also set it to 1 but there's still a delay of 1-2 frames every now and then. A bit unfortunate as I wanted to check frame perfect inputs in my recordings for speedrunning purposes. Other than that, it works perfectly fine. Thanks for the quick response.

ThoNohT commented 2 years ago

I think if you really want this microsecond accurate response, NohBoard is never going to be able to handle it. It depends on the windows event loop for the key events, and is not written with absolute performance in mind, while I guess the game directly reads the input stream from the keyboard. I hope the 1-2 frames delay is usable. I'm closing this now, since there really isn't anything else that can be done about it.