Networking is built right into s&box, so turning a single-player scene into a shared multiplayer experience takes surprisingly little code. GameObjects can be easily replicated to other clients, RPCs can be sent to the server or peer-to-peer and there is full dedicated server support.
The networking system in s&box is purposefully simple and easy. Our initial aim isn't to provide a bullet proof server-authoritative networking system. Our aim is to provide a system that is really easy to use and understand.
The quickest way to get going is the Network Helper component - drop it into your scene and you have a working multiplayer setup, with players spawning and connecting out of the box.
Under the hood, everything revolves around networked GameObjects. Any GameObject can be made networked by calling NetworkSpawn(), after which its [Sync] properties replicate to everyone and its RPCs can be invoked remotely. From there, ownership, visibility, and permissions give you fine-grained control over who can do what, while network events let your components react to players joining and leaving.
The easiest way to get a multiplayer game running - a ready-made component that handles spawning, connecting, and common setup. Start here, then customise it or write your own.
Make any GameObject networked with NetworkSpawn() so it exists for every connected player.
Assign and check which connection owns a networked object.
Replicate a property's latest value to other players whenever it changes using the [Sync] attribute.
Call component methods remotely across the network.
React to players joining, leaving, and objects spawning in the scene.
Control whether a networked object is sent to a specific player.
Attach extra data to the snapshot new players receive when they join a server.
Let the host adjust what an individual connection is allowed to do.
Tools and tricks for testing your game without a second player on hand.
Install, configure, and run standalone s&box servers.
Drop-in text chat that's routed through the host, validated, and filtered for you.
Make asynchronous GET/POST/DELETE requests with built-in JSON support.
Connect to external servers for custom networking or persistent data.