Client frames digestion

Started by
0 comments, last by Farkon 12 years, 2 months ago
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.
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

This topic is closed to new replies.

Advertisement