基于Cocos2D-x的卡牌类游戏框架的设计与实现
发布时间:2018-03-13 20:24
本文选题:Cocos2D-x 切入点:图形学 出处:《吉林大学》2017年硕士论文 论文类型:学位论文
【摘要】:在人们追求更快捷便利的服务形式的大趋势下,移动游戏出现在人们生活中。其中卡牌类手游已经成为国内手游市场的主流,在苹果App Store中国畅销榜前50的游戏中,卡牌类游戏占到了13款。卡牌类游戏一直以短周期、低成本、高风险、高利润著称,这样的特征吸引了众多冒险者前来开拓这片崭新的领域。本论文根据当今智能手机以及卡牌类游戏发展现状,对主流开源手机游戏引擎进行了总结。针对作者所要开发的2D卡牌类游戏,选定Cocos2D-x引擎进行开发。但该引擎无论在CPU利用率,场景资源管理,以及UI控件开发效率上均有所欠缺,不能很好的满足卡牌类游戏的需求。作者首先对相关技术进行了详细的研究,之后为了贴合所开发的2D卡牌类游戏,在Cocos2D-x引擎的基础上,做了大量的改进。主要工作如下所示:1.优化引擎渲染模块。卡牌类游戏是一种低交互,长时间在线的游戏。而Cocos2D-x引擎为单线程引擎,并不能充分利用手机的多核CPU。所以作者首先分析了几种多线程渲染引擎的特点,以及游戏循环时间同步方式,在详细研究原渲染模块结构之后,改写了当前引擎的渲染模块,实现了游戏线程和渲染线程的分离。提高了游戏运行时的CPU利用率,游戏运行帧数。2.优化场景管理模块。Cocos2D-x引擎不能满足卡牌类游戏复杂场景的切换需求。针对这一问题,作者重写了场景管理模块,利用双层状态机的思想管理场景的加载和释放。减少了游戏开发难度,同时优化了场景资源的资源管理流程。3.构建新版UI系统。Cocos2D-x的UI系统在屏幕适配,扩展性和开发流程上均存在缺陷。作者在详细研究原引擎的UI系统后,针对卡牌类游戏重写了UI系统。新版UI系统分为配置文件管理模块,核心模块,系统级控件,游戏级控件,UI编译器。新版UI系统更加贴合所要开发的2D卡牌类游戏,便利于开发者,大幅加快了开发效率以及降低了开发难度。论文结尾对引擎整体和UI系统进行了测试。并且使用这个框架,利用国外著名页游的游戏UI重新制作成手机端卡牌游戏。该框架对实际的卡牌类游戏开发提供了一定的参考。
[Abstract]:Mobile games are emerging in people's lives as people pursue faster and more convenient forms of service. Among them, card and card mobile games have become the mainstay of the domestic mobile game market, with Apple App Store in the top 50 best-selling games in China. Card games account for 13. Card games are known for their short periods, low cost, high risk and high profits. This feature has attracted many adventurers to explore this new field. This paper summarizes the mainstream open source mobile game engine. The author chooses Cocos2D-x engine to develop the 2D card card game. But the engine can be used in CPU utilization, scene resource management, etc. The development efficiency of UI controls is not enough to meet the needs of card games. Firstly, the author makes a detailed study of the related technologies, and then in order to fit the developed 2D card games, based on the Cocos2D-x engine, A lot of improvements have been made. The main work is as follows: 1. Optimization engine rendering module. Card game is a low interactive, long-time online game. The Cocos2D-x engine is a single-threaded engine. It can not make full use of the multi-core CPU. so the author first analyzes the characteristics of several multi-thread rendering engines and the game cycle time synchronization mode. After studying the original rendering module structure in detail, the author rewrites the rendering module of the current engine. It realizes the separation of game thread and rendering thread, improves the CPU utilization rate of game running, and optimizes the scene management module. Cocos2D-x engine can not meet the switching requirements of complex scene of card game. The author rewrites the scene management module and manages the loading and releasing of the scene by using the idea of two-layer state machine, which reduces the difficulty of game development. At the same time, it optimizes the resource management flow of scene resources .3.Constructing the new version UI system. Cocos2D-x has defects in screen adaptation, extensibility and development process. After the author has studied the UI system of the original engine in detail, For card game rewriting UI system. The new version of UI system is divided into configuration file management module, core module, system-level control, game-level control UI compiler. At the end of the paper, we test the whole engine and UI system, and use this framework. This framework provides a certain reference for the development of card games by using the famous game UI of foreign countries to remake the mobile phone card card game.
【学位授予单位】:吉林大学
【学位级别】:硕士
【学位授予年份】:2017
【分类号】:TP317
【参考文献】
相关期刊论文 前4条
1 李s,
本文编号:1608021
本文链接:https://www.wllwen.com/kejilunwen/ruanjiangongchenglunwen/1608021.html