New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move buttons are queuing in the keyboard buffer #3948
Comments
What type of build does this happen in (SDL or ncurses) and what OS? |
It happens to me too. |
Would this happen to only occur when it's raining? I noticed this just |
@kevingranade Yes, more specifically when rain animation is displaying. Disabling the animation causes it to disappear. |
I think I know why it happens, I noticed a potential issue with input polling during animations when I was adding mouse support. It only affects ncurses. I can do a fix, if someone on Linux who compiles the game themselves (and has this problem) can test it to confirm it resolves the issue. |
I believe you and I spoke before @Falconne ... if you can link a PR for it, and then I guess i would compile with all defaults, i can test it |
The fix is relatively simple, I did it as #3796 On Wed, Oct 30, 2013 at 10:38 AM, minakitty notifications@github.comwrote:
|
The problem is that the input polling for curses in Linux works differently to the SDL and wincurses polling. In the latter two cases, queued messages are always discarded (due to SDL_PollEvent and PeekMessage looping until the event queue is empty and only caring about the last entry). The Linux curses codepath only discards queued events if you call input(). However that function can't handle timeouts, so currently when there's rain animation going on the game calls getch(), which handles timeouts but doesn't discard queued events (when using curses). That's why everything is fine till it rains. And changing timeouts in game.cpp may fix one platform but break another. The solution is to make Linux curses input always discard queued events, even when animation timeouts are involved. That way all 3 input methods work the same way (and it's the way that makes sense). I'll fix that as part of #3883... already in the process of fixing it there because I need timeouts to work properly to handle mouse move events. Also, that PR pulls in CIB's input refactor, so it makes sense to fix it there. Otherwise the work will have to be done twice and there'll be conflicts. |
If the immediate fix is at all straightforward, we need to just deal with |
Ok I should be able to come up with a small fix just for the main game loop to prevent input queuing when it's raining. Just need to have a good think about it to make sure the change is safe. Also someone like @minakitty will have to confirm the fix, as even on my Linux VM running a debug build, I don't get enough lag to really notice. |
Err, can't we get things fixed in tile mode like the (V)iew menu before the next release? These things should have the priority... |
Well the fix is trivial anyway, if it works. I just submitted a PR, if someone can test it. |
Please don't lobby in unrelated issues for changes you want.
|
If I'm in a high computer lag situation or moving a long distance, I have a tendency to hold down the move button to go from place to place. With the recent patches, it's now buffering every single move at the keyboard repeat rate instead of checking for the move at completion of the last move. This means that when i let go of the arrow, I could still move 10, 20, even 50 tiles away from where I want to be. Very annoying and has gotten me in trouble with hostile mobs.
The text was updated successfully, but these errors were encountered: