en:toolworks:docs:apparatus:ecs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:toolworks:docs:apparatus:ecs [2021/04/14 14:56] vladiusen:toolworks:docs:apparatus:ecs [2021/12/18 15:19] (current) – поправил некоторые слова jispar
Line 3: Line 3:
 ===== OOP Quirks & Limitations ===== ===== OOP Quirks & Limitations =====
  
-Prior to discussing some ECS concepts, we have address the [[wp>Object-oriented_programming|object-oriented programming (OOP)]] and its issues, since the current state of Unreal Engine's user-level API is basically OOP-based. The actor's component model is also kind of limited and is mostly static in nature.+Prior to exploring the ECS main concepts, we should address the [[wp>Object-oriented_programming|object-oriented programming (OOP)]] pattern and some of the issues related to it. That's because the current state of Unreal Engine's user-level API is basically OOP-based. Even the actor's component model is somewhat limited and is mostly static in nature. It really shouldn't be confused with a data-oriented approach we're presenting you with.
  
-While developing games (and software in general) OOP-way, we decompose of all the available entities and concepts into hierarchies of their corresponding typesIn terms of Unreal Engine those are mainly called Objects, or [[ue>API/Runtime/CoreUObject/UObject/UObject|''UObjects'']] if we are talking about C++ codingso we create hierarchies of types (classes) derived from a single root ''UObject'' ancestorEvery time we create a new Blueprint (or a C++ classit basically derives from this root class.+A large portion of C++ language is also OOP and it was one of the main reasons behind its original designIt seems like the general top-level UE's architecture was heavily based on C++ some featuresor at least was heavily inspired by them. That's quite logical if you think of itIn the end C++ is the main language behind the tech. The Unreal build toolset (UBT and UHTis implemented in C# which is also an OOP language by the way.
  
-As the time goes we notice that our classes become more and more in common and begin to [[wp>Code_refactoring|refactor]] the codebase (or the Blueprint assets), while extracting those common facilities into some separate base classes. Those in turn become the ancestors and we derive certain types from them, that should share their functionality.+So, when we develop games (and software in general) the OOP-way, we usually decompose all of the available entities and concepts into the hierarchies of their corresponding types. In terms of Unreal Engine those are mainly called Objects (or ''[[ue>API/Runtime/CoreUObject/UObject/UObject|UObjects]]'' if we are talking about C++ coding part). We create the hierarchies of those classes where each class introduces some new properties and methods while also inherting the properties and methods of its parent (base) class. All of Unrealean classes are derived from a single root Object (''UObject'') ancestor class in the end. Every time we create a new Blueprint (or a new C++ class) it basically derives from this root class. 
 + 
 +As the time developing our game goes we usually start to notice that some of our classes tend to have more and more in common. So we begin to [[wp>Code_refactoring|refactor]] the codebase (or the Blueprint assets), extracting those common properties and methods into some separate base classes and try to derive the other classes from themThis task can already be quite sophisticated since Unreal's object model does not support multiple inheritance (while C++ actually does), so you basically can't derive your class from the two common ones. Anyways, those new common classes in turn may become too common so the new common common class is introduced and the process repeats.
  
 A quite popular example for that approach is a tree of animal inheritance, where a root class represents basically any animal existing (something like ''UObject''), while others derived represent some separate animal sorts and kinds on their own: A quite popular example for that approach is a tree of animal inheritance, where a root class represents basically any animal existing (something like ''UObject''), while others derived represent some separate animal sorts and kinds on their own:
Line 57: Line 59:
  
 You would hardly ever need to implement your own mechanisms. Should you wish to, you can also do it in C++. You would hardly ever need to implement your own mechanisms. Should you wish to, you can also do it in C++.
 +
 +==== Third-Party Resources ====
 +
 +Together with our community we have gathered a collection of useful information regarding ECS and data-oriented in general.
 +You may study it for a broader view on the subject:
 +
 +=== English ===
 +
 +{{youtube>tONOW7Luln8?medium}}
 +{{youtube>W3aieHjyNvw?medium}}
 +{{youtube>g1TsP60z2OQ?medium}}
 +
 +=== Russian ===
 +
 +These are in Russian, but you may still want watch them with automatically-generated subtitles.
 +
 +{{youtube>IsJmBiRWBj8?medium}}
 +
  • en/toolworks/docs/apparatus/ecs.txt
  • Last modified: 2021/12/18 15:19
  • by jispar