Sign in to follow this  

Angular velocity update problem

This topic is 4209 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

Ok. I have one serious problem I cant solve. Please any help! Problem is this.... In my client/server game players are moved using velocity and angular velocity. Client scenario is this: First pick input, then send this input data to server (just simple keypresses), and process that input ie. move/rotate player. Server scenario is this. Picks message with input data. Process that input message by moving/rotating player. Client sends this delta update every frame. Problem: If I press rotate left for just one frame, on client it is AngularVelocity*DeltaTime rotation. And on server it is also AngularVelocity*DeltaTime cause it will get input data from server and now that rotate left is about to occur. It sounds good but delta time on client and server can be different meaning different rotation for just one simple press. This difference between client and server`s rotation is small but if I start moving forward it just happens to desinchronize my positions (obviously cause slightly different directions). And this problem also occurs when I start pressing rotate left and after a while release it. Synchro with positions suffers from same problem but it is not so obvious and doesnt affect playing... Could anyone knows answer. I had same ideas sending delta time and fixing it on sever for each player but it just sounds bad to do that...

Share this post


Link to post
Share on other sites
Most games either do the rotation on the client and send the angles to the server, or do it only on the server and send back the results. A third method is to do the rotation and correct it when the server response arrives. This can results in small non user initiated movements when the client corrects itself, which can be limited by allowing only N degrees of rotation without server confirmation. Imho the most simple and easy way is to calculate it on the client and only check for cheats on the server.

Viktor

Share this post


Link to post
Share on other sites
Do the rotation on the server, and have it update the client with what 'really' happened. That's how all movement should be done to prevent cheating and to ensure synchroneity between players. If your frame rate is fast then you won't be likely to turn for one frame only anyway.

You can process the rotation on the client as well if you want the game to feel responsive, and when it receives the server update you should move to the real orientation, either with a jump if the client is completely wrong or via interpolation if you want a smooth transition that just changes the view a bit.

Share this post


Link to post
Share on other sites

This topic is 4209 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