Jump to content
  • Advertisement
Sign in to follow this  
Farkon

Client frames digestion

This topic is 2511 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 coded a bot to simulate players on my game; while setting some wild fps for him i noticed that my netcode might not be built like it should.

At 120fps the bot moved twice faster and that for a simple reason, my physics server-side is set for a client with 60fps, now the real issue is that the server is actually eating everything it receives : The server have a physics tick of 60fps and a net tick of 30fps (but only for output). What arrives from clients to the server is directly dispatched hence the problem when too much data arrives. So i'm having two thought :

* Either i calculate dt for the player server-side depending on how fast i receive the frames and digest every frame with an appropriate dt
* Either i actually limit the rate at what i'm reading the frames from the client using the existing net tick. It sounds more appropriate but then i'll have a queue and i'm not sure how to handle that. What if the server is slowing down ? The queue will grow and add some latency.
* Or something else :3

Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Baaah, I need to process the WHOLE queue by net tick and avoid applying physics only for one netframe.

Right now If a frame contains "go right" i would apply physics to "go right" and that's it, so basically x += rightvalue.
What i should : the player class on the server says go to direction_variable, meaning that the client frame would just change that direction_variable and still apply that direction even if no frame is received by the client.

:3

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!