-
Notifications
You must be signed in to change notification settings - Fork 132
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
Introduce fast mouse polling for lower lag interpolation #1194
Conversation
Co-authored-by: ceski <56656010+ceski-1@users.noreply.github.com>
Co-authored-by: ceski <56656010+ceski-1@users.noreply.github.com>
Nice starting point, I tested it briefly. Some issues I noticed:
I'll try to give more feedback later, I know it's WIP right now. |
I can repeat this. It appears to be fixed on my end by moving the Diffdiff --git a/src/i_video.c b/src/i_video.c
index ab3c7bc9..b5f9f6f1 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -544,9 +544,6 @@ void I_StartDisplay(void) // [crispy]
{
SDL_PumpEvents();
- // [AM] Figure out how far into the current tic we're in as a fixed_t.
- fractionaltic = I_GetFracRealTime();
-
if (usemouse && !nomouse && window_focused)
{
I_ReadMouseUncapped();
@@ -941,6 +938,9 @@ void I_FinishUpdate (void)
}
}
}
+ // [AM] Figure out how far into the current tic we're in as a fixed_t.
+ fractionaltic = I_GetFracRealTime();
+
}
// Restore background and undo the disk indicator, if it was drawn.
Does this fix the "pops" for you? |
That seems to work fine, or like Woof: Diff (Alt)diff --git a/src/i_video.c b/src/i_video.c
index ab3c7bc9..328e6b1e 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -542,11 +542,11 @@ void I_StartTic (void)
void I_StartDisplay(void) // [crispy]
{
- SDL_PumpEvents();
-
// [AM] Figure out how far into the current tic we're in as a fixed_t.
fractionaltic = I_GetFracRealTime();
+ SDL_PumpEvents();
+
if (usemouse && !nomouse && window_focused)
{
I_ReadMouseUncapped(); |
Fixes random "pops" when turning using keyboard. Co-authored-by: ceski <56656010+ceski-1@users.noreply.github.com>
When running uncapped, track last gametic's worth (28 ms) of mouse movement to determine if acceleration should be applied.
* Apply mouse acceleration in g_game. * Expand carry_t to include side and vertical movement. Co-authored-by: ceski <56656010+ceski-1@users.noreply.github.com>
Co-authored-by: ceski <56656010+ceski-1@users.noreply.github.com>
Co-authored-by: ceski <56656010+ceski-1@users.noreply.github.com>
Co-authored-by: ceski <56656010+ceski-1@users.noreply.github.com>
Finally, tried it out on both 60 and 120 Hz monitors. It's a God's job. The difference is notable even on 120 Hz! |
// Don't use localview if the player just teleported. | ||
!player->mo->reactiontime && | ||
// Don't use localview if a demo is playing. | ||
!demoplayback && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small thought: probably worth to check for !demorecording
here as well. At the moment, while demo recording there is a small notable jiterring between frames while camera rotation, most likely brought by "short tics".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review Julia. I noticed this issue too. I have a fix for the jittering on my local pc that I will clean up and push when I return home this weekend.
@fabiangreffrath Kindly requesting a review of this PR for inclusion in the next release. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, this change is massive! I must have somehow missed that it was ready for review, sorry. Looks good to me, thank you. I cannot review every single line change, but I trust you enough to judge the change set just from the looks of it. 😉
Just noticed this was a non-squashed merge. Should I revert and re-merge with squash? |
Na, it's okay. Thanks! |
This is my humble attempt to port to Crispy the fine work that @ceski-1 did for Woof. It's not ready yet but I thought it might be prudent to go ahead and get it out there for early review and testing.
EDIT: Calling this one complete. We are still missing vertical mouse and gamepad, but those can come later. The vertical mouse implementation in particular needs some careful study and refactoring across the four games.
This is not as sophisticated as the current implementation in Woof! but I think it stands on its own as a solid improvement to mousefeel for typical KB + M players.