Server Authority Studio Beta Updates

Hi Creators!

We wanted to share some improvements we’ve made to the Server Authority Studio Beta.

Misprediction Rates Keep Getting Better

The Roblox physics team has been working on reducing mispredictions. You don’t need to do anything for these changes; they have been slowly rolling out and we’re hopeful you’ve been seeing the gradual improvements.

image5
Before

image2
After

Note: Those red streaks behind the car are alerts for mispredictions. Reminder that you can press Ctrl + Shift + F6 (windows) or Cmd (⌘) + Shift + F6 (mac) while playtesting in Studio to toggle this Server Authority visualizer on or off.

New Animation System

Why This Matters

Animations modify character Part transforms and therefore impact simulation. This change enables animations to synchronize and resimulate across the client and server when using Server Authority, which helps further prevent mispredictions. Experiences that rely on animations to affect physics and gameplay can now rely on animations synchronizing correctly and authoritatively across clients.

Changes to Animation APIs

The Roblox Animation System API changes to note include:

  • Animate Script: Just like any other Luau game script, the default Animate script requires adaptation to work in Server Authority. The redesign moves all critical internal state to attributes on the HumanoidRootPart, allowing for correct rollback of script logic during resimulation.
  • AnimationTrack references cannot outlive a single frame: Since Server Authority may stomp on locally-playing animations, you cannot rely on AnimationTrack references to be valid beyond a single frame. Instead, you may use Animator:GetPlayingAnimationTracks() to acquire handles to tracks that are active on the Animator.
  • New Limit on Number of Concurrent Tracks per Animator: In Early Access, the new limit for concurrent tracks in server authority will be 8. We plan to increase this limit in subsequent updates. Developers will need to pay close attention to this limit and ensure that they don’t leak tracks.
  • Tool Animations: The logic for tool animations has changed. Instead of relying on the creation and removal of a StringValue instance for activation, tools must now set an attribute on their handle to trigger slash or lunge animations.
  • LocalPlayer Simulation: In Server Authority, there is no client-to-server replication exception for LocalPlayer animations. Instead, both the client and the server simulate animations independently. If the client diverges from the server’s authoritative state, the client rolls back and resimulates to match the server.

Code Sample

The samples below explain how to adapt animation code and why the old Animate script is incompatible.

Click here to view

Old Animate Script

Note: LocalScript with local variables that don’t get rolled back in Server Authority resimulation.

-- This handle cannot be trusted from frame to frame because of SA.
local currentAnimTrack = nil
-- This variable doesn't get rolled back.
local pose = "Standing"

humanoid.Running:Connect(function(speed)
    pose = if speed > 0 then "Running" else "Standing"
end)

-- ...

local function stepAnimate(time)
    if (pose == "Seated") then
        if currentAnimTrack then
            currentAnimTrack:Stop(0)
            currentAnimTrack:Destroy()
        end
        currentAnimTrack = animator:LoadAnimation(sitAnimation)
        currentAnimTrack:Play()
    elseif (pose == "Running") then
        -- ...
    end
end

while character.Parent ~= nil do
    local _, currentGameTime = wait(0.1)
    stepAnimate(currentGameTime)
end

New Animate Script

Note: ModuleScript required by both server and client. State is stored in Attributes so it gets rolled back during resimulation.

local module = {}

-- ...

-- TODO: This will eventually be added to the Animator API
local function getPlayingAnimationTrackFromID(animationId) ... end

function module.setup()
    -- Attributes are rolled back in resim:
    humanoid:SetAttribute("previousHumanoidState", humanoid:GetState())
    humanoid:SetAttribute("currentAnimId", "")

    local function stepAnimate(dt)
        local currentState = humanoid:GetState()
        if currentState == humanoid:GetAttribute("previousHumanoidState") then
            return -- no changes
        end

        if currentState == Enum.HumanoidStateType.Seated then
            local currentAnimId = humanoid:GetAttribute("currentAnimId")
            local track = getPlayingAnimationTrackFromID(currentAnimId)
            if track then
                track:Stop(0)
                -- No need to Destroy; Animator manages track lifetime.
            end
            track = animator:LoadAnimation(sitAnimation)
            track:Play()
            humanoid:SetAttribute("currentAnimId", sitAnimation.AnimationId)
        elseif currentState == Enum.HumanoidStateType.Running then
            -- ...
        end

        humanoid:SetAttribute("previousHumanoidState", currentState)
    end

    RunService:BindToSimulation(function(deltaTime)
        stepAnimate(deltaTime)
    end)
end

return module

Performance Expectations

When utilizing Server Authority, you can expect some extra performance and bandwidth overhead.

  • Server Compute: The server incurs extra simulation overhead because it needs to execute the Animate script as well.
  • Client Compute: Clients require resimulation when their state diverges far enough from the server’s. Resimulation triggers the animation step several times before the next render frame in order to catch up to the latest time step.
  • Network Bandwidth: You may notice some additional network overhead due to the additional state that replicates for synchronization. We’re actively working on addressing this overhead.

