Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@
*.docx filter=lfs diff=lfs merge=lfs -text
*.webp filter=lfs diff=lfs merge=lfs -text
*.vsdx filter=lfs diff=lfs merge=lfs -text
*.svg filter=lfs diff=lfs merge=lfs -text
15 changes: 0 additions & 15 deletions en/manual/engine/package.md

This file was deleted.

7 changes: 0 additions & 7 deletions en/manual/engine/project.md

This file was deleted.

41 changes: 3 additions & 38 deletions en/manual/extensibility/csharp-libraries.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,3 @@
# C# Libraries

<span class="badge text-bg-primary">Advanced</span>
<span class="badge text-bg-success">Programmer</span>

If you want to share code between multiple projects or create reusable components, you can create a C# library and reference it in your Stride project.

If your library uses the @Stride.Core.DataContractAttribute and you want to reference it through a **NuGet** package, there are additional steps required to make it compatible with Stride.

## Adding a Module Initializer

First, add a module initializer to your library. This ensures your library is properly registered with Stride's serialization system.

Example `Module.cs`:

```csharp
using Stride.Core.Reflection;
using System.Reflection;

namespace MyProjectName;

internal class Module
{
[ModuleInitializer]
public static void Initialize()
{
AssemblyRegistry.Register(typeof(Module).GetTypeInfo().Assembly, AssemblyCommonCategories.Assets);
}
}
```

## Updating to the Latest Stride NuGet Packages

If your library references any Stride NuGet packages, you must recompile it with the latest version of those packages. This ensures compatibility with the current Stride ecosystem.

## About the Module Initializer Attribute

The `ModuleInitializer` attribute is now generated using a Roslyn source generator. This means the file `sources/core/Stride.Core.CompilerServices/Generators/ModuleInitializerGenerator.cs` must run during your code's compilation. Otherwise, the module initializer and potentially other source generators added in the future will not function correctly.
---
redirect_url: ../files-and-folders/project-packages/index.html
---
10 changes: 3 additions & 7 deletions en/manual/extensibility/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# Extensibility

## Introduction

Stride game project is a regular .NET project, and as such, it can be extended by a regular C# library. This is a great way to share code between multiple projects, or to create reusable components.

