Skip to content

Ping improvements

Latapostrophe requested to merge ping-stuff-take2 into next

This branch does things to make Ping stuff more convenient:

As you know, I'm someone with pretty damn bad internet, and this led me to often getting kicked off netgames due to how our ping kick system works currently; it takes an average of the ping over 255 tics and kicks you if said average is above server's maxping on the 255th tic. Yes, this is VERY unaccurate about 90% of the time; an unfortunate pingspike near the end of the check can play enough for your average to get high enough and get you kicked even if your net was perfectly fine prior to that.

Thus, this is what we do here:

  • Ping is updated once every second instead of once every 255 tics
  • If the average ping of that second is > maxping, a "kick timer" increments.
  • Once that timer reaches the server's cv_pingtimeout (added to menu) value, the player gets kicked. (The default is 10 seconds)
  • If the player is below maxping for the check, the timer decrements instead. (It doesn't reset because ping that fluctuates too often still shouldn't be spared, we're only aiming to kill unconvenient high pingspikes here)

This also comes with quality of life improvements;

  • Ping stuff in general got a visual improvement thanks to Oni. (Please download patchping.kart to experience it)
  • To match the cool ping font, the FPS drawer has also been changed to be smaller and slickier.
  • cv_showping ("Off", "Always", "Warning") has been added (available from the chat options which were renamed to online hud options instead); it displays your ping in place of or above of the framerate if it's enabled. "Always" displays it at all times while "Warning" only displays it if your ping is higher than the server's maxping. It defaults to "Warning"
  • To make the above possible, the server's cv_maxping.value is sent to clients.
  • While we're at it, the Chat scrolling arrows were added back, the merge from vanilla for 1.0.2 had broken them.

PS: This is hard to test by yourself and you'd need at least three players (The kicking doesn't work if EVERYONE in the server is lagging, which is the case if you only have one other player), but this was already tested and is confirmed to work perfectly fine

patchping.kart, use "-file patchping.kart" when loading this EXE or you're gonna get some yikes looking unknown graphics

Once this gets merged, please be sure to put the contents of patchping.kart in either patch.kart or gfx.kart. Thanks.

Merge request reports