• Advertisement
Sign in to follow this  

Sending rate on server and client

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

Hello I just want to clarify what I've learnt so far:
-Client application has sending and receiving rate (CMIIW). should it be different or be the same?(the sending and receiving)
-Server application has it too (CMIIW). should it be different or be the same?(the sending and receiving)

Basically, I just made a server application that reads message at 30fps and sending rate 10fps. Is it common in an Online Game?
And I have the client that reads message at 30fps and sending rate at 10 fps too. But the object movement is quite "Jumpy" (although I was able to alleviate the effect by interpolation)
-Perhaps the "jumpy" movement appears because Im not using extrapolation at the time (CMIIW)?
-I dont know where to learn about a good extrapolation technique. care to share some links?
-I wonder how to extrapolate when player is stopping (Im affraid he'll pass the "stopping" point, since he'll keep moving until the "stop message" is received)

Thanks,
Bow Vernon

Share this post


Link to post
Share on other sites
Advertisement
You should be able to recv() every frame. There is no point not reading the data, it is sitting in the kernel buffers for you anyway. Not reacting to it soon will cause unnecessary latency in the overall simulation. The "jumping" is caused by having your sending rate too low or not having enough client side interpolation/extrapolation to mask the latency.

Your stop message should include enough information to determine what position the player stopped at.

Share this post


Link to post
Share on other sites
Hmm that answered most of the questions. What about sending rate? in server and client, how many times should they send in a sec? I don't know the common rate of sending both in client and server...thx

Share this post


Link to post
Share on other sites
Id say faster is better if it wont cause any problems and works well. Maybe something like 30? Unless you have a ton of objects to send, of course...

Share this post


Link to post
Share on other sites
Ok, I get it. Thanks. just recv() as fast as you can, but dont send() too often, else it'll eat up bandwidth. The same thing goes for the server....

Share this post


Link to post
Share on other sites

Hmm that answered most of the questions. What about sending rate? in server and client, how many times should they send in a sec? I don't know the common rate of sending both in client and server...thx


While you're building your game and just getting things working it's fine to have the clients and servers send fairly frequently, but eventually you want to find an ideal rate which is as low as possible while avoiding the "jumping" problem you mentioned. There's nothing wrong with having a variable send frequency either - if a player is suddenly moving around a lot very quickly you may want to have them send their position more often for a short time to ensure their movement is replicated more accurately for other clients, though depending on the type of game this may almost always be solvable with good prediction/interpolation logic at the other side.

Obviously if your send rate varies you need to assume a worst-case scenario where all clients are operating at this rate and ensure the game is still playable with this level of network traffic.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement