Winsock Linear Dead Schedule

It’s a little difficult for me to understand how I implement Dead Reckoning in my version of Server-Client Winsock.

I searched the internet for a decent explanation that accurately explains:

  • When a message should be sent from the server to the client

  • How should a customer act if he does not receive update messages, does he continue to use the predicted position as the current position to calculate the new predicted position?

The Dead Reckoning method that I use is:

path vector = oldPosition - oldestPosition
delta time = oldTime - oldestTime
delta velocity = path vector / delta time
new delta time = current time / oldest time
new prediction = oldPosition + new delta time * delta velocity

Hope this is the right formula to use! :)

It should also be noted that the connection type is UDP and that the game is played only on the server. The server sends update messages to the client.

Can anyone help by answering my questions?

thanks

+4
2

, - , , , , angular . angular, . , , , .

:

Dead reckoning equation

:

P t: .

P O:

V O:

A O:

T: - , .

. : ( ) . .


, ​​, Catmull-Rom ( ), , . , , - , , .

, - , - .

-, "Game Engine Gems 2", - :

EDIT: , , . " ", Valve , 15 , 66,6 .

: Valve . , Source Multiplayer Networking . , .

EDIT 2 ( !):

++/DirectX:

struct kinematicState
{
     D3DXVECTOR3 position;
     D3DXVECTOR3 velocity;
     D3DXVECTOR3 acceleration;
};

void PredictPosition(kinematicState *old, kinematicState *prediction, float elapsedSeconds)
{
     prediction->position = old->position + (old->velocity * elapsedSeconds) + (0.5 * old->acceleration * (elapsedSeconds * elapsedSeconds));`
}

kinematicState *BlendKinematicStateLinear(kinematicState *olStated, kinematicState *newState, float percentageToNew)
{
     //Explanation of percentateToNew:
     //A value of 0.0 will return the exact same state as "oldState",
     //A value of 1.0 will return the exact same state as "newState",
     //A value of 0.5 will return a state with data exactly in the middle of that of "old" and "new".
     //Its value should never be outside of [0, 1].

     kinematicState *final = new kinematicState();

     //Many other interpolation algorithms would create a smoother blend,
     //But this is just a linear interpolation to keep it simple.

     //Implementation of a different algorithm should be straightforward.
     //I suggest starting with Catmull-Rom splines.

     float percentageToOld = 1.0 - percentageToNew;

     final->position = (percentageToOld * oldState->position) + (percentageToNew * new-State>position);
     final->velocity = (percentageToOld * oldState->velocity) + (percentageToNew * newState->velocity);
     final->acceleration = (percentageToOld * oldState->acceleration) + (percentageToNew * newState->acceleration);

     return final;
}

, , , ;)

+9

.

( , ), , . //, . , .

, ,

new delta time = current time / oldest time

-

new delta time = current time - oldTime

, . , , , ( , ). ( ) - new_s = s_0 + vel * t

+1

All Articles