Font Size: a A A

The Design And Realization Of ECS Framework Based On Unity3D

Posted on:2020-06-20Degree:MasterType:Thesis
Country:ChinaCandidate:X LiFull Text:PDF
GTID:2428330623963771Subject:Software engineering
Abstract/Summary:PDF Full Text Request
ECS(Entity-Component-System)is a software developing architecture which is mainly used in game developing.It consists of Entity,Component and System.Entity is the abstract of game object which is controlled by game logic.Every Entity has several Component mounted on it.Component is a set of data and it does not contain any logic.System is the main role in ECS architecture who takes over all the logic.ECS architecture usually obey composition over inheritance rule,it makes code structure more flexible.This text designs and realizes an ECS framework based on ECS architecture in Unity3 D engine,for the reason that it can reduce the code coupling,improve the developing efficiency,enhance the program's extensibility and adapt to fast iteration of game developing.ECS framework supports Unity5.x and later versions,it's easy to deploy and it expands several modules of Unity,it's highly encapsulated,developers can quickly master the development process.Reactive-Programming is introduced into the framework,it can enhance developing efficiency of high interactive application and the code speed.Dependency-Injection is introduced into the framework,it can enhance the reusability and the modularity of the code.An event system based on data stream is established in the framework,it can not only reduce the coupling inside the framework,but also have ability to be injected into developer's application for processing various events or messages.The main research achievements of this paper include:(1)Defined a set of interfaces for implementing the ECS architecture,solved the problem of inheritance disorder in traditional game development,and provided a set of dependency management mechanism to make the process of obtaining game object reference more simple and clear.(2)Introduced external framework to solve non-core business.The ECS framework uses Zenject as a Dependency-Injection tool,so that developers can freely replace the interface implementation when using the framework.Embedded Uni Rx as a ReactiveProgramming tool,the entire framework uses Reactive-Programming and it provides developers with the ability to effectively handle frequent interactions in the game.(3)Implemented the defined interfaces of ECS architecture and completed the core function of ECS framework.The ECS framework can improve the modularity of the code,reduce the coupling between different features,and improve the efficiency of game iteration.(4)Provided a tool set,such as an event system that allows developers to easily deliver arbitrary events throughout the game and reduce unnecessary coupling;Entities and Components serialization tool for transmitting net message and saving game data;reactive extension to animator and animation state machine for efficiently processing animation events and controlling animation performance;Groups and Prefabs factory that could create Groups and Prefabs in runtime.(5)Created a deployment work flow,it could help developers easily build up their ECS framework in game engine.For transforming traditional developers to ECS,provided a set of quick and easy API,at the same time,provided a layer of encapsulation on Unity engine.
Keywords/Search Tags:ECS, Unity3D, Dependency-Injection, Reactive-Programming
PDF Full Text Request
Related items