Playtest ping was 1400 so I played a 2 player local server baseplate. 4000. How do I test multiplayer without this awful state product of Roblox server strain? Alternative means? Will I have to wait this one out?
You can make use of tick()
to find how long it takes for an event to fire from client to server. Send the current tick to the server and then on the server subtract that from tick()
again.
Client:
game.ReplicatedStorage.PingTest:FireServer(tick())
Server:
game.ReplicatedStorage.PingTest.OnServerEvent:Connect(function(player, tic)
print(tick() - tic) -- time elapsed
end)
First of all, your post is off-topic
Tick on the client and the server may be different because tick is based on the computer’s local time. If the server is located in North America, and one of the clients is located in Europe, there’ll be a big difference between the two ticks, so this is not a good way to get the player’s ping.
The better way would be to use a RemoteFunction, invoke it to the server from the client, and let the server return a response to the client:
Client:
local start = tick()
local _ = game.ReplicatedStorage.PingRemote:InvokeServer()
local ping = ((tick() - start) / 2) * 1000
The time taken is the amount of time to get an invoke to the server + the amount of time it took to get back to the client, so you divide it by 2, and multiply it by 1000 to get the ping in milliseconds
He asked for a way to properly test his game without using Roblox servers, not for a way to get a client’s ping.
Roblox simulates ping, which you can edit in the Studio settings. One thing to note is that it’s not a good thing to disable it since it fairly accurately simulates strain which is very common.
Local servers are LAN servers, meaning they depend on your local connection. The ping you experience is most probably on your end.
And that is not in my controls so I will be waiting it out.