刘梦颖 马宏琳



摘 要:目前,数字游戏产业已经成为数字经济不可或缺的一部分。本文以Unity平台为基础,围绕冒险游戏的设计目标,阐述了游戏开发的整个过程。玩家可以通过计算机客户端进行联机对战,操控机器人发射激光射线进行大赛比拼。同时,设计了雪天特效,并根据玩家数量的不同,动态扩容校园场景地图。经验证,系统运行时网络资源和设备资源占用率低,实现效果良好。
关键词:Unity;Photon Engine;网络游戏
中图分类号:TP317文献标识码:A文章编号:1003-5168(2021)17-0030-03
Design and Implementation of Adventure Game Based on Unity
LIU Mengying MA Honglin
(School of Information Science and Engineering, Henan University of Technology,Zhengzhou Henan 450001)
Abstract: At present, the digital game industry has become an indispensable part of the digital economy. Based on the Unity platform, the entire process of game development is explained around the design goals of adventure games in this paper. Players can conduct online battles through the computer client, and control robots to emit laser rays for competition. At the same time, special effects in snow are designed, and the campus scene map is dynamically expanded according to the number of players. It has been verified that the network resource and equipment resource occupancy rate is low when the system is running, and the implementation effect is good.
Keywords: unity;photon engine;online games
計算机游戏历经几十年的发展,由最初使用FORTRAN程序编写躲避遮挡物场景游戏开始,逐渐衍生出多人对战、扮演角色(RPG)、卡牌休闲、放置养成、横板闯关等各式各样的游戏;从平面2D游戏到立体生动的3D游戏,在玩法创意、游戏画面设计以及开发技术方面的发展水平都令人触目兴叹[1]。其中,多人冒险网络游戏是通过互联网将大量玩家即时联系起来,在虚拟世界中进行冒险。它不仅能带给用户身临其境的游戏体验,也更注重游戏的互动性与趣味性。
1 Unity与Photon引擎结合开发冒险游戏
PUN(Photon Unity Networking)是一个Unity多人游戏插件包。它提供了身份验证选项,并能够快速、可靠地通过Photon后端实现游戏内部通信。PUN可以输出几乎所有Unity支持的平台,它提供了两个C#接口IPunCallbacks和IPunObservable,可以在类中实现[2]。
本游戏软件采用Unity进行开发,分为客户端和服务器端。客户端包含接口、数据、界面、资源、网络、房间和战斗管理系统等;服务器端处理游戏运行时产生的数据,包括玩家数据、房间数据和战场数据等,同时对网络通信进行管理。……