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

s&box

From Valve Developer Community
Jump to navigation Jump to search
English (en)Français (fr)Русский (ru)中文 (zh)Translate (Translate)

Stub

This article or section is a stub. You can help by adding to 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, DirectX 11 compatible.
  • 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 s&box 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.
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

UGC Content Distribution

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

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
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