Description:
Hello. I am experiencing issues with the Roblox Server Authority Studio beta. Specifically with Character controllers. Im not sure if this should be in Studio issues instead, because even though the beta is only in Studio, but I believe this would also effect the entire engine if it were enabled on clients.
At least with my implementation, movement is very choppy. Even when I enable prediction.
Prediction seems to work, however, setting my replication lag to 1000 ms and disabling/enabling it does show different effects, with prediction, inputs seem to be more or less instant, but even with 0ms replication lag and prediction on, the movement is glitchy and unpredictable.
Atleast with my testing, disabling ServerAuthority makes the Character Controllers feel exactly as expected. This is because my script sets the Player.Character to the corresponding Character model so when ServerAuthority is disabled the server gives players network ownership of their characters. This is why I have the feeling it is an engine problem, because disabling ServerAuthority shows that the inputs are applied to ControllerManagers normally, which means prediction should have worked, or atleast, not be as glitchy as it is right now with my testing.
This is what it looks like:
Specs:
Ryzen 7 5800x3d
RTX 3070 ti
32 GB DDR4 ram
Windows 10 LTSC IOT x64
Expected behavior
What I expected to happen was that the Character Controllers would work smoothly. They should work similarly to how it is when I disable ServerAuthority and the character is controlled using network ownership.
What it looks like without ServerAuthority:
A private message is associated with this bug report
3 Likes
No response yet? I see bug reports posted sooner than mine and they get responded to. I would appreciate some acknowledgement of this report.
3 Likes
I am taking a look at this now and should hopefully be able to deploy some improvements in the next couple weeks. I believe this bug is just another manifestation of mispredictions arising from the physics solver itself (controller instances rely on the solver to provide forces so they will see these midpredictions more than legacy humanoids). I have a couple fixes coming down the pike that should hopefully reduce these mispredictions. I will let you know when they are fully deployed and we can see if they fully resolve your problems. I’ve tested them on your repro file and they seem to help but repro’s with SAuth can be tricky so it is best to get multiple opinions. Thanks.
4 Likes
Hello,
Sorry revive an old thread but are you still seeing odd behavior with the Physics-based character controller. Since this bug was file, we have deployed a number of improvements that should have improved the behavior of physics objects when server authority is active. Testing with your repro place, the behavior of both characters now seems smooth to me and interactions seem reasonable. I still see some sporadic mispredictions but they seem to resolve quickly. We will keep making improvements on these types of sporadic mispredictions but generally things seem to be in a better place now. Let me know if you would consider the bug resolved from your end. Thanks.
1 Like
Hey, sorry for the late response. I will test Server Authority soon and let you know.
1 Like
Hello, I tried it on the repro place. It seems to work better. Initially when I tried it a week ago my studio must not have not updated because it felt the same, but now it works better. I’ll be trying it with my newer place version shortly, thanks.
1 Like
Sorry for posting late, it still feels glitchy on my new place
1 Like
Unfortunately it is still very clunky
3 Likes
Hello, the problem is that you have to simulate the movement both on client and server for controllers in order to make it smooth.
Here is a clip of controllerManagers combined with server authority
You have to create a local script that runs the movement on the client to predict the movement:
local controller: ControllerManager = character:WaitForChild('HumanoidRootPart'):WaitForChild('ControllerManager')
runService:SetPredictionMode(controller, Enum.PredictionMode.On)
runService:BindToSimulation(function()
inputContexts.CameraContext.CameraAction.CameraScriptableBinding:Fire(workspace.Camera.CFrame.LookVector)
local direction = utils.getDirection(client)
controller.MovingDirection = direction
end)
Make sure to use runService:SetPredictionMode() on the controllerManager instance and Enum.PredictionMode.On to make it work smooth!
The same thing you have to do it on the server:
runService:BindToSimulation(function()
for n, player in playerService:GetPlayers() do
-- update players and controllers using the controllerMovement
local direction = utils.getDirection(player)
player.Character.HumanoidRootPart.ControllerManager.MovingDirection = direction
end
end)
For more details, this is the .getDirection function code
function commonUtils.getDirection(player: Player) : vector
local inputContexts: typeof(script.Parent.InputContexts) = player.InputContexts
local cameraDirection = inputContexts.CameraContext.CameraAction:GetState()
local direction2D = inputContexts.CharacterContext.MoveAction:GetState()
const vec = CFrame.lookAt(Vector3.zero, Vector3.new(cameraDirection.X, 0, cameraDirection.Z))
return vec:VectorToWorldSpace(Vector3.new(direction2D.X, 0, -direction2D.Y))
end
IMPORTANT: You will have to interpolate the positions for other clients since they will move clunky!!!
You can forward the inputs to make it smooth, but a simple technique is to smooth the position of it!
More details can be found here
3 Likes
Dealing with the same issue, getting horrible mispredictions for something that is supposed to be fully shipped for competitive integrity.
1 Like