Angular velocity update problem

Started by
1 comment, last by Bob Janova 17 years, 10 months ago
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...
If you don`t do something, something will do, something to you!
Advertisement
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
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.

This topic is closed to new replies.

Advertisement