Will my solution for high ping players work?

Hi, I’m trying to make a fix that allows my game to be fair for high ping players. Basically whenever a player sends an event I wait a small amount for another person to send an event and whoever sent the event at the earliest timeStamp will have priority, disregarding ping completely. My only question is, will this even work in real gameplay?

(Very rough testing version)

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local listOfPlayers = {}
local playerTimeStamps = {}

ReplicatedStorage.Test.OnServerEvent:Connect(function(player: Player, timeStamp: number)
	print(`Received event from {player.Name} at {timeStamp}`)

	table.insert(listOfPlayers, player)
	playerTimeStamps[player] = timeStamp

	task.delay(0.1, function()
		if #listOfPlayers > 1 then
			local player1TimeStamp = playerTimeStamps[listOfPlayers[1]]
			local player2TimeStamp = playerTimeStamps[listOfPlayers[2]]

			if (player1TimeStamp) < (player2TimeStamp) then
				print(`{listOfPlayers[1].Name} won the react battle in {player1TimeStamp}s`)
			else
				print(`{listOfPlayers[2].Name} won the react battle in {player2TimeStamp}s`)
			end
		end

		table.clear(listOfPlayers)
	end)
end)

Basically, so in my soccer game, when 2 players are in a very close collision with a ball, you’d expect the player that touched it first to actually be the one that kicks the ball, however if that player has high ping, their chances of actually kicking the ball (even THOUGH they have touched it) are way lower. My goal is to prevent this, so that no matter your ping if you touched the ball first, you will get it.

I would personally give priority to whoever fired the event first, because exploiters could just lie to you when firing the event and say that their reaction time was lower. It sucks, but high ping players can just join new servers in their region. Maybe implement some kind of server region picker and encourage people with higher ping to find a server in the region. Now, if you could implement some kind of security to verify their timestamps, then this approach could work, but I can’t really think of anything you could do to verify that besides making sure their timestamp was above 0.

1 Like

Ah okay, maybe there is some sort of different way I could solve this issue? Because let me tell you I’ve experienced this issue firsthand when playing on a server that was basically 200 ping for me, I touch the ball literally 0.5 seconds before another player, and he still ends up getting the priority before me. I’ve seen other games that fix this somehow and all they mention is some kind of “tick-based” system (no other elaboration) so I thought this is kind of like what they use. I had no idea about exploiters in this.

Another way I can verify it is, since the server and client ServerTimeNow are synced, I can check if its within a reasonable range, like 0.5 off of the ServerTimeNow so they cant just put 0 and always have priority, but that probably doesnt help much either

just substract the player’s ping from the time

1 Like

To be fair exploiters could just teleport to the ball before anyone else, so like, who cares?
There are already so many ways for them to just break the system, making it a little easier doesnt matter that much if it makes the experience for everyone else better!

Ofc thats just my opinion

2 Likes

True, with networkownership being a thing in my game, there are way worse things they could do compared to that.

1 Like

Sorry can you elaborate on this? Are you talking about comparing it to prevent it from being exploited or saying I should switch my system to do that?

Honestly @FroDev1002 has a point, the exploiters can do a lot worse than say they won a reaction time thingy, so honestly for what its supposed to do, this system is pretty good, I’d still probably add a system to filter out impossible reaction times, maybe factoring in the players ping too and making sure they’re close enough to the ball and whatnot

2 Likes

Yea, this is just a mockup code I wrote in a seperate testing place to simulate how it would be to compare in a two player server, thanks for the ideas for what I could use to verify it

2 Likes

Its just an alternative to sending a timestamp, when player sends a reaction request, just take tick and substract thier ping. About exploiters, I don’t think theres a reason to care if it’s a football game, they can do way worse stuff anyways. If exploiter will teleport around the map, it will be way worse than just cheating a reaction minigame.

1 Like