[Client Beta] Publish & Test Your Server Authoritative Experiences

You have the run the tool and backpack code on both the client and the server - check out the laser tag template in the documentation. We’re adding a section on tools and backpacks to the documentation soon - sorry about that!

1 Like

This is (maybe) a game specific question, but what would be the correct way to create custom characters and get them to work with the Server Authoritative model?

Old way of doing it was:

1.) Create a model somewhere in workspace
2.) Assign all parts/rootassemblypart to the Player
3.) Tell the player that specific model was their new “character”, could either set Player.Character directly or fire a RemoteEvent and tell them.
4.) Listen to inputs from either a forked ControllerModule or UserInputService
5.) Move the model via Humanoid:Move() or ControllerManager or VectorForce/AlignOrientation
6.) ???
7.) Custom Character is now created, and moves via player input due to Roblox’s old way of trusting clients.

New way of doing it… would be what exactly?

I’ve tried updating my game to fork in Server Authority with similar structuring, but its uh.. Very buggy and I can’t really tell if that’s my fault (probably is) or if that is due to there not being a realistic way to fork in custom character control at the moment.

For comparisons, this is how things are without server authority:

WithoutServerAuthority.rbxl (507.5 KB)

And this is how things are with server authority:

ServerAuthorityTesting.rbxl (658.8 KB)

Read if you want to know more about why I'm messing with custom characters and some interesting tech debt you'll run into...

Working on a game that requires me to swap between Humanoid and Vehicle(oid?) type of characters, their input(s) are basically just a vector3 for MovingDirection and FacingDirection (Keeping inline with the ControllerManager scheme of movement for ease of API access for myself and other coders) and we need to be able to swap control of units (characters) on the fly between player or server, or player and player. Basically, allow players to possess a character that isn’t theirs but still move and jump and all that. (look at a dummy and press E to control it, it can do everything you do)

FUN FACT ABOUT DEFAULT PROXIMITYPROMPTS AND CLICKDETECTORS!

So ProximityPrompts use your actual character for distance checks and triggering.
ClickDetectors use your camera for distance checks and triggering.

Guess what, if you are controlling a character that IS NOT TIED TO Player.Character, you cannot interact with ProximityPrompts or ClickDetectors.

So uh.. had to lazily write my own ProximityPrompt and ClickDetector classes. Don’t recommend it but for our game it was required.

Fun(ner?) fact is streaming, you will want to set on the server the replication focus of the controlled characters torso (or rootpart) so that the player can continue to move and control their character from afar.

Oh yeah, custom inventory/tools are needed for custom characters

… I’m not going to bother explaining this one, its a lot of work. You really shouldn’t make custom characters unless you have an extremely specific and justified reason for it. For this game… because units will have per unit inventory for weapons, medical items and grenades, ammo and etc… yeah we kinda have to have custom inventory and ran into edge cases with actual Tool objects that it just became better to write our own tool classes.

Works fine outside of the Server Authority model, as seen in the first video but once you fork it over to a server authority model, it falls apart… I’ll be upfront about this and say I don’t really know what I’m doing with Server Authority, its very new and this reminds me of when FilteringEnabled got added over a decade ago, I feel like an old man, but I figured I’ll leave both versions of the repositories up for anyone interested in poking around.

For control specific, see game.ReplicatedStorage.Client (folder) for how I’m controlling characters.
For character specific code- you have a bit of reading to do with multiple layers of inheritance, the 2 key scripts for characters is in game.ReplicatedStorage.Assets.Scripts.Templates.Shared.Instance and game.ReplicatedStorage.Assets.Scripts.Templates.Entities.CharacterClass for character creation and what it inherits/does.

I want to clarify that this is the simplest repository of my game, I have left out actual NPC code, vehicle “characters” and weapons but left virtually everything else in, custom character, basic (custom) tool/ (custom) inventory system, (custom) ProximityPrompts, (custom) ClickDectors and a working vehicle (not to be confused with vehicle character which is an entirely different thing from vehicle and character scripts)

I checked out the template and it doesn’t seem to handle equipping tools right either, it relies on the Slot1/Slot2 InputActions to equip/unequip but that doesn’t work when you just equip it through clicking the hotbar slot, which presumably breaks it on mobile devices as well. I can see this is a known limitation though, hope you guys can get this sorted before full release. Having to use a custom backpack just to use the tool system with server authority is not ideal :sweat_smile:

Also worth noting the new Animate script still doesn’t play toolnone correctly even if you parent it correctly, the template uses custom idle animations. But I assume this is known as well.

Client View

Server View

1 Like

It’s hard to answer what’s wrong without knowing exactly you have done. I suggest reading the existing ControlModule’s stuff that’s written specifically for Server Authority.

This is on our radar for when this exits beta, thanks for the thorough report

Auto jumping on mobile seems to be causing mispredictions. Are there any plans to fix this?

So instance stitching is really nice, but it’s overlooking a problem that if we need a lot of instances moving around at once (e.g. firing a lot of rockets) we need to call Instance.new or clone new instances. This is really slow, so the usual trick is part pooling, which may not be compatible with stitching.
I have long thought a ModelPoolService or something would be really handy for this, so we can reserve as many as we need in memory beforehand.

4 Likes

Yes - you are right! We are working on this :slight_smile:

2 Likes

Connecting ppl with rope trips people on the client side.
Place1.rbxl (59.6 KB)

Client:

Server

I love this update, this will be usefull.

Someone asked an interesting question here https://devforum.roblox.com/t/sa-is-objectvalue-affected-by-rollback/4632505

1 Like

So I have been testing a lot with Server Authority and I found out that animation playing in Humanoid in WorldModel aka ViewportFrame DOESN’T WORK whenever UseFixedSimulation is enabled.

Disabling this makes the animation actually working on the Humanoid.

Any way to fix that or wait for bugfix in Studio? (Unless I have to somehow rewrite that?)

This is a known issue. I will be deploying a fix for it soon.

1 Like

Will this issue be addressed? I reported this in a previous server authority post months ago when it was in studio beta but I had no response from there either.

The problem should be fixed now. If you are still having problem, ensure that you are using version 720 or higher. Let me know if things still aren’t working. Thanks.

1 Like

When spawning at an unanchored SpawnLocation, clients will render the player character at that SpawnLocation until user input begins, at which point the client-side player character teleports to 0,0,0.

Anchored spawn:

Same place, unanchored spawns

Steps to reproduce:

  1. Create a new ungrounded SpawnLocation.
  2. Hit play.
1 Like

Issue still persists


image

Was instance stitching broken in v721? Instance stitching doesn’t seem to work for me anymore like it was on v720

My bad. I misread which issue you were replying to. Looking into this now. Thanks.

1 Like

I’m having the same problem. I started working on a projectile system the other day that uses instance stitching and after updating to 721 it’s broken.

2 Likes