Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0 - HighLevelMultiplayer get latency to server. #8763

Closed
vicguedez opened this issue May 14, 2017 · 9 comments
Closed

3.0 - HighLevelMultiplayer get latency to server. #8763

vicguedez opened this issue May 14, 2017 · 9 comments

Comments

@vicguedez
Copy link

Godot 3.0

So, I run a couple instances of my game server , and a very useful function for me (and I think for people in the future) would be the ability to get the latency from client to any of my server instances, that without triggering the client connected/disconnected signals in the server instance.

I don't have the time to learn how networking works and all that stuff, so maybe someone like faless (the only person I'm aware that knows networking) could implement that if it is possible.

@kubecz3k
Copy link
Contributor

@Faless do you know by any chance what's the status of this issue?

@Faless
Copy link
Collaborator

Faless commented May 3, 2018

@kubecz3k a bit stale, I have to finish what I started in #17227 (documentation, renaming, deprecations) before working on it,

I do not believe we should implement the ping test without connecting/disconnecting though, but only when already connected.
That seems a very specific feature, which should be implemented via scripting when needed (as the result would also not be reliable without the actual network load of your game).

@Faless
Copy link
Collaborator

Faless commented May 3, 2018

On the other end, implementing a simple pinging API using ICMP sockets might be an option too (not an alternative one), I'll investigate further, I'm just worried of adding quite a lot of network code for a feature that might not be very useful.

@vicguedez
Copy link
Author

@Faless I'm no longer running multiplayer servers so I'm not in the need of this...

However, I see this as a very usefull feature, since in a "server browser" you would most likely show the server info, in which you might want to include the "ping".... But if the server is 8/8 players lets say, you won't be able to connect to the server and get the "ping" with current method.

That's the reason I said without "connection/disconnection", server should not treat it as a new client.

@tmathews
Copy link

I'm assuming the current way to get ping is to simply use a rpc call and count the time between the ping and pong messages.

Additionally I'd like to see how many bytes are currently being received and sent. Is this something you can already get from the API?

@Faless Faless added this to the 3.2 milestone Dec 26, 2018
@Calinou
Copy link
Member

Calinou commented Sep 21, 2019

Additionally I'd like to see how many bytes are currently being received and sent. Is this something you can already get from the API?

This information is available in the new network profiler, but I'm not sure if it's exposed to running projects.

@akien-mga akien-mga modified the milestones: 3.2, 4.0 Nov 11, 2019
@Faless
Copy link
Collaborator

Faless commented Jan 22, 2020

This can be easily done with a _ping RPC.
External plugin material (I'll see if I have time to publish one).
Closing.

@Faless Faless closed this as completed Jan 22, 2020
@mhilbrunner
Copy link
Member

This can be easily done with a _ping RPC.
External plugin material (I'll see if I have time to publish one).
Closing.

@Faless

Two thoughts on that:

  1. Doing this in a robust way (averaging over a few frames/packets, tracking latency, bandwith and packet loss) while not insurmountable isn't trivial

  2. Every networked game will want this information

Not sure pointing to "the competition" is always the best, but they do indeed offer similar features:
see GetCurrentRTT() and GetConnectionStats() for Unity's UNet, or this class for the popular Mirror networking API, or this one for Photon Networking.

In short, they all seem to offer:

  1. An explicit ping-like method to ping servers
  2. Ongoing running average statistics about latency/bandwith/packet loss while connected to network peers

@Calinou
Copy link
Member

Calinou commented Jun 7, 2020

@mhilbrunner Someone could open a proposal for this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants