Sign in to follow this  

Best way to get immediate mouse feedback in interpolated display

This topic is 4074 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I have a simulation where my main loop is updated 30 times per second. Within this loop, I grab input from the mouse and keyboard, and use the mouse position to set an orientation for a 1st person camera that is displayed in a 3D DirectX window. The display has vsync enabled, locking the display update rate to 85 hz on my monitor. The display is constantly updated. I use linear interpolation to get smooth rotation of my camera binetween loop updates, but I'm noticing that if I flick the mouse quickly to any direction, the view I'm seeing, due to interpolation, slowly moves the camera to play "catch up" with the quick mouse movement. It all feels very sluggish. Is there any other way to get a more responsive feel when moving the mouse quickly that I'm not aware of? Would extrapolation accomplish this? Thanks.

Share this post


Link to post
Share on other sites
Mouse input should be handled on a non-laggable input cycle which runs as fast as possible; a responsive mouse pointer makes the game feel faster even if it's not. In this case I would say you should either put the mouse handling directly in the rendering thread, or make a dedicated input thread which updates at at least 85Hz. Then you wouldn't need to interpolate at all :).

Share this post


Link to post
Share on other sites
Thanks for the info. Please correct me if I'm wrong, but I also update my physics each game "tick", and because of that I need to update my input only within the game 'tick' so the physics can react to input. It seems if I updated my input as fast as possible, it would still only have an effect on the game each game 'tick', because that is when the physics moves the objects in response to input, so that still seems to be the pacemaker.

Running my main loop at 85 hz would eliminate the need for interpolation which would be nice. I'm not sure if my computer can keep up with updating the physics that quickly! (I'm lucky to get 60 hz with that, currently since my game loop is running at 30 hz I just do two physics updates for each game tick)

Share this post


Link to post
Share on other sites
Yes, updating input faster than your game loop would mean some mouse positions weren't 'seen' by the game engine. But the user would never see an input 'lag', so it would seem more responsive, even with exactly the same game loop rate. (30fps seems adequate for that to me.)

Though the thought occurs to me that the interpolation between 30fps checkpoints shouldn't cause any visible lag, so you might want to check the algorithm you're using. Perhaps your camera is not allowing fast enough accelerations.

Share this post


Link to post
Share on other sites

This topic is 4074 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this