VanessaE wrote:It need not be anything complicated since the server and client are in constant communication anyway. I don't know what all the server sends to the client, but surely you can take advantage of the existing packet flow:
Measure the time between adjacent packets in the server's "keep alive" stream (it does seem to have one if you look at the profiler graph while the client is idle). Keep variables indicating the current, minimum, and maximum times measured between packets of that type. Update these variables on every received packet.
Measure the elapsed time from the moment of the most recent player action to the moment the client receives the server's response to that action. Keep variables indicating the current, minimum and maximum times. Update these variables every time the client receives a server response to an action.
Add the two above minimum times. The result is your best packet time.
Add the two above maximum times. The result is your worst packet time.
Add the current received packet time to the current action response time.
Compute the difference between this summed current packet time and the summed minimum time.
Keep a running average of this difference, integrated over the last 5 or 10 seconds' worth of measurements. This is your lag time.
In the F5 "debug" output, display the current difference average as the amount of lag, in seconds, rounded to the nearest 1/10 second. Update the display once per second as long as it's visible.
Put all of the raw values into one of the F6 profiler pages.
RabbiBob wrote:My mind goes right to the Valve NetGraph.
minetest.register_chatcommand("ping", {
params = "",
description = "Test the lag",
privs = {},
func = function(name, param)
minetest.chat_send_player(name, "Pong!")
end
})irksomeduck wrote:My suggestion is-
1. Look at the top bar of screen
2. Look at FPS clock
3. If it's under 10 FPS, you probably have lag
Sources- Personal experience
Calinou wrote:irksomeduck wrote:My suggestion is-
1. Look at the top bar of screen
2. Look at FPS clock
3. If it's under 10 FPS, you probably have lag
Sources- Personal experience
Lag != slow performance.
Anyway (in reply to VanessaE's post), I think the current FPS count and ping time should be shown on the bottom right of the screen (so that you can see your FPS while you're in fullscreen).
Users browsing this forum: Bing [Bot] and 10 guests