Stride Game Engine Documentation

repository·master·Indexed 27 days ago

https://github.com/stride3d/stride

An open-source, modular C# game engine for realistic rendering and VR, featuring the Game Studio visual editor. Documentation covers the asset pipeline (design-time, build-time, and runtime), editor framework architecture including undo/redo and selection history, and management of core dependencies such as astcenc, BulletPhysics, FreeType, CppNet, and Gettext.Net.

Tokens
35.9K
Snippets
53
Records
189
Agent score
92%

What's inside Stride

  1. Overview of Stride source modules

    master

    The Stride repository is organized into several functional areas:

    core

    • Stride.Core: Reference counting, dependency property system (PropertyContainer/PropertyKey), low-level serialization, and low-level memory operations (Utilities and NativeStream).
    • Stride.Core.Mathematics: Mathematics library.
    • Stride.Core.IO: Virtual File System.
    • Stride.Core.Serialization: High-level serialization and git-like CAS storage system.
    • Stride.Core.MicroThreading: Micro-threading library based on C# 5.0 async.
    • Stride.Core.AssemblyProcessor: Internal tool for patching assemblies (Serialization auto-generation, memory/pinning operations, module initializers).

    presentation

    • Stride.Core.Presentation: WPF UI library (themes, controls like propertygrid, behaviors).
    • Stride.Core.Quantum: Advanced ViewModel library for synchronizing view-models over a network with diffs.

    buildengine

    • Stride.Core.BuildEngine.Common: Reusable parts for adding build steps, commands, or custom build engine clients.
    • Stride.Core.BuildEngine: Default implementation of the build engine tool executable.

    shader

    • Irony: Parsing library used by Stride.Core.Shaders.
    • Stride.Core.Shaders: Shader parsing, type analysis, and conversion (HLSL->GLSL and Stride Shader Language).
    • Irony.GrammarExplorer: Language syntax tester for Stride Shading Language (SDSL).
  2. Overview of astcenc in Stride

    master
    astcenc is the ARM ASTC-encoder used by the Stride asset compiler for mobile (Android / iOS) targets. It provides ASTC texture compression. The library is provided as pre-compiled binaries for the desktop host RIDs where the asset compiler runs, rather than being built during the standard Stride build process to avoid requiring extra toolchains (CMake + C++17) from contributors.
  3. Overview of SDSL (Stride Shading Language)

    master

    SDSL is a shader language designed for the Stride game engine. It is a superset of the HLSL Shading language that introduces higher-level language constructions to improve shader development through:

    • Extensibility: Uses object-oriented programming concepts like classes, inheritance, and composition to extend shaders.
    • Modularity: Provides modular shaders focused on single rendering techniques for easier management.
    • Reusability: Maximizes code reuse across different shaders.
  4. Overview of Stride Core Libraries

    master
    The Stride.Core libraries provide the low-level abstractions and base implementations for the Stride engine. This includes core systems for serialization, mathematics, threading, I/O, and reflection. Most Stride projects reference Stride.Core to access these fundamental engine services.
  5. Overview of the Quantum Introspection Framework

    master

    Quantum is Stride's graph-based introspection framework. It wraps .NET object hierarchies into a typed node graph that serves as the single source of truth for:

    • Property grid display
    • Undo/redo
    • Asset override tracking (e.g., the 'bold = overridden' behavior in prefab/archetype workflows)
  6. Overview of Stride MSBuild SDK Packages

    master

    Stride provides three MSBuild SDK packages that contain the build logic for all Stride projects. These packages handle platform detection, target frameworks, graphics API multi-targeting, assembly processing, and native dependencies.

    • Stride.Build.Sdk: The base SDK for all projects.
    • Stride.Build.Sdk.Editor: Composes Stride.Build.Sdk and adds editor framework properties.
    • Stride.Build.Sdk.Tests: Composes Stride.Build.Sdk.Editor and adds xunit, test infrastructure, launcher code, and asset compilation.
  7. Overview of Stride.Core.AssemblyProcessor functionality

    master

    The Stride.Core.AssemblyProcessor is a post-build tool that patches compiled assemblies to provide the following features:

    • Serialization code generation: Automatically generates binary serializers for types marked with the [DataContract] attribute.
    • Module initializers: Registers serializers and other components at assembly load time.
    • Parameter keys: Processes ParameterKey fields required by the shader and rendering systems.
  8. Understand the Stride Quantum Graph Model

    master
    The Stride.Core.Quantum library builds a live, typed graph over .NET object hierarchies. Every property and collection item is represented as a node. To ensure change notifications fire and undo/redo systems work correctly, all reads and writes must be performed through the graph rather than directly on the underlying objects.
  9. Understand the BulletPhysics dependency structure

    master

    The BulletPhysics folder contains the core components required for the Stride.Physics assembly to function. It consists of:

    • libbulletc.*: The underlying Bullet C++ library. There is a compiled version for each supported platform and architecture.
    • BulletSharp.NetStandard.dll: The C# wrapper for the C++ library.
      • For iOS, use the specific DLL located within the /iOS directory.
      • For all other platforms, use the standard DLL.

    Note: A specific DLL is required for iOS due to platform-specific constraints.

  10. Understand the Asset Override Model

    master

    In derived assets (like prefabs), properties exist in one of three states:

    1. Inherited: The value is taken from the base asset. Changes to the base propagate here. (Visualized as normal weight, italic).
    2. Overridden: The value was explicitly set on the derived asset, shadowing the base. (Visualized as bold).
    3. No base: The asset has no base, or the property has no base equivalent. (Visualized as normal weight).

    To restore an overridden value to its inherited state via the UI, the ResetOverride() method on IAssetNodePresenter is used. Internally, this triggers ResetOverrideRecursively() on the graph node, which resets the node and all its descendants.

  11. Locate and extend Stride Asset Editors

    master

    All concrete asset editors in Stride are located in the Stride.Assets.Presentation project under sources/editor/Stride.Assets.Presentation/AssetEditors/.

    Most editors follow a structure with ViewModels/ and Views/ subdirectories. Exceptions include ScriptEditor and VisualScriptEditor, where files are located directly at the folder root.

    Use the following mapping to find specific editor implementations:

    EditorAsset typeBase classGame viewport
    SpriteSheetEditorViewModelSpriteSheetAssetAssetEditorViewModelNo
    SceneEditorViewModelSceneAssetEntityHierarchyEditorViewModelYes
    PrefabEditorViewModelPrefabAssetEntityHierarchyEditorViewModelYes
    UIPageEditorViewModelUIPageAssetAssetCompositeHierarchyEditorViewModelYes
    UILibraryEditorViewModelUILibraryAssetAssetCompositeHierarchyEditorViewModelYes
    GraphicsCompositorEditorViewModelGraphicsCompositorAssetAssetEditorViewModelNo
    ScriptEditorViewModelScript assetsAssetEditorViewModelNo
    VisualScriptEditorViewModelVisualScriptAssetAssetEditorViewModelNo