Browse Source

Update according to comments

Raphael Schmitz 2 years ago
parent
commit
d77bf9a2a2

+ 31 - 22
en/manual/engine/entity-component-model/index.md

@@ -1,38 +1,47 @@
-# Entity-Component Model
+# ECS (Entity Component System) Introduction
 
 
-<div class="doc-incomplete"/>
+# Problem
+> `Dog` is a subclasses of `Animal`.
 
 
-# Overview
+This example is often used as an example of inheritance
+in introductions to programming. However, when things get more complex,
+we get problems:
+- `Dog` and `Fish` can swim, so we create `SwimmingAnimal` as a class in between
+- `Bee` and `Bird` can fly, so we create `FlyingAnimal`
+- What do we now do with the `Duck`, who can do both?
 
 
-@'Stride.Engine.Entity' is the base class for objects that are managed by the high-level engine.
+We have the exact same problem in video games.  
+Enemies can walk, shoot, fly - but not all of them can do everything.  
+Even something basic like hitpoints is not universal, as some enemies are indestructible.
 
 
-To improve flexibility, entity are component-based: they can contains as many components as required, containing data and/or logic.
+# Solution
 
 
 
 
+> Entity component system (ECS) is a software architectural pattern mostly used in video game development for the representation of game world objects. An ECS comprises entities composed from components of data, with systems which operate on entities' components.  
+> _-[Wikipedia](https://en.wikipedia.org/wiki/Entity_component_system)_
 
 
 
 
-![media/7438980.png](media/7438980.png) 
+The general idea of an ECS is that an _entity_ - an "object" in your virtual world -
+does not really do anything. It is mostly just a "bag of components".
 
 
+The selection of components on an entity decides what it does.
+An entity with a collider component can collide, an entity with a sound component can make a noise, etc.
 
 
+## Differing opinions
 
 
+For the "System" part of the term, there are two interpretations:
 
 
-A @'Stride.Engine.Entitycomponent' is tied to its entity (that is, one component can't be added to two entities at the same time).
+A) "Entity-and-Component System"  
+...in which the components contain the data they need, and also the functionality that works with that data.
 
 
-# How to create an entity and some components
+B) "Entity, Component, System"  
+...in which a component only contains data, while a third part - the system -
+contains the functionality.
 
 
-```cs
-// Create entity
-var myEntity = new Entity();
- 
-// Create a model component (so that model is rendered)
-var modelComponent = new ModelComponent { Model = model };
-myEntity.Set(ModelComponent.Key, modelComponent);
-
-// Set entity position
-myEntity.Transformation.Translation = new Vector3(100.0f, 100.0f, 0.0f);
- 
-// Add entity to scene; from now on its model will be rendered
-Entities.Add(myEntity);
-```
+Stride allows working in both ways. A) can be achieved by using
+[scripts](https://doc.stride3d.net/latest/en/manual/scripts/index.html)
+while the usage of B) is described in this section of the manual.
 
 
+### Which one to choose?
 
 
+![media/ecs-choice.jpg](media/ecs-choice.jpg) 

+ 0 - 47
en/manual/engine/entity-component-model/introduction.md

@@ -1,47 +0,0 @@
-# ECS (Entity Component System) Introduction
-
-# Problem
-> `Dog` is a subclasses of `Animal`.
-
-This example is often used as an example of inheritance
-in introductions to programming. However, when things get more complex,
-we get problems:
-- `Dog` and `Fish` can swim, so we create `SwimmingAnimal` as a class in between
-- `Bee` and `Bird` can fly, so we create `FlyingAnimal`
-- What do we now do with the `Duck`, who can do both?
-
-We have the exact same problem in video games.  
-Enemies can walk, shoot, fly - but not all of them can do everything.  
-Even something basic like hitpoints is not universal, as some enemies are indestructible.
-
-# Solution
-
-
-> Entity component system (ECS) is a software architectural pattern mostly used in video game development for the representation of game world objects. An ECS comprises entities composed from components of data, with systems which operate on entities' components.  
-> _-[Wikipedia](https://en.wikipedia.org/wiki/Entity_component_system)_
-
-
-The general idea of an ECS is that an _entity_ - an "object" in your virtual world -
-does not really do anything. It is mostly just a "bag of components".
-
-The selection of components on an entity decides what it does.
-An entity with a collider component can collide, an entity with a sound component can make a noise, etc.
-
-## Differing opinions
-
-For the "System" part of the term, there are two interpretations:
-
-A) "Entity-and-Component System"  
-...in which the components contain the data they need, and also the functionality that works with that data.
-
-B) "Entity, Component, System"  
-...in which a component only contains data, while a third part - the system -
-contains the functionality.
-
-Stride allows working in both ways. A) can be achieved by using
-[scripts](https://doc.stride3d.net/latest/en/manual/scripts/index.html)
-while the usage of B) is described in this section of the manual.
-
-### Which one to choose?
-
-![media/ecs-choice.jpg](media/ecs-choice.jpg) 

+ 0 - 3
en/manual/engine/entity-component-model/media/7438980.png

@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:63339369b83d3a8c64066bbdd0ba4264fa5ea5e1ade3671a0ae9ce9507342016
-size 2950

+ 1 - 0
en/manual/toc.md

@@ -52,6 +52,7 @@
 ### [Asset bundles](engine/assets/asset-bundles.md)
 ### [Asset bundles](engine/assets/asset-bundles.md)
 ### [Asset control](engine/assets/asset-control.md)
 ### [Asset control](engine/assets/asset-control.md)
 ## [Entity component model](engine/entity-component-model/index.md)
 ## [Entity component model](engine/entity-component-model/index.md)
+### [Usage](engine/entity-component-model/usage.md)
 ### [Manage entities](engine/entity-component-model/managing-entities.md)
 ### [Manage entities](engine/entity-component-model/managing-entities.md)
 ## [File system](engine/file-system.md)
 ## [File system](engine/file-system.md)