Hello! I am currently working on an FPS PvE type of game, where there are a ton of enemies updating their positions at 16Hz. I’ve been working today on lowering the throughput of my most expensive remotes, and everything was going fine, until I opened the network debugging menu and I saw that the client was sending almost half of what it was receiving.
After that, I started debugging lots of stuff, to no avail. I also tried disabling all of my client-side scripts, but it didn’t change almost anything! I also tried playing it out of studio, on the actual Roblox client, but the result was the same. That’s when I thought it was something to do with the weird replication system of Roblox, so I made another place to test my theory out.
And so it was! I threw together a small script to test that, and the outgoing data from the client turned out to be relatively high. This is the script I wrote, if you want to test it out for yourself:
local xoff, yoff = -50, -120
task.wait(2)
local folder = Instance.new("Folder", workspace)
for i=1, 50 do
for j=1, 50 do
local a = Instance.new("Part")
a.Position = Vector3.new(xoff + i * 2, 8, yoff + j * 2)
a.Size = Vector3.new(1, 1, 1)
a.Anchored = true
a.Parent = folder
end
end
task.wait(1)
while task.wait(0.1) do
for i, v in folder:GetChildren() do
v.Position += Vector3.new(math.random() * 0.1 - 0.05, math.random() * 0.1 - 0.05, math.random() * 0.1 - 0.05)
end
end
(just put it in the ServerScriptService, and you’re good to go)
This is the result I got.
So, it turns out that I am, in fact, not at fault for the high outgoing traffic. I tried setting the parts’ network owner to the server using a:SetNetworkOwner()
, but it turns out you cannot set the network owner of an anchored part? I also tried disabling
StreamingEnabled
, but that didn’t seem to help with my issue. I also tried searching for solutions on Google, but it turns out nobody even acknowledged this?
This is a real issue in my game, because, in later rounds, you can easily have over 2000 enemies updating their position a bunch of times per second, so does anyone know any workaround for this? Maybe stopping the replication to the client of the enemies altogether (that would help me with incoming bandwidth as well, since I already developed a tool to send compressed Vector3s for my use case, and it works very well). Or, has at least anyone here stumbled upon this before? I cannot be the only one, right?
In the actual game, I move all enemies with the workspace:BulkMoveTo()
function, so I don’t think it’s the server giving part of its work to the clients or anything like that. And, even if it is, how do I disable that??
Either way, I hope anyone can tell me a good method to bypass this weird replication “feature”, or at least tell me why it’s happening. Thanks in advance!!