Font Size: a A A

Optimization And Implementation Of Cocos2d-X Engine Based On ECS

Posted on:2020-11-08Degree:MasterType:Thesis
Country:ChinaCandidate:L Z ShenFull Text:PDF
GTID:2428330611454752Subject:Software engineering
Abstract/Summary:PDF Full Text Request
With the rapid development of smart phones,mobile games are gradually showing the trend of quality,and the technical requirements for game engines are constantly improving,such as code extensibility and performance.Cocos2d-X is the most popular mobile game engine used by domestic game companies,but it cannot satisfy the complex requirements of mobile games nowadays.Based on the ECS(Entity-Component-System),an optimizing architecture for Cocos2d-X is proposed and implemented:(1)Due to the interdependency between data and logic,it is necessary to make minor changes to the code to meet the frequent changes of game requirements.To solve this problem,the game objects,data and behaviors are abstracted as "Entities","Components" and "Systems" in ECS.By using the bit array and sequential storage structure,the coupling between the game data and logic is reduced,so that game objects can be constructed in a combined way,thus the game functions can be extended conveniently.(2)While developing games with high real-time interactive requirement,the performance limitation of Cocos2d-X can lead to performance problems.To address the issue,we adopt establishing memory management mechanism to improve the efficiency of memory allocating and releasing of game data,and combining template metaprogramming technology to reduce performance overhead in the process of game operation.Finally,through the implementation and improvement of a Cocos2d-X mobile game,the application method of this scheme is illustrated,and the extensibility and performance of the codes before and after the game improvement are compared and tested.The experimental results show that the optimized architecture we proposed in this thesis can improve the performance of a game,and improve the code extensibility,so as to make up for the defects of Cocos2d-X.
Keywords/Search Tags:Cocos2d-X, ECS, game engine, mobile game
PDF Full Text Request
Related items