- 无标题文档
查看论文信息

中文题名:

 COCOS2D-X强交互网络游戏架构设计与实践    

姓名:

 张筱毅    

学号:

 10112042    

保密级别:

 公开    

论文语种:

 chi    

学科代码:

 081202    

学科名称:

 计算机软件与理论    

学校:

 西安电子科技大学    

院系:

 软件学院    

专业:

 软件工程    

第一导师姓名:

 霍秋艳    

第一导师单位:

 西安电子科技大学    

第二导师姓名:

 李海    

完成日期:

 2014-06-08    

答辩日期:

 2014-06-08    

外文题名:

 The strong interaction network game engine design and practical of COCOS2D-X    

中文关键词:

 COCOS2D-X ; 强交互网络游戏引擎设计与实践 ; 软件系统设计    

中文摘要:
本论文通过使用COCOS2D-X技术实践快速完成跨平台游戏项目。同时针对目前COCOS2D-X中提供的网络功能模块无法实现强交互强联网需求的现状,封装一套适合COCOS2D-X的强交互网络通信模块,并集成该模块与COCOS2D-X中,最终实现COCOS2D-X强交互网络游戏的开发。 首先,使用COCOS2D-X引擎中的UI布局方式,和内存管理模式,设计实现UI界面和后台相关数据。其次,利用BSDSOCKET封装一套跨多平台的网络底层传输类,以长连接方式替换原有CRUL库中HTTP网络交互方式。在网络数据收发过程中,使用多线程技术把收发协议过程分开,利用子线程循环侦测接收缓存队列中的数据状态并实现分发,以避对UI线程的影响。将要被分发的数据会结合COCOS2D-X中的消息分发机制,以观察者模式,通过注册的键值对实现准确分发,以消息驱动回调的方式通知UI 根据数据发生改变。其中多线程跨平台方面,使用C++ 11中标准库的新特性,实现多线程的可跨平台功性。最后针对游戏版本在线更新,无二次安装的需求,需要把游戏逻辑移植在Lua脚本上,通过C++启动Lua脚本,版本对比更新资源的方式,完成Lua脚本文件替换,最终完成强交互网络游戏项目需求。同时分别使用原有弱联网模块和新的强交互网络模块进行数据交互,以证明强交互网络传输速度加快30%,流量方面节省40%。 实践过程证明了COCOS2D-X可完成跨平台强交互网络游戏开发需求,在网络交互效率和数据流量控制上都较原有网络模块有所改善。可作为小型开发团队的针对跨平台强交互网络游戏开发成本降低和开发周期缩短的参考方案。
外文摘要:
The realization of the cross-platform game projection by using COCOS2D-X done quickly. At the same time, based on the current network of COCOS2D-X can’t realize the present situation of the strong interaction networking needs, encapsulating a set of strong interactive network communication module which is suitable for COCOS2D-X, and integrate the module with COCOS2D-X, realizing the strong interaction network game of COCOS2D-X’s development ultimatly. Firstly, design and implement the UI interface and backstage’s data by using the UI layout of COCOS2D-X’s engine, and the pattern of memory management,. Secondly, encapsulating a set of network which underlying transport across multiple platforms, By means of long connection to replace the original CRUL repository HTTP network interaction. In the process of network data transceiver, using the detection of child thread loop receive data in a buffer queue status and distribution,in order to avoid the impact on the UI thread. The data which is distributed is based on the mechanism of message delivery in the COCOS2D-X, the keys to achieving accurate distribution through registration, notify the UI in the form of message driven which is callback changed according to the data. The multithreading cross-platform, using the new features of C++ 11’s standard library, achieving the work of multi-threaded cross-platform. Finally, based on the game version’s update which is no secondary installation requirements, need to transplant the game logic on the Lua script, by C++ start the Lua scripts, and update resources of contrast version, At the same time, realizing the interactive network module for data by using the original’s weak network module and a new strongly interaction respectively, proving the strong interaction network transmission speed increased by 30%, saving by 40% traffic ways. Practice proves that the COCOS2D - X cross-platform interactive network game’s development demand, can be completed on network interaction effectively and improved the data flow control module that is compared with the original network. Can be used as a reference for small development team in cross-platform interactive online game development, that is want to cut cost and shorten the development cycle.
中图分类号:

 11    

馆藏号:

 11-25186    

开放日期:

 2015-09-13    

无标题文档

   建议浏览器: 谷歌 火狐 360请用极速模式,双核浏览器请用极速模式