Scenes: Loading, Component Lookup, and GameObject Directory
A Scene is a collection of GameObjects that represents the game world. Every Component and GameObject has a property for accessing the current scene, and you ca…
Sandbox: Full codebase architecture — systems, player components, weapons, tools, NPCs
Sandbox Codebase Architecture Overview The Facepunch Sandbox game is a large reference implementation. Here's a map of the major systems and how they connect. C…
Code Basics - s&box Documentation
Code Basics C# is the primary programming language for s&box. The engine uses modern .NET with hotloading support, allowing you to see code changes instantly wi…
RenderOptions: Game, Overlay, Bloom, AfterUI Render Layers — and Renderer.Attributes for Shader Parameters
RenderOptions: Render Layers for SceneObjects controls which render layers a component's appears in. It's exposed as a property on all subclasses. Render Layers…
Game Resources - s&box Documentation
Official s&box documentation for Game Resources - custom asset types. GameResource allows defining custom asset types that can be created in the editor and load…
GameObjectSystem - s&box Scene Documentation
GameObjectSystem GameObjectSystems are global systems that operate on groups of GameObjects. Unlike Components which are attached to single GameObjects, systems…
Component.OnLoad: Async Loading Pattern — LoadingContext, Scene.IsLoading, and Loading Screen Integration
Component.OnLoad: Async Loading Pattern for Components Components can perform async loading work by overriding . This is the correct way to load resources async…
Getting Started - s&box Documentation
Getting Started S&box is coded in C#. Under the hood, it uses the Source 2 engine (CS2, HL:Alyx, DOTA2) and some of its systems: rendering, resources, physics, …
Testing Multiplayer: New Instances, Hotloading, and Local Connect
s&box provides built-in tools for testing multiplayer without needing another player. You can spawn additional game instances that join your running session, wi…
CleanupSystem: Map reset and baseline restoration
CleanupSystem: Map Reset and Baseline Restoration This example shows the CleanupSystem which tracks the baseline scene state and allows resetting the map to its…
s&box DamageInfo: Extensible Damage Data Class and IDamageable Interface
s&box DamageInfo: Extensible Damage Data Class is a class (not a struct) so it can be subclassed for game-specific damage types. Definition Usage IDamageable In…
s&box ResourceLibrary: Loading and Accessing Game Resources
s&box ResourceLibrary: Loading and Accessing Game Resources (and ) provides access to all loaded resources. Loading Resources ```csharp // Synchronous get (retu…
Download & Install - s&box Documentation
Download & Install Install Purchase s&box on Steam Install it via your Steam Library Launch s&box Launch After launching s&box, you will be presented with a men…
s&box ServerSettings: Server-controlled settings
ServerSettings Static Class ServerSettings is a static class that defines server-controlled settings replicated to all clients. These ConVars control game-wide …
Animation - s&box Documentation
Animation s&box supports skeletal animation for characters and objects. Animate models using imported animations, blend between states, and control playback fro…
Backend Services - Achievements, Leaderboards, Stats
Backend Services - Achievements, Leaderboards, Stats Integrate Steam backend services for player progression, competition, and analytics. Achievements Track and…
DamageInfo: The Standard Damage Payload — Properties, Usage, and Custom Types
DamageInfo: The Standard Damage Payload is a class (not a struct) used to pass damage information between game systems. It is intentionally a class so games can…
MainThread.Queue: Running Code on the Main Thread from Worker Threads
MainThread.Queue: Running Code on the Main Thread from Worker Threads s&box is single-threaded for game logic. If you have code running on a worker thread (e.g.…
s&box ScriptedEntity: Custom entity GameResource
ScriptedEntity GameResource API Reference ScriptedEntity is a GameResource that defines a spawnable entity with a prefab, used by the spawn menu to create custo…
Citizen Characters - s&box Assets Documentation
Citizen Characters The Citizen is s&box's default human character model. It provides a standardized base for player characters, NPCs, and customization through …