I’m making a big RPG, in which there are gonna be some NPCs, that need to patrol, attack player, etc.
So I decided to do some performance testing with extreme case (1000 Humanoids moving simultaneously) to determine what’s better, Client or Server Authority.
The results shocked and confused me.
All the zombies are created on the server initially, I tried 2 different options. In both cases this same basic script used.
while task.wait() do
for i,v in pairs(NPCs) do
v.Humanoid:MoveTo(v.TargetPos.Value)
end
task.wait(5)
for i,v in pairs(NPCs) do
v.Humanoid:MoveTo(v.StartPos.Value)
end
task.wait(5)
end
Option 1 - Server Authority
So as I said, all the zombies are initially created on the server. Firstly I put the above code into a server script, so that everything is Server sided. Here’s what happened:
As you can see, ping was mostly around 200 the whole time.
Option 2 - Client Authority
As before, zombies are initially created on the server.
But in this case, I first transfer all of their authority to clients using RootPart:SetNetworkOwner(Player), and then do the same code I mentioned at the start, but this time in a Local Script.
As you can see, ping most of the time was above 300.
The Main Question
Why do client controlled Humanoids lag more, and does this mean that it’s better to do everything in a server script?
P.S. Note, that CREATING zombies on the client too is not an option, because I want them to be replicated to other players too. If I create them on the server, but transfer NetworkOwner and do everything on the client (as I did above), everything replicates easily.