heroiclabs / nakama

Distributed server for social and realtime games and apps.
https://heroiclabs.com
Apache License 2.0
8.83k stars 1.08k forks source link

UDP protocol latency and garbage generation issues #196

Closed prodigga closed 5 years ago

prodigga commented 6 years ago

Hello there, we are using the latest Unity 2018 b13 with the latest Nakama/Cockroach versions (N: 1.4.1, CR: 2.0.1).

Latency issues: When we test with Websockets, the RTT from clientA > Nakama > ClientB > Nakama > ClientA is 80ms. When we test with rUDP, the RTT from clientA > Nakama > ClientB > Nakama > ClientA is 250ms.

We noticed that if we sent messages unreliably then the RTT was comparable to Websockets. But we still need to be able to send messages reliably in a timely manner. (Weapon fire event, damage events, etc).

In our test scene, we treat positional updates as unreliable and weapon events as reliable. The movement is super responsive and smooth (Our Networked Transform code can handle dropped packets just fine), but the shooting feels really laggy because the RTT is 250ms when it should really be 80ms~.

Garbage generation: It looks like there is about 10kb's of garbage being generated for every event being sent (Reliable and unreliable)

ex commented 5 years ago

hi @prodigga , were you able to solve this issue? I'm interested in using nakama but this kind of issues worry me.

prodigga commented 5 years ago

We no longer use Nakama so I can't say whether it has been resolved or not.

On Fri., 21 Dec. 2018, 8:58 am Laurens Rodriguez <notifications@github.com wrote:

hi @prodigga https://github.com/prodigga , were you able to solve this issue? I'm interested in using nakama but this kind of issues worry me.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/heroiclabs/nakama/issues/196#issuecomment-449148676, or mute the thread https://github.com/notifications/unsubscribe-auth/AALThCE8CGOz74MoEF5KVwVHSO7orn0Aks5u7AgLgaJpZM4TkiWD .

ex commented 5 years ago

We no longer use Nakama so I can't say whether it has been resolved or not.

oh, can you tell me what are you using now?

zyro commented 5 years ago

This refers to the old Nakama 1.x rUDP protocol and no longer applies. The Nakama 2.x version is not yet open-source but is not based on the 1.x protocol and not subject to this issue.

@ex If you want to chat to Tim off-topic I know he's active on Twitter and Reddit so reach out there.