Read more about this subject in [C# Libraries](csharp-libraries.md).
---
redirect_url: ../files-and-folders/project-packages/index.html
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Build file structure

<span class="badge text-bg-primary">Intermediate</span>

This page explains the file structure of a built Stride game.

## Overview

By default, all builds are located in the **Bin** directory. It contains multiple sub-directories that categorize builds based on their configuration and platform.

When building the Release version of the game, the actual published files **aren't located in the standard directory**, but in it's subdirectory called **publish**.

![](media/build-file-structure-publish-subdirectory.webp)

> [!NOTE]
> The build location can be configured. For more information visit the [setup page](setup.md).

## Contents of the build folder

> [!NOTE]
> Depending on [your setup](setup.md), some of these files might not be generated.

The build folder contains the following files:

* **MyGame.PlatformName** - the executable. It's file extension depends on the platform (eg. `.exe` on Windows).
* **data** - folder containing asset bundles.
* **`.dll` and `.so` files** - libraries used by the game. They can be embedded in the executable itself, in order to declutter the folder.
* **`.json` files** - contain information needed to launch the game. Depending on the configuration, they might not be needed and won't be generated.

Additionally, there are also these files, that don't need to be included with the game.

* **createdump.exe** - application for capturing information about a crash.
* **`.pdb` files** - they contain debug information, used for attaching a debugger (using breakpoints), creating more detailed logs or helping players make mods more easily. For more information, read the [Microsoft article](https://learn.microsoft.com/en-us/visualstudio/debugger/specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger).
* **`.xml` files** - they contain generated documentation for every package in your project. For more information, read the [Microsoft article](https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/tutorials/xml-documentation).

## See also:

* [Setup](setup.md)
* [Cleaning up](cleaning-up.md)
* [Specifying symbol (.pdb) and source files in the Visual Studio debugger](https://learn.microsoft.com/en-us/visualstudio/debugger/specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger)
* [Tutorial: Create XML documentation](https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/tutorials/xml-documentation)
43 changes: 43 additions & 0 deletions en/manual/files-and-folders/building-the-game/building.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Building

<span class="badge text-bg-primary">Beginner</span>

Currently, release versions of Stride games cannot be built using **Game Studio**. Instead, you can use your **IDE** or **the command line**.

> [!TIP]
> It's recommended to first delete everything in the [publish directory](setup.md#the-output-directory) to cleanup any unused folders.

## [Visual Studio](#tab/visual-studio)

1. Make sure to setup your game properly. For more information, visit [this page](setup.md).

2. In the **Solution Explorer** panel, right click on the platform package you want to build and select **Publish**.

![](media/visual-studio-publish-context-menu.webp)

3. In the newly opened tab, click the **Publish** button.

![](media/visual-studio-publish-button.webp)

4. Once the application finishes building, click the **Navigate** button to open the folder containing your build.

![](media/visual-studio-publish-navigate.webp)

## [Command line](#tab/command-line)

1. Make sure to setup your game properly. For more information, visit [this page](setup.md).

2. Use the `dotnet` command in order to publish the game (build a release version).

```bash
dotnet publish Path/To/Project/Package
```

---

## See also

* [Setup](setup.md)
* [Cleaning up](cleaning-up.md)
* [Cleaning up](distributing.md)
* [Build file structure](build-file-structure.md)
37 changes: 37 additions & 0 deletions en/manual/files-and-folders/building-the-game/cleaning-up.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Cleaning up

<span class="badge text-bg-primary">Beginner</span>

The build process generates additional [files that aren't necessary for the game to work](build-file-structure.md). This page explains how to clean them up in order to not clutter your game's files.

## Files to delete

* **Empty folders** - sometimes created by the build process.
* **`.pdb` files** - information used for debugging.
* **`.xml` files** - the generated code documentation.

## Automatic cleanup

You can setup the build process to automatically delete the unnecessary files after publishing. Just add the below to the `.csproj` file of the platform package:

```xml
<Project Sdk="Microsoft.NET.Sdk">

...

<Target Name="CleanupPublish" AfterTargets="Publish">
<ItemGroup>
<FilesToCleanup Include="$(PublishDir)/*.xml;$(PublishDir)/*.pdb"/>
</ItemGroup>
<Delete Files="@(FilesToCleanup)"/>
</Target>
</Project>
```

**Explanation** <br/>
After you publish the game, the **Cleanup Publish** target will be executed. It first defines a list of `.xml` and `.pdb` files located in the publish directory and stores them in a new property called **FilesToCleanup**. Then the [Delete](https://learn.microsoft.com/en-us/visualstudio/msbuild/delete-task) task goes over that list and deletes them.

## See also

* [Target element (MSBuild)](https://learn.microsoft.com/en-us/visualstudio/msbuild/target-element-msbuild)
* [Build file structure](build-file-structure.md)
37 changes: 37 additions & 0 deletions en/manual/files-and-folders/building-the-game/distributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Distributing

<span class="badge text-bg-primary">Beginner</span>

This page contains information about how to distribute a game made with Stride.

## Requirements

In order to run, Stride games require a user to have the following installed:

### Windows

* Windows 10 or newer
* .NET 10 Runtime (unless the game was published as [self contained](setup.md#self-contained))
* Visual C++ 2015 runtimes

### Linux

* .NET 10 Runtime (unless the game was published as [self contained](setup.md#self-contained))
* FreeType (for installation instructions, visit the [Linux page](../../platforms/linux/setup-and-requirements.md#freetype))
* OpenAL (for installation instructions, visit the [Linux page](../../platforms/linux/setup-and-requirements.md#openal))
* SDL2 (for installation instructions, visit the [Linux page](../../platforms/linux/setup-and-requirements.md#sdl2))
* FreeImage (for installation instructions, visit the [Linux page](../../platforms/linux/setup-and-requirements.md#freeimage))
* Vulkan or OpenGL (depending on the graphics API used by your game)

> [!NOTE]
> This page doesn't contain information for all platforms. If you want to expand it, consider [contributing to the documentation](../../../contributors/documentation/index.md).

## Steam and Proton

Proton is a compatibility layer used by [Steam](https://store.steampowered.com), that allows players to run games built for **Windows** on machines running **Linux**.

**Stride games aren't as well supported by Proton as games made for other engines**. It's possible that an update to Stride or the compatibility layer might break your game. To make sure it runs properly on Linux, consider **creating a native build for that platform**.

## See also

* [Cleaning up](cleaning-up.md)
30 changes: 30 additions & 0 deletions en/manual/files-and-folders/building-the-game/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Building the game

<span class="badge text-bg-primary">Beginner</span>

In order to turn the uncompiled project into an executable application, it has to be **built** first.

For it's build system, Stride uses [MSBuild](https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild). It's a powerful platform that's used by most C# projects.

> [!NOTE]
> Currently, it's not possible to build the final version of the game using **Game Studio**.

## Configurations

Games can be built using one of two different configurations:
* **Debug** - used for testing and debugging, allows you to connect a debugger to create break points and inspect the game while it's running.
* **Release** - used for creating the final version of the game.

When you launch the game from **Game Studio** or your **IDE**, it gets built in the **Debug** configuration.

## What is publishing?

**Publishing** refers to the process of creating the final version of the game made for distribution.

## In this section

* [Setup](setup.md)
* [Building](building.md)
* [Cleaning up](cleaning-up.md)
* [Build file structure](build-file-structure.md)
* [Distributing](distributing.md)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading