Skip to content

Commit a5d21b2

Browse files
authored
Rewrite of the files and folders section (#491)
* Initial work on rewriting the files and folders section * Fixed incorrect yaml on package pages * Added external packages pages * Removed incorrect information from cached files * Fixed errors * Added the building section * Updated files and folders index * Added a mention of the compiller app to creating a package * Added automatic cleanup to the build cleanup page * Fixed errors * Added redirecting to unused pages * Removed engine package page to avoid conflicting search results * Fixed problems with confusing naming + others * Added a note about custom nuget hosts * Removed the engine project page * Added file structure visualizations * Removed broken image * Added platform packages image * Added dependency visualizations * Finished docs * Added badges * Updated gitattributes * Removed the proton not working check, since it might be working * Fixed a lot of errors * Updataed gitignore * Minor fixes
1 parent 7932481 commit a5d21b2

95 files changed

Lines changed: 1218 additions & 477 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@
1919
*.docx filter=lfs diff=lfs merge=lfs -text
2020
*.webp filter=lfs diff=lfs merge=lfs -text
2121
*.vsdx filter=lfs diff=lfs merge=lfs -text
22+
*.svg filter=lfs diff=lfs merge=lfs -text

en/manual/engine/package.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

en/manual/engine/project.md

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,3 @@
1-
# C# Libraries
2-
3-
<span class="badge text-bg-primary">Advanced</span>
4-
<span class="badge text-bg-success">Programmer</span>
5-
6-
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.
7-
8-
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.
9-
10-
## Adding a Module Initializer
11-
12-
First, add a module initializer to your library. This ensures your library is properly registered with Stride's serialization system.
13-
14-
Example `Module.cs`:
15-
16-
```csharp
17-
using Stride.Core.Reflection;
18-
using System.Reflection;
19-
20-
namespace MyProjectName;
21-
22-
internal class Module
23-
{
24-
[ModuleInitializer]
25-
public static void Initialize()
26-
{
27-
AssemblyRegistry.Register(typeof(Module).GetTypeInfo().Assembly, AssemblyCommonCategories.Assets);
28-
}
29-
}
30-
```
31-
32-
## Updating to the Latest Stride NuGet Packages
33-
34-
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.
35-
36-
## About the Module Initializer Attribute
37-
38-
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.
1+
---
2+
redirect_url: ../files-and-folders/project-packages/index.html
3+
---

en/manual/extensibility/index.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# Extensibility
2-
3-
## Introduction
4-
5-
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.
6-
7-
Read more about this subject in [C# Libraries](csharp-libraries.md).
1+
---
2+
redirect_url: ../files-and-folders/project-packages/index.html
3+
---
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Build file structure
2+
3+
<span class="badge text-bg-primary">Intermediate</span>
4+
5+
This page explains the file structure of a built Stride game.
6+
7+
## Overview
8+
9+
By default, all builds are located in the **Bin** directory. It contains multiple sub-directories that categorize builds based on their configuration and platform.
10+
11+
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**.
12+
13+
![](media/build-file-structure-publish-subdirectory.webp)
14+
15+
> [!NOTE]
16+
> The build location can be configured. For more information visit the [setup page](setup.md).
17+
18+
## Contents of the build folder
19+
20+
> [!NOTE]
21+
> Depending on [your setup](setup.md), some of these files might not be generated.
22+
23+
The build folder contains the following files:
24+
25+
* **MyGame.PlatformName** - the executable. It's file extension depends on the platform (e.g. `.exe` on Windows).
26+
* **data** - folder containing asset bundles.
27+
* **`.dll` and `.so` files** - libraries used by the game. They can be embedded in the executable itself, in order to declutter the folder.
28+
* **`.json` files** - contain information needed to launch the game. Depending on the configuration, they might not be needed and won't be generated.
29+
30+
Additionally, there are also these files, that don't need to be included with the game.
31+
32+
* **createdump.exe** - application for capturing information about a crash.
33+
* **`.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).
34+
* **`.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).
35+
36+
## See also:
37+
38+
* [Setup](setup.md)
39+
* [Cleaning up](cleaning-up.md)
40+
* [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)
41+
* [Tutorial: Create XML documentation](https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/tutorials/xml-documentation)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Building
2+
3+
<span class="badge text-bg-primary">Beginner</span>
4+
5+
Currently, release versions of Stride games cannot be built using **Game Studio**. Instead, you can use your **IDE** or the **command line**.
6+
7+
> [!TIP]
8+
> It's recommended to first delete everything in the [publish directory](setup.md#the-output-directory) to cleanup any unused folders.
9+
10+
## [Visual Studio](#tab/visual-studio)
11+
12+
1. Make sure to setup your game properly. For more information, visit [this page](setup.md).
13+
14+
2. In the **Solution Explorer** panel, right click on the platform package you want to build and select **Publish**.
15+
16+
![](media/visual-studio-publish-context-menu.webp)
17+
18+
3. In the newly opened tab, click the **Publish** button.
19+
20+
![](media/visual-studio-publish-button.webp)
21+
22+
4. Once the application finishes building, click **Navigate** to open the folder containing your build.
23+
24+
![](media/visual-studio-publish-navigate.webp)
25+
26+
## [Command line](#tab/command-line)
27+
28+
1. Make sure to setup your game properly. For more information, visit [this page](setup.md).
29+
30+
2. Use the `dotnet` command in order to publish the game (build a release version).
31+
32+
```bash
33+
dotnet publish Path/To/Project/Package
34+
```
35+
36+
---
37+
38+
## See also
39+
40+
* [Setup](setup.md)
41+
* [Cleaning up](cleaning-up.md)
42+
* [Cleaning up](distributing.md)
43+
* [Build file structure](build-file-structure.md)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Cleaning up
2+
3+
<span class="badge text-bg-primary">Beginner</span>
4+
5+
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.
6+
7+
## Files to delete
8+
9+
* **Empty folders** - sometimes created by the build process.
10+
* **`.pdb` files** - information used for debugging.
11+
* **`.xml` files** - the generated code documentation.
12+
13+
## Automatic cleanup
14+
15+
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.
16+
17+
```xml
18+
<Project Sdk="Microsoft.NET.Sdk">
19+
20+
...
21+
22+
<Target Name="CleanupPublish" AfterTargets="Publish">
23+
<ItemGroup>
24+
<FilesToCleanup Include="$(PublishDir)/*.xml;$(PublishDir)/*.pdb"/>
25+
</ItemGroup>
26+
<Delete Files="@(FilesToCleanup)"/>
27+
</Target>
28+
</Project>
29+
```
30+
31+
**Explanation** <br/>
32+
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 all of it's items.
33+
34+
## See also
35+
36+
* [Target element (MSBuild)](https://learn.microsoft.com/en-us/visualstudio/msbuild/target-element-msbuild)
37+
* [Build file structure](build-file-structure.md)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Distributing
2+
3+
<span class="badge text-bg-primary">Beginner</span>
4+
5+
This page contains information about how to distribute a game made with Stride.
6+
7+
## Requirements
8+
9+
In order to run, Stride games require a user to have the following installed:
10+
11+
### Windows
12+
13+
* Windows 10 or newer
14+
* .NET 10 Runtime (unless the game was published as [self contained](setup.md#self-contained))
15+
* Visual C++ 2015 runtimes
16+
17+
### Linux
18+
19+
* .NET 10 Runtime (unless the game was published as [self contained](setup.md#self-contained))
20+
* FreeType (for installation instructions, visit the [Linux page](../../platforms/linux/setup-and-requirements.md#freetype))
21+
* OpenAL (for installation instructions, visit the [Linux page](../../platforms/linux/setup-and-requirements.md#openal))
22+
* SDL2 (for installation instructions, visit the [Linux page](../../platforms/linux/setup-and-requirements.md#sdl2))
23+
* FreeImage (for installation instructions, visit the [Linux page](../../platforms/linux/setup-and-requirements.md#freeimage))
24+
* Vulkan or OpenGL (depending on the graphics API used by your game)
25+
26+
> [!NOTE]
27+
> This page doesn't contain information for all platforms. If you want to expand it, consider [contributing to the documentation](../../../contributors/documentation/index.md).
28+
29+
## Steam and Proton
30+
31+
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**.
32+
33+
**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**.
34+
35+
## See also
36+
37+
* [Cleaning up](cleaning-up.md)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Building the game
2+
3+
<span class="badge text-bg-primary">Beginner</span>
4+
5+
In order to turn the uncompiled project into an executable application, it has to be **built** first.
6+
7+
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.
8+
9+
> [!NOTE]
10+
> Currently, it's not possible to build the final version of the game using **Game Studio**.
11+
12+
## Configurations
13+
14+
Games can be built using one of two different configurations:
15+
* **Debug** - used for testing and debugging, allows you to connect a debugger to create break points and inspect the game while it's running.
16+
* **Release** - used for creating the final version of the game.
17+
18+
When you launch a game from **Game Studio** or your **IDE**, it gets built in the **Debug** configuration.
19+
20+
## What is publishing?
21+
22+
**Publishing** refers to the process of creating the final version of the game made for distribution.
23+
24+
## In this section
25+
26+
* [Setup](setup.md)
27+
* [Building](building.md)
28+
* [Cleaning up](cleaning-up.md)
29+
* [Build file structure](build-file-structure.md)
30+
* [Distributing](distributing.md)

0 commit comments

Comments
 (0)