This article's documentation is for Source 2. Click here for more information.

S&box: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (reorder - shaders after programming)
 
(91 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{Language subpage}}
{{LanguageBar
{{S&box|4}} is a platform and game development toolkit developed by [https://facepunch.com/ Facepunch] studio powered by {{source2|3}}. Initially, the development was based on Unreal Engine 4, but as soon as {{hla|3}} came out, Facepunch immediately requested the engine branch of the newly-published game. A few weeks later [[Valve]] gave Facepunch access to the terabyte large repository, after which, in 2020, S&box's transition to {{source2|3}} was announced. This is the first (and currently only) time that Source 2 has been licensed to third-party developers.
|title=s&box
}}
{{Stub}}
{{Hierarchy|gmod}}
{{Infobox game
|title = s&box
|image = Software Cover - S&box.jpg
|developer = [[Facepunch Studios]]
|publisher = Facepunch Studios
|releasedates = TBA
|genre = [[WP:Sandbox game|Sandbox]]
|mode = {{w|icon=0|Single-player video game|Single-player}},  {{w|icon=0|Multiplayer video game|Multiplayer}}
|platform = [[WP:Windows|Windows]]
|engine = {{src2|4}}
|appid = 590830
|codelang = [[WP:C++|C++]], [[WP:C_Sharp_(programming language)|C<nowiki>#</nowiki>]]
|modsupport = Yes
|sdk = s&box Game Editor
|sysreq = <span></span>
* OS: {{w|icon=0|Windows 10|Win 10}} or later
* {{w|icon=0|Central processing unit|CPU}}: Core i5-7500 / Ryzen 5 1600
* RAM: 8 {{w|icon=0|Gigabyte|GB}}
* Storage: 3 GB or higher disk space
* GPU: GTX 1050 / RX 570, 4GB {{w|icon=0|Video random-access memory|VRAM}}, Vulkan 1.2.
* Note: Installing more addons will increase storage size.
 
 
|distribution = [[Steam]]
|website = [https://sbox.game/ Official Website]
|links = {{Steam store|app/590830|Steam page}}
|previousgame = {{gmod|1}}
}}
{{Software status
| appid = 590830
| type = games
| free = no <!-- Currently marked "no" for now. -->
| status = announced <!-- available values: announced/available/delisted/delisted-dl/ea/earlyaccess -->
| os = Windows <!-- According to SteamDB. -->
| deck = Unknown
| note = Currently in development, available as a open developer preview.
<!-- OTHER STOREFRONTS
This is for games that did uses Valve engines (or closely related to it), that was sold or available for free outside Steam. Works similarly to "note" parameters.
Beside that, you can also use this for console versions of the game sold on PlayStation Network (PS)/MS Store (Xbox)
Do not use affiliate link as it's can affect users with adblockers. And remember to use "•" for spacing if there are sold in multiple other storefronts. -->
| 3rdpartylinks = [https://sbox.game/give-me-that Get S&box open beta]
}}
{{S&box|4}} is a platform and game development toolkit developed by [https://facepunch.com/ Facepunch] studio powered by a highly modified version of {{source2|4}}, planned to be a spiritual successor to {{gmod|4}}. Initially, the development was based on {{ue|4|nt=4}}, but as soon as {{hla|4}} came out, Facepunch immediately requested the engine branch of the newly-published game. A few weeks later {{valve|1}} gave Facepunch access to the terabyte large repository, after which, in 2020, S&box's transition to {{source2|4}} was announced. This is the first (and currently only) time that Source 2 has been licensed to third-party developers.


{{ModernNote|S&box is not just a modding game! It is a complete package including a modified and fully featured {{source2|3}} engine toolkit with C# bindings, and a distribution platform named [https://asset.party/ Asset.Party].}}
{{note|S&box is not just a modding game! It is a complete package including a modified and fully featured {{source2|3}} engine toolkit with C# bindings, and a distribution platform named [https://sbox.game/ sbox.game].}}


__TOC__
__TOC__


== User Access ==
== User Access ==
S&box is currently in closed developer testing,
S&box is currently in open developer preview.


now access was available from the addon developers [https://sbox.facepunch.com/dev/ page], which takes care of redirecting users to the Asset.Party home page.
Access is available from the S&box site [https://sbox.game/give-me-that here]. Users must sign in through [[Steam]] on website to claim access to the preview.


== Release Date ==
== Features ==
An exact release date is unknown, but Facepunch plans to release S&box around 2023, according to a [https://sbox.facepunch.com/about/ post] on the project’s description page: “Our plan is to get to a releasable state over the next 6–12 months, then improve it over 10–20 years.”
{{S&box|4}} runs on highly modified version of {{src2|1}} with the following features:


The approximate dates for the completion of primary work were first announced by Garry Newman on February 19, 2022, on the [https://discord.gg/TEWk3GmU4w official S&box Discord server]:
; Box3D physics
: A modified version of [[Rubikon]] physics engine without Valve specific code that can be quickly updated. Originally referred to as [[Izabu]]


[[File:9vDaB4.png|350px|Message from Garry Newman]]
; Hotloading
: The ability to see code changes take effect immediately with blazing fast hotloading, no need to compile and restart your game.


== Projects ==
; Mounting assets from games on different engines
'''S&box currently supports 5 types of projects:'''
: In S&Box, you can mount any assets from games built on different engines. Currently as of [https://store.steampowered.com/news/app/590830/view/541112753868243026 August 2025 Update], S&Box can mount {{quake|1}} assets and can spawn Quake models.
{{Quote|{{Code|style=1|Games}} - Project that run through the main menu of S&box;


{{Code|style=1|Maps}} - Project that typically house maps to be played by a game addon;
; Visual Scripting
: With ActionGraph you can create interactive experiences in your levels, without having to write a single line of code, or having sprawling chains of entities. Not meant to program a game entirely in it, but to augment it.


{{Code|style=1|Tools}} - from additions to existing editors to tools built completely from scratch, these addons are meant to help you improve, automate, or completely integrate your workflow into the engine, without having to build game-based or external toolsets.
== UGC Content Distribution ==


{{Code|style=1|Content}} - Asset storage for either individual games, Multiple Games, or just generic asset storage for asset party.  
Instead of using the [https://developer.valvesoftware.com/wiki/Steam_Workshop Steam Workshop] for storing UGC Content {{S&box|4}} uses a custom web based backend called [https://sbox.game/ugc Workshop].


{{Code|style=1|Addon}} - addons/extensions for games. (Basic implementation)
== Scene System ==
}}
{{S&box|4}} does away with the legacy Entity System and utilizes a [https://docs.facepunch.com/s/sbox-dev/doc/the-scene-system-9V88B33VlE Scene System] which lets you have a [https://docs.facepunch.com/s/sbox-dev/doc/scenes-LT2kjsMBy4 Scene] that is a collection of [https://docs.facepunch.com/s/sbox-dev/doc/gameobject-oUVQQzT4IO Game Objects] to make up the game world. closely resembling the way things are done in [[Wikipedia:Unity (game engine)|Unity]]
 
{{ModernNote|The Current implementation for game addons as of 10/26/2022 is quite basic as stated here [https://github.com/Facepunch/sbox-issues/discussions/2438 Addons + Razor + New Menu]. It's important to note that Sandbox, (the official Garry's Mod style sandbox add-on for S&box) first introduced a feature called S&Works (Now it is [https://sw.facepunch.com/ Asset.Party]), similar to [https://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index8f6f.html Garry's Mod Toybox]. Asset.Party, with its own website and support for all (currently available) types of add-ons. It allows you to download models and all their content on the fly, so you can load props from Asset.Party in real-time without restarting the game.}}


== Maps ==
== Maps ==
[[File:S&box - Hammer.png|300px|thumb|Hammer Dated July 26th 2022]]
[[File:Sboxhammernovember2024.png|300px|thumb|Hammer Dated November 2024]]


Mappers are provided with a modified version of the Source 2 Hammer map editor, with some parts exposed for C# scripting for increased flexibility.
Mappers are provided with a modified version of the Source 2 Hammer map editor, with some parts exposed for C# scripting for increased flexibility. This includes integration with the scene system which lets you place game objects with components within the map just like you would in the scene editor.


<h5 style="color: rgba(255,255,255,.9); font-weight: 400;">Project control panel</h5>
<h5 style="color: rgba(255,255,255,.9); font-weight: 400;">Project control panel</h5>
Line 56: Line 102:
}}
}}


{{ModernWarning|Lighting baking beyond 32768 units is temporarily unavailable.}}
{{note| Hammer will be removed in the future. Unknown when exactly but its likely to be removed when scene mesh editing is good enough to replace it.}}
 
{{warning|Lighting baking beyond 32768 units is temporarily unavailable.}}


{{ModernWarning|The nav mesh has not yet been adapted for large spaces, which will cause your OS to freeze if the size of the available territory exceeds 32768 units. In the event of a freeze, the only way out will be an emergency shutdown of the computer. Turn off the navigation mesh in the map compilation window!}}
{{warning|The nav mesh has not yet been adapted for large spaces, which will cause your OS to freeze if the size of the available territory exceeds 32768 units. In the event of a freeze, the only way out will be an emergency shutdown of the computer. Turn off the navigation mesh in the map compilation window!}}


{{ModernWarning|There are problems with Floating point precision. Polygons start behaving incorrectly if you are too far from the zero coordinates (faint defects start after crossing 8 km, and are extremely noticeable after 20 km)}}
{{warning|There are problems with Floating point precision. Polygons start behaving incorrectly if you are too far from the zero coordinates (faint defects start after crossing 8 km, and are extremely noticeable after 20 km)}}


== Programming ==
== Programming ==
S&box user content is programmed with C#, Microsoft's managed, object-oriented programming language of [https://en.wikipedia.org/wiki/.NET_Framework .NET] fame. S&box includes an API which provides bindings to the underlying Source 2 engine and to Facepunch's middleware. All code in user content is distributed in source form, which S&box later compiles on-demand with [https://en.wikipedia.org/wiki/Roslyn_(compiler) Roslyn]. Language support is stated to permit C# 11, indicating that S&box requires a .NET Core 7.0 runtime in order to function. Only a specific subset of the baseline .NET Core complement is available for use.
 
[[File:S&box-actiongraph-screenshot1.png|thumb|right|ActionGraph Example]]
 
S&box user content is programmed with C#, Microsoft's managed, object-oriented programming language of [https://en.wikipedia.org/wiki/.NET .NET] fame. S&box includes an API which provides bindings to the underlying Source 2 engine and to Facepunch's middleware. All code in user content is distributed in source form, which S&box later compiles on-demand with [https://en.wikipedia.org/wiki/Roslyn_(compiler) Roslyn]. Language support is stated to permit C# 11, indicating that S&box requires a .NET 9.0.0 runtime in order to function, which is bundled with the sbox installation. Only a specific subset of the baseline .NET Core complement is available for use.


Security is a primary concern with user content. C# and its ubiquitous pairing with .NET is a software ecosystem many magnitudes larger, more complex, and more powerful than s&box or Source 2. Awarding unchecked access to this leviathan would effectively turn user content into fully-fledged applications with potentially unlimited access to the host computer. To this end, '''s&box restricts the use of certain types and namespaces.''' For example, access to the local file system is only available through a [https://wiki.facepunch.com/sbox/FileSystem sanctioned abstraction layer]; <code>System.IO.File</code> and similar types may '''not''' be used. This practice is common among applications which attempt to distill down .NET into a limited "scripting" platform for untrusted user code.
Security is a primary concern with user content. C# and its ubiquitous pairing with .NET is a software ecosystem many magnitudes larger, more complex, and more powerful than s&box or Source 2. Awarding unchecked access to this leviathan would effectively turn user content into fully-fledged applications with potentially unlimited access to the host computer. To this end, '''s&box restricts the use of certain types and namespaces.''' For example, access to the local file system is only available through a [https://wiki.facepunch.com/sbox/FileSystem sanctioned abstraction layer]; <code>System.IO.File</code> and similar types may '''not''' be used. This practice is common among applications which attempt to distill down .NET into a limited "scripting" platform for untrusted user code.
Line 74: Line 125:
}}
}}


There are many similarities between the use of C# in S&box and the use of the more primitive [https://www.lua.org/manual/5.1/ Lua] language in {{Game name|GMOD|name=Garry's Mod}}. Many concepts of Gmod's Lua environment have been carried over, including limited access the language's features and "hot reloading" of edited code.
There are many similarities between the use of C# in S&box and the use of the more primitive [https://www.lua.org/manual/5.1/ Lua] language in {{gmod|4}}. Many concepts of Gmod's Lua environment have been carried over, including limited access to the language's features and "hot reloading" of edited code.
 
S&box will also have a visual scripting solution called [https://sbox.facepunch.com/news/action-graph/ ActionGraph], which enables a developer to script events via nodes.


== Shaders ==
== Shaders ==
[[File:Simple Shadergraph Example.png|230px|thumb|right|Simple shadergraph example]]
[[File:Shadergraph Screenshot 1.png|230px|thumb|right|Shadergraph UV Rotation Example]]
[[File:S&box - Making a basic shader.gif|230px|thumb|right|Making a basic shader]]


You can create your own shaders either through HLSL or through the provided Shadergraph Editor and customize their interface for the material editor.  
You can create your own shaders either through HLSL or through the provided Shadergraph Editor and customize their interface for the material editor.  


S&box supports HLSL Shader Model 3.0, 4.0, and 5.0.  
S&box supports HLSL 2021 & Shader Model 3.0 up to 5.0.  


{{Todo|Add more detailed information for the shader graph editor.}}  
{{Todo|Add more detailed information for the shader graph editor.}}  
{{clr}}
{{clr}}


 
== External links ==
== External Links ==
<h5 style="color: rgba(255,255,255,.9); font-weight: 400;">For Developers</h5>
<h5 style="color: rgba(255,255,255,.9); font-weight: 400;">For Developers</h5>
* [https://github.com/Facepunch/sbox-issues Report a bug]
* [https://github.com/Facepunch/sbox-issues Report a bug]
* [https://asset.party/ Asset.Party]
* [https://asset.party/ Asset.Party]
* [https://docs.facepunch.com/s/sbox-dev/doc/sbox-documentation-iWNhAIdqPB/ Documentation]
* [https://wiki.facepunch.com/sbox/ Wiki]
* [https://wiki.facepunch.com/sbox/ Wiki]


<h5 style="color: rgba(255,255,255,.9); font-weight: 400;">Other</h5>
<h5 style="color: rgba(255,255,255,.9); font-weight: 400;">Other</h5>
Line 98: Line 152:
* [https://forum.facepunch.com/ Forum]
* [https://forum.facepunch.com/ Forum]
* [http://discord.gg/sbox Discord]
* [http://discord.gg/sbox Discord]
{{Source 2 topicon}}[[Category:S&box]]

Latest revision as of 06:52, 1 August 2025

English (en)Français (fr)Русский (ru)中文 (zh)Translate (Translate)

Stub

This article or section is a stub. You can help by expanding it.

Garry's Mod Garry's ModS&box S&box

s&box
Software Cover - S&box.jpg
Developer(s)
Publisher(s)
Facepunch Studios
Release date(s)
TBA
Genre(s)
Platform(s)
Engine
Steam AppID
Written in
Mod support
Yes
SDK
s&box Game Editor
System requirements
  • OS: Win 10 or later
  • CPU: Core i5-7500 / Ryzen 5 1600
  • RAM: 8 GB
  • Storage: 3 GB or higher disk space
  • GPU: GTX 1050 / RX 570, 4GB VRAM, Vulkan 1.2.
  • Note: Installing more addons will increase storage size.
Distribution
Official website
Links
Previous game

S&box S&box is a platform and game development toolkit developed by Facepunch studio powered by a highly modified version of Source 2 Source 2, planned to be a spiritual successor to Garry's Mod Garry's Mod. Initially, the development was based on Unreal Engine Unreal Engine 4, but as soon as Half-Life: Alyx Half-Life: Alyx came out, Facepunch immediately requested the engine branch of the newly-published game. A few weeks later Valve gave Facepunch access to the terabyte large repository, after which, in 2020, S&box's transition to Source 2 Source 2 was announced. This is the first (and currently only) time that Source 2 has been licensed to third-party developers.

Note.pngNote:S&box is not just a modding game! It is a complete package including a modified and fully featured Source 2 engine toolkit with C# bindings, and a distribution platform named sbox.game.

User Access

S&box is currently in open developer preview.

Access is available from the S&box site here. Users must sign in through Steam on website to claim access to the preview.

Features

S&box S&box runs on highly modified version of Source 2 with the following features:

Box3D physics
A modified version of Rubikon physics engine without Valve specific code that can be quickly updated. Originally referred to as Izabu
Hotloading
The ability to see code changes take effect immediately with blazing fast hotloading, no need to compile and restart your game.
Mounting assets from games on different engines
In S&Box, you can mount any assets from games built on different engines. Currently as of August 2025 Update, S&Box can mount Quake assets and can spawn Quake models.
Visual Scripting
With ActionGraph you can create interactive experiences in your levels, without having to write a single line of code, or having sprawling chains of entities. Not meant to program a game entirely in it, but to augment it.

UGC Content Distribution

Instead of using the Steam Workshop for storing UGC Content S&box S&box uses a custom web based backend called Workshop.

Scene System

S&box S&box does away with the legacy Entity System and utilizes a Scene System which lets you have a Scene that is a collection of Game Objects to make up the game world. closely resembling the way things are done in Unity

Maps

Hammer Dated November 2024

Mappers are provided with a modified version of the Source 2 Hammer map editor, with some parts exposed for C# scripting for increased flexibility. This includes integration with the scene system which lets you place game objects with components within the map just like you would in the scene editor.

Project control panel

In the projects menu in the dev tools, you can restrict map selection for your game mode. You can limit it to specific curated maps or maps tagged with supporting the game mode.

Publication

Currently, maps can be included with a game mode or released as a separate project(one for each map). The map is published by clicking on a special button in the projects menu in the developer toolkit.

Characteristics
Note.pngNote: Hammer will be removed in the future. Unknown when exactly but its likely to be removed when scene mesh editing is good enough to replace it.
Warning.pngWarning:Lighting baking beyond 32768 units is temporarily unavailable.
Warning.pngWarning:The nav mesh has not yet been adapted for large spaces, which will cause your OS to freeze if the size of the available territory exceeds 32768 units. In the event of a freeze, the only way out will be an emergency shutdown of the computer. Turn off the navigation mesh in the map compilation window!
Warning.pngWarning:There are problems with Floating point precision. Polygons start behaving incorrectly if you are too far from the zero coordinates (faint defects start after crossing 8 km, and are extremely noticeable after 20 km)

Programming

ActionGraph Example

S&box user content is programmed with C#, Microsoft's managed, object-oriented programming language of .NET fame. S&box includes an API which provides bindings to the underlying Source 2 engine and to Facepunch's middleware. All code in user content is distributed in source form, which S&box later compiles on-demand with Roslyn. Language support is stated to permit C# 11, indicating that S&box requires a .NET 9.0.0 runtime in order to function, which is bundled with the sbox installation. Only a specific subset of the baseline .NET Core complement is available for use.

Security is a primary concern with user content. C# and its ubiquitous pairing with .NET is a software ecosystem many magnitudes larger, more complex, and more powerful than s&box or Source 2. Awarding unchecked access to this leviathan would effectively turn user content into fully-fledged applications with potentially unlimited access to the host computer. To this end, s&box restricts the use of certain types and namespaces. For example, access to the local file system is only available through a sanctioned abstraction layer; System.IO.File and similar types may not be used. This practice is common among applications which attempt to distill down .NET into a limited "scripting" platform for untrusted user code.

Currently, the C# API and tools are in a preview stage of development. Breaking changes happen often and the API is not yet complete.

Todo: 
  • Confirm exact subset of available .NET Core components.
  • Confirm whether S&box requires a typical .NET Core installation or if it includes a self-contained runtime.

There are many similarities between the use of C# in S&box and the use of the more primitive Lua language in Garry's Mod Garry's Mod. Many concepts of Gmod's Lua environment have been carried over, including limited access to the language's features and "hot reloading" of edited code.

S&box will also have a visual scripting solution called ActionGraph, which enables a developer to script events via nodes.

Shaders

Shadergraph UV Rotation Example

You can create your own shaders either through HLSL or through the provided Shadergraph Editor and customize their interface for the material editor.

S&box supports HLSL 2021 & Shader Model 3.0 up to 5.0.

Todo: Add more detailed information for the shader graph editor.

External links

For Developers


Other