Closed skymen closed 2 years ago
I also have this issue. Sending json over too quickly causes a delay, that later bunches the sent data together once I close the connection.
I've been just manually limiting the rate I'm sending and smoothing the position on the other end, but def not ideal.
Can you show/explain how you implemented your rate limiting?
Sorry, it is no peerjs issue. Close the issue.
How is it not a peerjs issue?
Because in PeerJS library there is no any logic about rate limiting or bandwidth limits.
You should customise you network settings via sdp ( https://github.com/peers/peerjs/issues/901#issuecomment-1046230997 ) + using your own STUN/TURN servers to minimise RTT and packet loss.
Hey,
I am making a game using peerjs where players send info about their positioning every frame to the host, and the host redistributes the data.
However, sometimes, even when playing with myself, the events have a massive delay that piles up over time, and the distant pllayer is multiple seconds behind his client counterpart. All the movements and events are executed in the correct order, they're just very slow.
This does not happen all the time. Sometimes it works just fine.
Can this be due to me using the public server? Would this be fixed by using a self hosted one?
Or is this due to sending too many updates per second and the library cannot keep up?