Skip to content

Commit

Permalink
Merge pull request #186 from stride3d/master
Browse files Browse the repository at this point in the history
Publishing recent docs updates
  • Loading branch information
VaclavElias authored Oct 31, 2023
2 parents 19d187c + 0221972 commit c0a6b80
Show file tree
Hide file tree
Showing 13 changed files with 159 additions and 129 deletions.
2 changes: 1 addition & 1 deletion en/diagnostics/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Stride.Core.CompilerServices contains Roslyn code analyzers.

> [!IMPORTANT]
> These analyzers do not perform any kind of telemetry. The same analyzers get used by your IDE when you get a CSXXXX diagnostic.
> Analyzers are offline tools used by the compiler to assist programmers. They are not used to collect telemetry on how Stride is being used. These same analyzers are also utilized by your IDE to generate CSXXXX diagnostics.
They analyze the code for possible issues in your project with the Stride.Core design.
To avoid unexpected runtime/compile time/editor time behaviour these analyzers try to warn as soon as possible for issues that may occur.
Expand Down
48 changes: 9 additions & 39 deletions en/manual/engine/entity-component-model/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,7 @@ The three parts of "Entity Component System" map to the following classes:

## Minimal Setup

A component can be defined by deriving a class from `EntityComponent`.

By adding the attribute `DefaultEntityComponentProcessor` to an `EntityComponent`,
an `EntityProcessor` can be assigned to it. This will automatically set up and run
the `EntityProcessor` if the `EntityComponent` is in the scene.

An `EntityComponent` also needs to indicate that it can be serialized
by adding the attribute `DataContract` to it.

A system can be defined by deriving a class from `EntityProcessor`.
A component can be defined by deriving a class from `EntityComponent`. By adding the attribute `DefaultEntityComponentProcessor` to an `EntityComponent`, an `EntityProcessor` can be assigned to it. This will automatically set up and run the `EntityProcessor` if the `EntityComponent` is in the scene. An `EntityComponent` also needs to indicate that it can be serialized by adding the attribute `DataContract` to it. A system can be defined by deriving a class from `EntityProcessor`.


### Code
Expand Down Expand Up @@ -50,11 +41,8 @@ public class MyProcessor : EntityProcessor<MyComponent>
```

### Additional Note
An `EntityComponent` can currently not be drag-dropped onto an entity in Game Studio.
It has to be added by selecting an entity, and then clicking the "Add component" button
in the property grid.

Alternatively, this can also be done in [code via `entity.Add(entityComponent)`](https://doc.stride3d.net/latest/en/api/Stride.Engine.Entity.html#Stride_Engine_Entity_Add_Stride_Engine_EntityComponent_).
An `EntityComponent` can currently not be drag-dropped onto an entity in Game Studio. It has to be added by selecting an entity, and then clicking the **Add component** button
in the **Property grid**. Alternatively, this can also be done in [code via `entity.Add(entityComponent)`](https://doc.stride3d.net/latest/en/api/Stride.Engine.Entity.html#Stride_Engine_Entity_Add_Stride_Engine_EntityComponent_).


## Advanced Features
Expand All @@ -68,27 +56,20 @@ By adding the `Display` attribute, a nicer name can be shown in Game Studio.
```

#### ComponentCategory
By default, your components will be listed in the category "Miscellaneous".
By adding the `ComponentCategory` attribute, a different category can be chosen.
If the chosen name does not exist yet, it will be added to the list in Game Studio.
By default, your components will be listed in the category "Miscellaneous". By adding the `ComponentCategory` attribute, a different category can be chosen. If the chosen name does not exist yet, it will be added to the list in Game Studio.
```csharp
[ComponentCategory("My own components")]
```

#### ComponentOrder
By adding the `ComponentOrder` attribute, the order in which
components are listed in Game Studio can be changed.
By adding the `ComponentOrder` attribute, the order in which components are listed in Game Studio can be changed.
```csharp
[ComponentOrder(2001)]
```


### Component Combinations
By passing the types of other components to the `EntityProcessor` constructor,
it will only include entities _that also have those other components_.

For example, the following `EntityProcessor` is for `MyComponent`, but will skip any entity
that does not also have both `TransformComponent` and `AnimationComponent` on it.
By passing the types of other components to the `EntityProcessor` constructor, it will only include entities _that also have those other components_. For example, the following `EntityProcessor` is for `MyComponent`, but will skip any entity that does not also have both `TransformComponent` and `AnimationComponent` on it.

