Archived

This topic is now archived and is closed to further replies.

Nairou

Client-Server packet frame rates

Recommended Posts

Nairou    430
I''ve been reading a lot about client-server networking here, and I''ve learned a lot but there''s still one question I haven''t found answered. The server sends out world state updates at a regular interval, 10 or 20 updates per second. This is the ''framerate'' of the server, and is consistent. But what about the client? My first thought was that it would send movement/shot info to the server every frame as well, but this becomes rediculous on high-end clients running at over 100 FPS. Perhaps then the client sends its packets at the same rate as the server, only 10 or 20 per second regardless of the graphics framerate? This makes more sense, since the server wouldn''t handle a higher packet rate anyway right? But then it makes me think of the extra interpolation/extrapolation the client will have to do. The client may be sending movement updates only 10 times a second, but the player is unaware of that and continues moving around. Does this mean the client has to accumulate the movements of the player between packets, guessing how the server would react if it was receiving every frame, and then send the final position info when its time? It might sound like a simple question, but I wanted to be sure since I''m totally new to this. Thanks!

Share this post


Link to post
Share on other sites
sross    109
quote:
Original post by Nairou
Perhaps then the client sends its packets at the same rate as the server, only 10 or 20 per second regardless of the graphics framerate.



Yes exactly, normally the update packets sent to the server are capped independantly of the framerate

quote:
Original post by Nairou
But then it makes me think of the extra interpolation/extrapolation the client will have to do. The client may be sending movement updates only 10 times a second, but the player is unaware of that and continues moving around. Does this mean the client has to accumulate the movements of the player between packets, guessing how the server would react if it was receiving every frame, and then send the final position info when its time?



Normally when you send update packets, you send the current position, velocity and orientation so that the server can interpolate your movement until it receives the next update packet. So you should always keep track of those in your game objects.

Share this post


Link to post
Share on other sites