OneLife icon indicating copy to clipboard operation
OneLife copied to clipboard

High Ping

Open trevorhackman opened this issue 7 years ago • 9 comments

There are times when the ping to the server becomes really high, and not due to internet of player (at least according to a speedtest).

Slash Ping will reveal it being 200-300, but it feels more like 2000-3000. Takes a couple seconds to perform any action, your character just bobbing back and forth while trying to do anything.

Sometimes it lasts just a few seconds like in #267, sometimes the high ping lasts your whole life.

trevorhackman avatar May 10 '19 04:05 trevorhackman

I need some more info about this.

jasonrohrer avatar Jun 13 '19 19:06 jasonrohrer

I think the game as a hard time dealing with lost packets.

I use my laptop and my smartphone's wifi connected via usb, i get high download speed this way (probably because wifi card is better than the one on laptop) and can watch movies,streams etc without any issues.

But when i play the game this way i lag a lot (bouncing) i'm guessing it's because i lose packets (wifi is at a certain distance) and the game seems to get stuck on these missed packets.

When i use a wifi dongle with an extended usb cable my download speed is much less high but the game runs much better almost no bouncing if not at all, i think it's because the wifi signal is better so there is not as much lost packets.

I dont know exactly what it is but maybe it's related to these high pings.

Dodg-e avatar Jun 13 '19 19:06 Dodg-e

Well, the game is using your OS's TCP socket layer, however that is implemented, and this is the same layer used by pretty much every application, including streaming services, etc.

Bouncing is a delay before the message makes a round-trip to the server. That could be caused by lost packets.

But it could also be caused by a shoddy upstream connection.

For certain things like streaming and downloads, it's all downstream, with almost nothing sent back to the server, and no waiting for round trips before something can happen.

Imagine if the card in the computer is weak at sending, but the base station is very strong at sending. Then the weak card would have no trouble receiving packets, but would need a lot of retries to send packets.

The reality is that the server needs to get your packet in order to execute your action, right? If that's not happening for whatever reason, there's no way to fix that.

(That said, I'm not saying there's not some other bug in my code.)

jasonrohrer avatar Jun 13 '19 20:06 jasonrohrer

I get the impression that losing packet causes more trouble than it should, like bouncing 5-10 times instead of 1-2 like it should.

Also something odd is it seems to be triggered specially when interacting with objects, when i move around i have no issue most of the time but when i interact with an object it start bouncing (when i use usb+smartphone) and if i do a /PING while bouncing the ping registers at 500-800 ms but if i just walk around ping is at 144 ms, most of the time.

So when i interact with an object and lose packet it makes ping go to 500-800 ms but just moving around doesn't cause any issue and ping stays at 144 ms, except sometimes when people freeze for a moment then catch up, but it's more rare then when i interact with objects.

Dodg-e avatar Jun 14 '19 19:06 Dodg-e

Yes, when you move around, your client does not wait for a response from the server before showing a result.

It does this to make moving around "fully interactive" regardless of network latency (it would feel really bad if there was a network lag around each move you made).

To prove this, pull the plug and try moving around. Everyone else will freeze, but you will be able to move around freely up until the point where you try to click something.

But then when you go to click an object, the client MUST wait for a response from the server before showing you the result. This is the "sync point" where the realities must match. Is the object still there (did someone else grab it, or did it change, etc.)? Did your click work (are you old enough, is your hand empty, etc.)?

If the client showed the result of the click before hearing back from the server, some very disturbing things would be possible (two people grab an object at the same time, and both see that they picked it up, but then later, once the truth was known, it would disappear from one of their hands in a very frustrating way).

If this bouncing is happening constantly, on every interaction, it could be because of a framerate issue, where you're walking too fast, and arriving early every time you click on something (the server makes you wait until you're actually there, server-side, before your action can go through).

If it's NOT happening with every interaction, only sometimes, then this is likely a case of packets not getting through, and needed to get resent, or your connection renegotiating. If your internet is flakey, then this is going to happen sometimes.

HOWEVER, there still could be a bug. There was a bug that was fixed back in February that caused messages to pile up client-side in busy cities when the frame rate dropped. That has been fixed, and no bouncing occurs in busy cities now even with very low frame rates. But there could be some other bug client or server-side that is causing a backlog of some kind.

But it must be a rare one, because it's definitely not affecting everyone. I've never seen this happen on my end, for example, when either I or my kids play the game here at home.

jasonrohrer avatar Jul 04 '19 15:07 jasonrohrer

I'm still experiencing this. A speedtest shows me having 20/20 Mbps and 21 ping to a nearby server while I have 800 ping in game (from /ping), take much longer than 800ms to pick up anything, and can barely play the game. It is happening with every interaction.

trevorhackman avatar Jul 27 '19 00:07 trevorhackman

Yeah, that's really really weird. It obviously doesn't affect everyone.

Any chance you can shoot a video of this happening?

The /ping in game is really strange.

I'm getting 66ms to bigserver2 from outside the game, and 70-80 ms inside the game with /ping.

I'm wondering if you're getting some kind of inbound or outbound packet "pile up" in your client for some reason. There was a bug like this long ago that was fixed. Maybe there's another?

jasonrohrer avatar Sep 11 '19 18:09 jasonrohrer

Can you run some more experiments?

In general, run with /fps and /net on in-game, and look for anything weird there.

  1. Play the tutorial. What's your ping there?

  2. Pick a completely empty server from here and set it as your custom server. What's your ping there? http://onehouronelife.com/reflector/server.php?action=report

jasonrohrer avatar Sep 11 '19 18:09 jasonrohrer

I haven't been experiencing this anymore lately, but I'll perform that testing if it happens again.

I'll close this for now since it seems like I'm the only one with the issue, and I haven't even been experiencing it recently.

trevorhackman avatar Sep 15 '19 13:09 trevorhackman