Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualNercury

Posted 01 March 2013 - 02:08 AM

I recommend this read (although there are a lot of Unreal specific things, many things can be simplified):

http://udn.epicgames.com/Three/NetworkingOverview.html

To summarize:

A client does not know about objects until server decides they are relevant to him. Server keeps track of what objects are replicated to client and periodically sends state updates.

You run the same simulation on both client and server, with the exception of server-specific and client-specific things.
For example, server will need to send updates to other clients, client may want to read user input or animate additional eye candy which is not needed on server.

 

Additional tracked data usually include velocity vectors. For example, if object is moving to X direction, client continues simulating it's movement even if no updates come from the server. Of course, this leads to small inaccuracies, and updates from server usually snaps it back to "reality".

For this to work, you also need to keep track of network latency.

You will know that, for example object P was at position (x, y) with movement direction to (i, j) at speed s, and it happened t time ago. Based on this data, it is easy to calculate it's position on the client.


#2Nercury

Posted 01 March 2013 - 01:43 AM

I recommend this read:

http://udn.epicgames.com/Three/NetworkingOverview.html

To summarize:

A client does not know about objects until server decides they are relevant to him. Server keeps track of what objects are replicated to client and periodically sends state updates.

You run the same simulation on both client and server, with the exception of server-specific and client-specific things.
For example, server will need to send updates to other clients, client may want to read user input or animate additional eye candy which is not needed on server.

 

Additional tracked data usually include velocity vectors. For example, if object is moving to X direction, client continues simulating it's movement even if no updates come from the server. Of course, this leads to small inaccuracies, and updates from server usually snaps it back to "reality".

For this to work, you also need to keep track of network latency.

You will know that, for example object P was at position (x, y) with movement direction to (i, j) at speed s, and it happened t time ago. Based on this data, it is easy to calculate it's position on the client.


#1Nercury

Posted 01 March 2013 - 01:42 AM

I recommend this read:

http://udn.epicgames.com/Three/NetworkingOverview.html

To summarize:

A client does not know about objects until server decides they are relevant to him. Server keeps track of what objects are replicated to client and periodically sends state updates.

You run the same simulation on both client and server, with the exception of server-specific and client-specific things.
For example, server will need to send updates to other clients, client may want to read user input or animate additional eye candy which is not needed on server.

 

Additional tracked data usually include velocity vectors. For example, if object is moving to X direction, client continues simulating it's movement even if no updates come from the server. Of course, this leads to small inaccuracies, and updates from server usually snaps it back to "reality".

For this to work, you also need to keep track of network latency:

 

You will know that, for example object P was at position (x, y) with movement direction to (i, j) at speed s, and it happened t time ago. Based on this data, it is easy to calculate it's position on the client.


PARTNERS