Best way to transfer lots of data between server and client?

I have been trying for a long time to find a good and convenient way to transfer a huge amount of data (in particular tables) between the server and the client, but so far I have not received the desired result. I would like to find a convenient way to transfer huge data tables from the server to the client (without remote event spam yk)

Transwer the whole Table with one RemoteEvent, or what do you mean?

yeah, but I need to update the information on the client using a heartbeat loop, and sending too many times will increase the recv that I don’t need (I apologize for not explaining it right away and maybe for not explaining it well)

If its possible try to make it so the client is able to figure out at least some of the data which is being sent on their own, this way you could speed things up

You really should only be sending data on an on change basis, what type of data do you have in the table that needs to be constantly sent to the clients?

Position, Object State/Action, Speed

Are these from a custom object or could you just assign these as attributes to an instance for the client to listen changes to?

it is a custom object (aaaaaaaaaaa)

If it’s a custom object, you could create an instance for that object (like a blank folder), and just assign those properties as attributes and the client will just listen to those for updates.

Yes, I had the same idea tbh, but I don’t like that folders will be created. I would like to use remote events

What does this data look like?

I think this belongs in #help-and-feedback:scripting-support since it does not necessarily encourage developer discussions, it’s just that you need help with something.

{
ID (number),
Position (Vector3int16)
State (string)
Action (string)
}

And what is this data being used for? A custom character?

1 Like

Just tell the server the ID, property to change, and the value. But this data is pretty small and I don’t think there will be an issue sending this data a lot.

One way to transfer a large amount of data between the server and the client on Roblox is to use the ReplicatedStorage service. This service allows you to store and access data on the server from the client, making it a convenient way to transfer large amounts of data between the two.

Here is an example of how you could use the ReplicatedStorage service to transfer a large table of data between the server and the client on Roblox:

-- On the server, create a table of data and store it in the ReplicatedStorage service
local dataTable = {...} -- Your table of data goes here
local replicatedStorage = game:GetService("ReplicatedStorage")
local dataFolder = Instance.new("Folder")
dataFolder.Name = "Data"
dataFolder.Parent = replicatedStorage

for i, v in ipairs(dataTable) do
  local dataValue = Instance.new("IntValue")
  dataValue.Name = tostring(i)
  dataValue.Value = v
  dataValue.Parent = dataFolder
end

-- On the client, retrieve the table of data from the ReplicatedStorage service
local replicatedStorage = game:GetService("ReplicatedStorage")
local dataFolder = replicatedStorage:WaitForChild("Data")

local dataTable = {}
for i, dataValue in ipairs(dataFolder:GetChildren()) do
  dataTable[i] = dataValue.Value
end

In this example, the data table is stored in the ReplicatedStorage service on the server, and then it is retrieved and reconstructed on the client. This allows you to transfer a large amount of data between the server and the client on Roblox.

Of course, this is just one example of how you could transfer a large amount of data between the server and the client on Roblox. There may be other methods that would work better for your specific needs, so it’s always a good idea to carefully consider your options and choose the best approach for your situation.

1 Like