```csharp
public class MyProcessor : EntityProcessor<MyComponent>
Expand All @@ -101,26 +82,15 @@ public class MyProcessor : EntityProcessor<MyComponent>


### Non-default Processors
Adding processors for a type of component via the attribute `DefaultEntityComponentProcessor`
has been explained above. However, as the name implies, this is for the _default_ processor.
Non-default processors can also be added via
Adding processors for a type of component via the attribute `DefaultEntityComponentProcessor` has been explained above. However, as the name implies, this is for the _default_ processor. Non-default processors can also be added via
```csharp
SceneSystem.SceneInstance.Processors.Add(entityProcessor);
```


### Separation of EntityComponent and Data

`EntityProcessor<TComponent>` is a shortcut for `EntityProcessor<TComponent, TComponent>`.

By explicitly using `EntityProcessor<TComponent, TData>` instead, a different type can be chosen
for the actual data. This way, the `EntityComponent` can e.g. have "heavier" startup data and
references, while the data object that needs to be processed every frame can be kept small.

This will require overriding a method `GenerateComponentData`, which produces a `TData` instance
from a `TComponent` instance.
`EntityProcessor<TComponent>` is a shortcut for `EntityProcessor<TComponent, TComponent>`. By explicitly using `EntityProcessor<TComponent, TData>` instead, a different type can be chosen for the actual data. This way, the `EntityComponent` can e.g. have "heavier" startup data and references, while the data object that needs to be processed every frame can be kept small. This will require overriding a method `GenerateComponentData`, which produces a `TData` instance from a `TComponent` instance.

### Overrides
`EntityProcessor` also provides several methods which can be overridden in order to react to certain events.
They are not overly complicated, so that their usage should be clear from their doc comments.

`EntityProcessor` also provides several methods which can be overridden in order to react to certain events. They are not overly complicated, so that their usage should be clear from their doc comments.
6 changes: 3 additions & 3 deletions en/manual/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ These pages contain information about how to use Stride, an open-source C# game
## Latest documentation

### Recent updates

- <span class="badge text-bg-success">New</span> [Serialization](scripts/serialization.md) - Serialization explained
- <span class="badge text-bg-info">Updated</span> [Public properties and fields](scripts/public-properties-and-fields.md) - Content improvements and additions
- <span class="badge text-bg-info">Updated</span> [Linux - Setup and requirements](platforms/linux/setup-and-requirements.md) - Fedora OS option added
- <span class="badge text-bg-success">New</span> [Scripts - Serialization](scripts/serialization.md) - Serialization explained
- <span class="badge text-bg-info">Updated</span> [Scripts - Public properties and fields](scripts/public-properties-and-fields.md) - Content improvements and additions
- <span class="badge text-bg-info">Updated</span> [Stride for Unity® developers](stride-for-unity-developers/index.md) - Content improvements

### Previous updates
Expand Down
45 changes: 36 additions & 9 deletions en/manual/platforms/linux/setup-and-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,40 +11,67 @@ You will also need a Windows PC to build your projects for Linux using Game Stud
You need the following packages:

* [FreeType](#freetype)

* [OpenAL](#openal)

* [SDL2](#sdl2)

* either Mono or .NET Core (it's OK to install both)

## FreeType

To render fonts, we use the [FreeType](https://www.freetype.org/) library. The minimum required version is 2.6 and can be installed via:

```
### [Ubuntu](#tab/freetype-ubuntu)

```bash
sudo apt-get install libfreetype6-dev
```

### [Fedora](#tab/freetype-fedora)

```bash
sudo dnf install freetype-devel
```

---

## OpenAL

To play sounds and music, we use the [OpenAL](https://www.openal.org/) library. It can be installed via:

```
### [Ubuntu](#tab/openal-ubuntu)

```bash
sudo apt-get install libopenal-dev
```

### [Fedora](#tab/openal-fedora)

```bash
sudo dnf install openal-soft-devel
```

---

## SDL2

To run games on Linux, we use the [SDL2](https://www.libsdl.org/) library which provides the ability to create windows, handle mouse, keyboard and joystick events. The minimum required version is 2.0.4 and can be installed via:

```
### [Ubuntu](#tab/sdl2-ubuntu)

```bash
sudo apt-get install libsdl2-dev
```

### .NET Core
### [Fedora](#tab/sdl2-fedora)

```bash
sudo dnf install SDL2-devel
```

---

## .NET Core

For information about how to install .NET Core, see the [.NET Core instructions for Debian/Ubuntu](https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore2x).
For information about how to install .NET Core, see the [.NET Core instructions for Linux](https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites).

Make sure version 2.1.300+ and runtime 2.1+ is installed. To check which version you have installed, type:

Expand All @@ -54,4 +81,4 @@ dotnet --info

## See also

* * [Create a Linux game](create-a-linux-game.md)
* [Create a Linux game](create-a-linux-game.md)
13 changes: 12 additions & 1 deletion en/manual/stride-for-godot-developers/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,25 @@

## Editor

The Stride editor is **Game Studio**.

![Godot layout](media/stride-vs-godot-godotlayout.webp)

![Stride Game Studio layout](media/stride-vs-godot-stridelayout.webp)

You can customize the Game Studio layout by dragging tabs, similar to Visual Studio.

For more information about Game Studio, see the [Game Studio](../game-studio/index.md) page.


## Terminology

| Godot | Stride |
|-------|--------|
| Scene | Entity Tree |
| Inspector | Property Grid |
| FileSystem | Solution/Asset View |
|Scene view | Scene Editor |
| Scene view | Scene Editor |
| Node | Entity |
| Node Script | SyncScript, AsyncScript, StartupScript |
| Export | Serialize/DataMember |
Expand Down
Git LFS file not shown
Git LFS file not shown
Loading

0 comments on commit c0a6b80

Please sign in to comment.