网络游戏_图文.ppt
- 格式:ppt
- 大小:1.07 MB
- 文档页数:12


本科毕业设计(论文)基于Unity3D多平台网络斗地主的设计与实现学院名称:计算机工程学院专业:计算机科学与技术班级: 10工程W学号: 10141303姓名:丁小未指导教师姓名:朱明放指导教师职称:副教授二〇一四年五月基于Unity3D的多平台网络斗地主的设计与实现摘要:斗地主是一款非常经典的游戏,可以说是家喻户晓,玩法也比较的简单,娱乐性也比较强,老少皆宜。
随着互联网技术的飞速发展,斗地主呈现的形式也变得多样性,由传统的纸牌游戏衍生为移动端单机游戏,然后到多人多平台的即时在线联网游戏。
形式的变化能够让人足不出户也能感受到和伙伴们一起玩游戏的乐趣。
本设计的游戏规则是针对一副牌为准,本文论述了网络斗地主游戏的基本算法设计以及大体的设计框架和思路,并且以图文,部分核心代码解释的形式展示出来。
本设计采用了Unity3D作为开发引擎,结合Visual studio 2010开发工具,通过基本的socket 通讯和一些算法,最终实现了多平台的多人网络斗地主的设计。
本文基于Unity3D的游戏开发设计过程中,采用了MVC的设计模式,这也符合Unity3D工作模式;采用C#脚本语言也更符合Unity3D游戏设计面向对象的设计理念,游戏设计就是将面向对象这一特性发挥到极致;采用MONO开源跨平台框架能够大大节约游戏的开发效率以及开发成本,最后通过实际的完成效果来验证了基于Unity3D的多平台网络斗地主游戏设计具有高效性,高品质和低门槛性的特点。
关键词:Unity3D,斗地主,手机游戏,游戏引擎,socket,网络通讯,MVC,MONODesign and implementation of multi-platform networkLandlords Based Unity3DAbstract: Landlords is a classic game, which can be said to be a household name. The rules are relatively simple, and kind of the entertainment is relatively strong. As a result, the game has gain popularity among both the young and the old. With the rapid development of Internet technology, the form of the game is of great diversity. The game derived from the traditional card game, then turned into the stand-alone mobile phone game, and now has become a multi -platform instant online multiplayer networked game. The changes in the game form make people who stay at home enjoying the fun of playing the game together.The design of the rules is according to a deck of cards. The article discusses the basic network Landlords algorithm design and the general framework and ideas of the game. The game interprets itself successfully by the graphic form and the part of the core code. This design uses the Unity3D as a development engine. Besides, it combined with Visual studio 2010 development tools. Ultimately we finish the design of a multi -platform multiplayer online Landlords by some algorithms and the basic socket communication.The article is based on the design process of Unity3D game development. The MVC design pattern is consistent with Unity3D mode, and C # scripting language is good for the design object-oriented design of Unity3D game. Object-oriented game design is supposed to make the best of the feature .The MONO open source framework can greatly reduce the efficiency of game development as well as development costs. Finally we validate the high efficiency, high- quality and low-threshold characteristics of the multi-platform network game which based on Landlords Unity3D by achieving the actual results.Keywords:Unity3D, Landlords, mobile games, game engine, socket, network communications, MVC, MONO目录前言 (1)第1章概述 (2)1.1 系统开发背景 (2)1.2 设计的目的 (3)1.3 设计的意义 (3)第2章开发环境及相关技术介绍 (4)2.1 开发环境介绍 (4)2.1.1 Unity3D简介 (4)2.1.2 Visual Stdio2010和MonoDevelop (5)2.1.3 Xcode简介 (5)2.2 C#语言和Javascript脚本 (6)2.2.1 C#语言 (6)2.2.2 Javascript语言 (6)2.3 IOCP框架简介 (7)2.3.1 IOCP内部工作队列图 (7)2.3.2 程序实现IOCP模型的基本步骤 (8)2.3.3 使用IOCP模型和不使用IOCP模型通讯的对比 (8)2.4 本章小结 (10)第3章系统需求分析 (10)3.1 用户功能需求分析 (10)3.2 系统性能要求 (10)3.3 可行性分析 (10)第4章总体方案设计 (11)4.1 纸牌设计 (11)4.1.1 牌型设计 (11)4.1.2 出牌类型(游戏规则)设计 (12)4.2.1 基于C/S模式的服务器端设计流程图 (12)4.2.2 基于C/S模式的客户端设计流程图 (12)4.3 游戏逻辑程序结构 (13)4.3.1 数据层 (13)4.3.2 控制层 (13)4.3.3 显示层 (14)4.4 游戏设计流程图 (14)4.5 数学建模 (15)第5章详细设计与系统实现 (16)5.1 斗地主洗牌算法 (16)5.2 斗地主之“排序”算法 (16)5.3 基于IOCP的Socket通讯 (18)5.4 User对象的设计 (19)5.4.1 玩家状态设计 (19)5.4.2 玩家的属性以及手牌的操作方法 (20)5.5 Table对象的设计 (21)5.5.1 桌子状态设计 (21)5.5.2 Table的属性及方法 (21)5.6 粘包问题 (23)5.6.1 TCP和UDP的介绍以及区别 (23)5.6.2 粘包介绍及处理 (23)第6章发布和测试 (25)6.1 服务器端性能检测 (25)6.2 打包发布Android应用 (27)6.2.1 导出Android设置 (27)6.2.2 真机效果图 (28)6.3 打包发布IOS应用 (29)6.3.1导出IOS设置 (29)6.3.2真机效果图 (31)6.4.1 关于UnityWebPlayer的SandBox Security(安全沙盒机制) (32)6.4.2 导出Web设置 (32)6.4.3 运行结果 (33)6.5 打包发布PC/Linux应用 (34)6.6 整体测试效果 (34)结束语 (40)致谢 (42)参考文献 (43)附录A 网络斗地主的游戏规则 (44)附录B 部分程序代码 (47)前言近年来,随着科技和互联网的飞速发展、智能手机的迅速普以及性能的不断提升,游戏行业也突飞猛进,游戏已经逐渐成为人们公认的第九种艺术。