Dealing with high player count and high latency #194
Replies: 8 comments 10 replies
-
What is your tickrate and what is the measured latency? Because if you use the default 30, then 64 frames is more than two seconds of latency, which is quite a lot. I'd like to make sure that it's indeed network latency and not an issue with the time sync. During testing I have aimed to keep games playable at ~250ms ping and kept the 64 frame history limit as a safe default. Unfortunately, at some point you have to draw the line because you run out of tradeoffs to make. There might be better approaches out there, but I'm not the one aware of them I'm afraid 🙂 But depending on the game, you can try to keep the tickrate as low as possible, and increase history as high as sensible, as you've mentioned. Higher history limit means more memory, but lower tickrate means you get more seconds of history for the same memory usage. |
Beta Was this translation helpful? Give feedback.
-
I have my tickrate set to 30, and a history limit of 64.
For what it's worth, I did implement the workaround at #175 since I need nodes with EDIT: I'm getting RTTs up to 16 seconds when new clients join an existing game, causing a global lag spike. |
Beta Was this translation helpful? Give feedback.
-
I'm not sure if this is relevant, but the issue pops up the most when I connect my Android client to the network. EDIT: In hindsight, it might have less to do with the platform and more to do with the number of clients connected at the time. |
Beta Was this translation helpful? Give feedback.
-
6.players.mp4This is a demo with 6 players (2 HTML5, 4 native), with a server hosted on a server with at most 1s RTT. 2.players.mp4The rollback issues seem to tone down greatly when the number of players are reduced. |
Beta Was this translation helpful? Give feedback.
-
The issue seems to stem from new nodes being added. When a 4th client is added later in the match, existing clients get a spike that causes >2s RTTs. adding.new.nodes.causes.lag.spike.mp4 |
Beta Was this translation helpful? Give feedback.
-
My guess is with larger multiplayer lobbies, too many rollbacks are occurring whenever any single player has a lag spike, causing the entire network to grind to a halt. Maybe rollback netcode isn't suitable for large multiplayer lobbies. Is it possible to disable rollbacks, and set up
On step 3, instead of rolling back player A's local state to t=1 and resimulating to t=2, we just need to verify that its local state at t=1 is close-enough to the server state at t=1, with "close enough" defined via custom predicates for each property. If player A's local state at t=1 fails verification, we snap player A's local state at t=2 (current time) to the server state received at t=1. Peers will not need to adjust their local states for player A, since they've only received server state for player A. This does mean that state is more inconsistent across the network, but it would be more scalable for large lobbies. |
Beta Was this translation helpful? Give feedback.
-
Would it be better to move to sending inputs unreliably but each packet includes the previous x inputs? |
Beta Was this translation helpful? Give feedback.
-
The only real limitation is the hardware of the server (to simulate multiple ticks per frame) and the bandwidth of the network. By extension, in a normal setup, 200ms of 16 players should be possible imo, especially if you have a tiny state consisting of player data only I am curious myself as to those spikes. That said, perhaps when a player joins but it tries to rollback, it tries to rollback on a frame before the player joined and causes problems? Also has been a while since I saw how the input is sent to the server in forest brawl, is it a dictionary? If yes, that's the problem |
Beta Was this translation helpful? Give feedback.
-
I'm using this library with a game that expects 12 players across different platforms, including HTML5. For context, due to the HTML5 support, I'm using the
WebSocketMultiplayerPeer
instead ofENetMultiplayerPeer
.The rollback and time synchronization works really well when I'm debugging locally with low latency, but during a test deployment of my game with a server, I was getting lots of rollback issues like:
I know I could increase the history limit to be more lenient to high latency clients, but it seems unavoidable that eventually someone will have a bad connection.
I'm wondering if there is any common advice for dealing with high latency?
Beta Was this translation helpful? Give feedback.
All reactions