One months in the internship. The company's new project is ready to be developed using the ET framework we must understand a concept before going through ET's process: ECS Component-type programming
This concept differs from our common approach to unity development (although unity itself is developed using components), the common idea in unity development is Entity-manager, which is to abstract the business into an entity-manager pattern, the entity is abstract Like the protagonist, monsters, etc. classes (instances), managers are classes (instances) that encapsulate some relatively abstract logic such as Protomanager,scenemanager,uimanager. Objects and managers follow the idea design of OOP, the player class inherits the role class, implements different interfaces, the role class can be inherited by the NPC class, or it can be inherited by the player class, and each stage class encapsulates the attributes and operations of this phase (inheritance), and the manager and enity interact through the corresponding event system ( May be some manager itself) to form a relatively complete ecosystem.
In doing so, the data and logic are more coupled, so people try to incorporate the MVC framework into which the data and logic of the entity are decoupled, and the entities and managers are PUREMVC,STRANGEIOC into view and controller and model. However, the game is a rather complex product, logic and logic, logic and data sometimes forced decoupling does not make development easy, and sometimes it will increase the amount of work (such as the development of a relatively simple project). Is there any other idea besides this common development idea? The answer is yes.
Component Development ECS is not a new thing, in the field of non-game development (especially server development) in fact, this concept is very common, and ECS in the game development field of development concept is the first from the Overwatch server development spread out (not sure, although everyone said so, after all, I did not personally to research), Interested friends can go to search by themselves.
What is ECS? E is enity entity C, which is component S, which is system.
The purest ECS development is the strong decoupling of data and logic (which I think is not necessarily correct), system hosting logic, enity hosting data, component defining data (and Unity's component, which I would assume as "components", ECS's component is pure data does not contain logic).
For example, Description: A red worm eats 5 leaves. In this sentence, the insect-entity, the leaves-entity, eats the-system, the insect's attribute (eats)-component, the Leaf's attribute (area)-component.
A red worm eats a 5 leaf-----one of the insects can eat leaves--insects eat leaves->......-> biology eat biological->......-> noun verb noun
Virtualentiy has x specificcomponent composed of Specificenity,virtualsystem to achieve the specific logic into the Specificsystem, the entity needs to act on another entity, mount the required components , system-oriented component implementation, component and System Association. Force decoupling between entities and systems (except in special cases, unless the system is designed for a particular component, which is an essential component of an entity). This is my own for ECS summary or feel (not necessarily correct)
Having said the basic ECS concept, let's talk about some of the most commonly used ECS concept-based frameworks in unity development:
ET--U3D dual-terminal development framework
entitas-c# Frame
unity2018 Ecs&jobsystem
These three are some of the more common ECS frameworks in unity development. Interested friends can search for themselves first (the following article will be detailed ET)
Finally, I must say that it is not that ECS is the absolutely unique and invincible development model of unity development. The core of software development is not the use of what a good frame, built a great wheel, the code is for the product service, as long as the framework helps improve product quality, speed is the framework. Each framework needs to really think deeply before you can really use these frameworks.
Here are some of the articles I have read and feel I have gained, and share them.
Https://www.cnblogs.com/yangrouchuan/p/7436533.html--entitas Framework Introduction
https://www.zhihu.com/question/286963885/answer/452979420--ecs Development Thinking (will become the mainstream of the future?) )、
https://zhuanlan.zhihu.com/p/32787878--ecs without frame principle level implementation
Https://github.com/egametang/ET--et's GitHub address
Finally: I am only a senior in the company internship small rookie, a lot of places written bad also please forgive us.
Interested friends can add my qq everyone together to learn to grow together qq:872732381
The basic idea of the ET Framework Learning-ecs component programming to Unity