Will firing remote events to relay data to server cause lag?

Hello,
I’m approaching a problem regarding relaying client information to the server. Clients control their respective parts (similar to go-karts) using NetworkOwnership and every few frames will relay their current go-kart’s position to the server.

The server stores a list of the client’s positions, so that when a collision occur (on request of client) the server can check the table containing the positions to see if collision is valid, and if so will validate the collision.

I have a few questions concerning this. Will this cause lag if all clients (6 max per game) were to send in 10-20 events per second? I have to account for other remote events in the background as well (countdown etc). I’ve thought of another way to eliminate this but it adds more complexity by storing an initial position and velocity, and server can predict current position using deltaTimes. Is this method worth it considering its higher complexity? Thanks.

1 Like

I doubt it will cause insane amounts of lag, but it is solely dependand on the size of data you’re sending. I think roblox has a limit of 50KB/s per client. Also a little trick you can do is use HTTPService’s JSONEncode method to get the size of your data. The size it gives is in bytes keep that in mind

local DATA_SIZE = #HTTPService:JSONEncode(data) --> 20 Bytes(or whatever your size is)

1 Like