Work in Progress

The Early Access version of Animation Server Authority is missing several features/has several known issues that we are actively working on fixing:

  • When misprediction rates are high, animations may replay incorrectly or too fast. We’re actively looking into fixing this issue and should have an improvement rolled out in a few days.
  • Compatibility with the Adaptive Animations beta feature will be supported soon.
  • Custom emotes and strafing animations currently aren’t supported with the new Animate script.

Putting It All Together

With the animation and misprediction updates, check out how much smoother character movement has become!

image4
Before

image3
After

Release Date

We know many of you are eager for Server Authority to go live so that you can publish your games using this new tech. We are too and we’re getting close! The team is optimizing and polishing the product and we hope to ship in 1-2 months. We will keep you updated.

Reminder, if you want to publish and test your game with Server Authority with a few friends, check out our Early Access post and comment for access. Anyone enrolled here will be able to correctly experience a Server Authority published game. Note, we process these requests once every week or so.

Last, we wanted to remind folks of our Server Authority documentation, which includes templates, our advanced techniques documentation, and this post by our own network engineer @Khanovich that discusses Server Authority.

As always, please share any and all feedback so we can continue improving this feature.

Happy creating,

The Roblox Server Authority Team

149 Likes

This topic was automatically opened after 10 minutes.

The performance optimizations actually look pretty solid! It still has some lengths to go before being server-ready, but looking forward to implementing it in a future game!

32 Likes

Can’t wait for this to leave beta, this change will be amazing

11 Likes

So it will arrive in 3-4 months got it

26 Likes

I do and always will love how this is turning out. The performance optimizations are great and the better prediction is always needed, will definitely be implementing this in any future projects that require pvp.

I know this may not be your area but do you think other aspects such as proper datastore session locking and remote event rate limiting (which can be changed) to prevent the more annoying to deal with exploiters and can fix older games that may not be as secure?

5 Likes

Does the new animation system fix massive delays with ‘Cutscene’-length (primarily 2 minutes) tracks?

2 Likes

This looks great! I can not wait for Server Authority release so that it is out and working on the player client. This would make my new upcoming Roblox experience so much more better.

5 Likes

Not sure if this request is known or seen, but is the team considering a new method for storing data instead of attributes? The limits are extremely annoying and the method of obtaining data feels weird with attributes.

Would also love to hear if there are any updates to the new Behaviors, if they’re still in development.

8 Likes

Any news on AuroraScript? Or has it been cancelled?

2 Likes

I don’t think it’s cancelled. They recently made some changes.

1 Like

Been waiting on this for a while, great to see it’s nearly there. Security improvements are long overdue.

1 Like

it’s a very nice feature, but does this support R6, or is this exclusive to R15 rigs?

1 Like

The latest changes should work with R6’s as well. Please let us know if you are encountering any significant issues!

7 Likes

Is it going to be enabled by default? And how about local parts, such as a bridge that’s visible to the client after he presses the button with a local script inside, or a gate that’s opened to a player with a certain collection of stars.

Are the changes to the Animate script in there by default for the base R15/R6 scripts, or only when using server authority? Doesn’t break anything for me, I would like to know because the exposure of this state into the datamodel is useful since the Animate script is not a module that I can require to integrate with my own systems.

Currently in Roblox, when you have many many assemblies (e.g. a car with complex suspension for each player in a race alongside game systems), some packets for physics can be dropped leading to the player seeing jittery assemblies. Will this become an even bigger issue that will require smaller servers to prevent it considering the extra bandwidth needed for server authority? I am aware of the distance based prioritisation with the next generation replication system however that will not help much at the start of a race.

2 Likes

Does this 1-2 month estimate include the release of the fixed heartbeat? My team is very eager for this addition specifically, so I was wondering if this is something that could leave beta earlier? I understand server authority heavily relies on the fixed heartbeat, but does the fixed heartbeat rely on the server authority just as much?

1 Like

The camera in the sample project pulls back and stutters when rotating the view in first-person.


It’s much better than before, but still not good enough.


What should I do if I want physics content that only works locally? For example, if a player unlocks a door, only that player can pass through it.


How is the performance when there are a large number of moving objects?


Can only player-controlled Humanoids be compatible with effects that only apply to the HumanoidRootPart? In the demo, it looks like all parts of the vehicle are being calculated—this extra computation shouldn’t be necessary, right?


In addition:
SetNetworkOwner(playerInstance: Player):()
How will this work?


Data synchronization: Originally, the client only receives changes when data is modified on the server side.
This just seems to add sending all data to the client at fixed intervals, which can easily be done oneself.


Also, just enabling this function uses up half the bandwidth.This is way too insufficient. Are there plans to increase the bandwidth limit?

2 Likes

Roblox Team! Have you ever considered using Kalman Filters for this particular use case? You can technically predict the true locations of the moving objects and have been used in NASA’s projects. I recommend you guys to implement it if you haven’t!

2 Likes