Skip to content
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

Keyboard and mouse rotation breaks with frame interpolation #4

Open
GooberMan opened this issue Oct 30, 2022 · 0 comments
Open

Keyboard and mouse rotation breaks with frame interpolation #4

GooberMan opened this issue Oct 30, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@GooberMan
Copy link
Owner

Just leaving this as a "known issue" kind of thing. viti95 noticed that keyboard rotation straight up doesn't work, and I'll also add that mouse rotation is used during teleports and when it's meant to be mouse strafing.

Quote from the Doomworld thread where it was raised:

This is intentionally broken until I finish player interpolation.

So here's how it currently works.

For all mobjs, the previous and current positions are interpolated according to where the display frame is in between the simulation frame. This does technically mean that you will be guaranteed to see past data except for one out every frames where a tic lines up exactly with a second. The one exception to this rule is the player. The angle is not interpolated at all. Instead, the most recent angle is used. And for each display frame, we peek ahead in to the input command queue and add any mouse rotation found.

This was the quick "it works" method that let me get everything up and running.

Here's how it should work.

Exactly as above, except do for the display player's movement exactly what we do for mouse look.

The full solution will require properly decoupling the player view from the simulation. At this point, it will be the decoupler's responsibility to create correct position and rotation for the renderer instead of the renderer doing the job. There's some more setup I need to do for that to work correctly, but it will also cover all keyboard inputs once working.

It may not seem like much to anyone, but I really got sensitive to input lag when implementing 144Hz support in Quantum Break. I tested a few other ports to see how they feel too, in fact. prBoom has the worst feel by far to me, with every other port tried feeling about the same. My intention is to ensure there's basically zero effective lag between when input is read and when it is displayed (ie read on the same frame you render) and thus remove input error considerations from skilled play.

@GooberMan GooberMan added the bug Something isn't working label Oct 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant