design-and-development-of-a-peer-to-peer-online-mu

  • PUDN用户
    了解作者
  • C#
    开发工具
  • 354KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 21
    下载次数
  • 2010-04-11 21:10
    上传日期
关于通过directX和C#开发P2P模式的游戏论文
design-and-development-of-a-peer-to-peer-online-mu
  • design-and-development-of-a-peer-to-peer-online-muptiplayer-game-using-directx-and-C#.pdf
    1.9MB
内容介绍
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> <meta name="generator" content="pdf2htmlEX"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css"> <link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css"> <link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/622b5a6215da9b288be5b414/raw.css"> <script src="https://static.pudn.com/base/js/compatibility.min.js"></script> <script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script> <script> try{ pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({}); }catch(e){} </script> <title></title> </head> <body> <div id="sidebar" style="display: none"> <div id="outline"> </div> </div> <div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/622b5a6215da9b288be5b414/bg1.jpg"><div class="t m0 x1 h2 y1 ff1 fs0 fc0 sc0 ls0 ws0">__________<span class="_ _0"></span>____________<span class="_ _0"></span>____________<span class="_ _0"></span>_________ </div><div class="t m0 x1 h2 y2 ff1 fs0 fc0 sc0 ls1 ws0">0-7803-8560<span class="_ _0"></span>-8/04/$20.0<span class="_ _0"></span>0&#169;2004IEEE</div><div class="t m0 x2 h3 y3 ff2 fs0 fc0 sc0 ls2 ws1">Figure 1: Peer-to-Peer </div><div class="t m0 x2 h4 y4 ff2 fs1 fc0 sc0 ls3 ws2">DESIGN AND DEVELOPMENT OF A P<span class="_ _0"></span>EER-TO-PEER <span class="_"> </span> </div><div class="t m0 x3 h4 y5 ff2 fs1 fc0 sc0 ls4 ws3">ONLINE MULTIPLAYER GAME USING DIRECTX AND C# </div><div class="t m0 x4 h5 y6 ff3 fs2 fc0 sc0 ls5 ws4">Loh Sau Meng, Kelvin, Edmond C. Prakas<span class="ls6 ws5">h and Peter K. K. Loh </span></div><div class="t m0 x5 h6 y7 ff1 fs2 fc0 sc0 ls7 ws6">School of Computer Engineering </div><div class="t m0 x6 h6 y8 ff1 fs2 fc0 sc0 ls8 ws7">Nanyang Technological University, S<span class="_ _0"></span>ingapore </div><div class="t m0 x7 h5 y9 ff3 fs2 fc0 sc0 ls9 ws8">Contact email: Asprakash@ntu.e<span class="_ _1"></span>du.sg </div><div class="t m0 x8 h3 ya ff2 fs0 fc0 sc0 lsa ws0">ABSTRACT</div><div class="t m0 x9 h7 yb ff3 fs0 fc0 sc0 lsb ws9">This paper highlights the accomplishments in designing </div><div class="t m0 x9 h7 yc ff3 fs0 fc0 sc0 lsc wsa">a peer-to-peer onl<span class="_ _1"></span>ine multiplayer game.<span class="_ _1"></span> The design of <span class="_ _1"></span>a </div><div class="t m0 x9 h7 yd ff3 fs0 fc0 sc0 lsd wsb">turn-based fantasy game i<span class="_ _1"></span>n terms of game design: </div><div class="t m0 x9 h7 ye ff3 fs0 fc0 sc0 lse wsc">game-balanc<span class="_ _1"></span>ing, non-linear<span class="_ _1"></span>ity, artific<span class="_ _1"></span>ial intellige<span class="_ _1"></span>nce, </div><div class="t m0 x9 h7 yf ff3 fs0 fc0 sc0 lsf wsd">level design and over<span class="_ _1"></span>all game-play; software design:<span class="_ _1"></span> </div><div class="t m0 x9 h7 y10 ff3 fs0 fc0 sc0 lse wse">object-orien<span class="_ _1"></span>ted analysis,<span class="_ _1"></span> class modeling,<span class="_ _1"></span> sprite desig<span class="_ _1"></span>n </div><div class="t m0 x9 h7 y11 ff3 fs0 fc0 sc0 ls10 wsf">and animation.<span class="_ _1"></span> The developme<span class="_ _1"></span>nt of the game using C# </div><div class="t m0 x9 h7 y12 ff3 fs0 fc0 sc0 ls11 ws10">and DirectX APIs with emphas<span class="_ _1"></span>is on DirectPlay <span class="_ _1"></span>for </div><div class="t m0 x9 h7 y13 ff3 fs0 fc0 sc0 ls12 ws11">networking to achieve<span class="_ _1"></span> peer-to-peer playability in a .Net </div><div class="t m0 x9 h7 y14 ff3 fs0 fc0 sc0 ls13 ws0">environment. </div><div class="t m0 xa h3 y15 ff2 fs0 fc0 sc0 lsa ws0">1.<span class="_ _2"> </span>INTRODUCTION </div><div class="t m0 x9 h2 y16 ff1 fs0 fc0 sc0 ls14 ws12">Computer game program<span class="_ _1"></span>ming has been evolving ever </div><div class="t m0 x9 h2 y17 ff1 fs0 fc0 sc0 ls15 ws13">since the dawn of the software devel<span class="_ _1"></span>opment. Playing </div><div class="t m0 x9 h2 y18 ff1 fs0 fc0 sc0 ls16 ws14">against<span class="_ _0"></span> real hu<span class="_ _0"></span>man oppon<span class="_ _0"></span>ents is si<span class="_ _0"></span>mply <span class="_ _0"></span>more </div><div class="t m0 x9 h2 y19 ff1 fs0 fc0 sc0 ls15 ws15">challenging and motivat<span class="_ _1"></span>ing [1, 14]. However, a </div><div class="t m0 x9 h2 y1a ff1 fs0 fc0 sc0 ls10 ws16">common probl<span class="_ _1"></span>em for developers is <span class="_ _1"></span>the maintenance of<span class="_ _1"></span> </div><div class="t m0 x9 h2 y1b ff1 fs0 fc0 sc0 ls12 ws17">an effective netw<span class="_ _1"></span>ork of entities and syste<span class="_ _1"></span>m, given the </div><div class="t m0 x9 h2 y1c ff1 fs0 fc0 sc0 ls17 ws18">low bandwidth, <span class="_ _1"></span>high latency in<span class="_ _1"></span>frastructure we have<span class="_ _1"></span> </div><div class="t m0 x9 h2 y1d ff1 fs0 fc0 sc0 ls18 ws19">today. Furthermor<span class="_ _1"></span>e, even with many promising </div><div class="t m0 x9 h2 y1e ff1 fs0 fc0 sc0 ls12 ws1a">technologies such as <span class="_ _1"></span>Digital Subscriber<span class="_ _1"></span> Line (DSL) or </div><div class="t m0 x9 h2 y1f ff1 fs0 fc0 sc0 ls19 ws1b">Cable which can provide up<span class="ls1a ws1c"> to 2 Mbps download and </span></div><div class="t m0 x9 h2 y20 ff1 fs0 fc0 sc0 ls1b ws1d">256 Kbps uplo<span class="_ _1"></span>ad bandwidth,<span class="_ _1"></span> most home <span class="_ _1"></span>users are still<span class="_ _1"></span> </div><div class="t m0 x9 h2 y21 ff1 fs0 fc0 sc0 ls1c ws1e">limited to 56Kbps voice modems [3]. Hence, </div><div class="t m0 x9 h2 y22 ff1 fs0 fc0 sc0 ls1d ws1f">distributed si<span class="_ _1"></span>mulation can<span class="_ _1"></span> only be achieved with<span class="_ _1"></span> </div><div class="t m0 x9 h2 y23 ff1 fs0 fc0 sc0 ls15 ws20">efficient communicat<span class="_ _1"></span>ion synchronizat<span class="_ _1"></span>ion between </div><div class="t m0 x9 h2 y24 ff1 fs0 fc0 sc0 ls1e ws21">players,<span class="_ _1"></span> system and distrib<span class="_ _1"></span>uted databa<span class="_ _1"></span>ses so that the<span class="_ _1"></span> </div><div class="t m0 x9 h2 y25 ff1 fs0 fc0 sc0 ls10 ws22">global state of the game is replica<span class="_ _1"></span>ted accurately in<span class="_ _1"></span> </div><div class="t m0 x9 h2 y26 ff1 fs0 fc0 sc0 ls19 ws23">every end-system [9]. <span class="_ _1"></span>But with the clever technologies </div><div class="t m0 x9 h2 y27 ff1 fs0 fc0 sc0 ls1f ws24">that are currently availabl<span class="_ _1"></span>e from various Internet </div><div class="t m0 x9 h2 y28 ff1 fs0 fc0 sc0 ls15 ws25">technology devel<span class="_ _1"></span>opers can now start a trend of </div><div class="t m0 x9 h2 y29 ff1 fs0 fc0 sc0 ls10 ws26">media-rich mu<span class="_ _1"></span>ltiplayer gami<span class="_ _1"></span>ng easily [6-<span class="_ _1"></span>8,10-12].<span class="_ _1"></span> The </div><div class="t m0 x9 h2 y2a ff1 fs0 fc0 sc0 lsb ws27">project is split into two sub-parts, with each sub-projec<span class="_ _1"></span>t </div><div class="t m0 x9 h2 y2b ff1 fs0 fc0 sc0 ls20 ws28">being reused to achieve softwar<span class="_ _1"></span>e reusability. <span class="_"> </span> </div><div class="t m0 xb h3 y2c ff2 fs0 fc0 sc0 ls18 ws29">1.1 Sub-Project One &#8211; &#8220;BattleGround<span class="_ _1"></span>&#8221; </div><div class="t m0 xb h2 y2d ff1 fs0 fc0 sc0 ls1c ws2a">A turn-based, strategic, 2D fantas<span class="_ _1"></span>y game where the </div><div class="t m0 xb h2 y2e ff1 fs0 fc0 sc0 ls10 ws2b">player is presented a<span class="_ _1"></span> variety of moves for maneuver<span class="_ _1"></span>ing </div><div class="t m0 xb h2 y2f ff1 fs0 fc0 sc0 ls12 ws2c">his character to a finishing flag across a board filled </div><div class="t m0 xb h2 y30 ff1 fs0 fc0 sc0 lsc ws2d">with obstacles.<span class="_ _1"></span> The moves are executed when the<span class="_ _1"></span> </div><div class="t m0 xb h2 y31 ff1 fs0 fc0 sc0 ls18 ws2e">player confirms <span class="_ _1"></span>its selection or when the time<span class="_ _1"></span>r runs out. <span class="_"> </span> </div><div class="t m0 xb h3 y32 ff2 fs0 fc0 sc0 ls14 ws2f">1.2 Sub-Project <span class="_ _1"></span>Two &#8211; &#8220;BattleGround<span class="_ _1"></span> Online&#8221; </div><div class="t m0 xb h2 y33 ff1 fs0 fc0 sc0 lsf ws30">An extension of the previous sub-projec<span class="_ _1"></span>t, it is installed </div><div class="t m0 xb h2 y34 ff1 fs0 fc0 sc0 ls18 ws31">locally but runs only after<span class="_ _1"></span> the user has logged in to t<span class="_ _1"></span>he </div><div class="t m0 xb h2 y35 ff1 fs0 fc0 sc0 ls1a ws32">remote server. Multiplayer <span class="_ _1"></span>games are organized by <span class="_ _1"></span>the </div><div class="t m0 xb h2 y36 ff1 fs0 fc0 sc0 lsc ws33">remote server using <span class="_ _1"></span>DirectPlay to provide<span class="_ _1"></span> peer-to-peer </div><div class="t m0 xb h2 y37 ff1 fs0 fc0 sc0 ls1c ws34">session to host these gam<span class="_ _1"></span>es. Fitted with chatting </div><div class="t m0 xb h2 y38 ff1 fs0 fc0 sc0 ls12 ws11">functions, users can also decide from<span class="_ _1"></span> the game menu to </div><div class="t m0 xb h2 y39 ff1 fs0 fc0 sc0 ls15 ws35">play either a single player gam<span class="_ _1"></span>e or host/join a </div><div class="t m0 xb h2 y3a ff1 fs0 fc0 sc0 ls1c ws36">multiplayer gam<span class="_ _1"></span>e. Unlike single player game, the </div><div class="t m0 xb h2 y3b ff1 fs0 fc0 sc0 ls21 ws37">objective o<span class="_ _1"></span>f the multiplaye<span class="_ _1"></span>r game is to be t<span class="_ _1"></span>he sole </div><div class="t m0 xb h2 y3c ff1 fs0 fc0 sc0 lsf ws30">survivor. During game play, all the players must select </div><div class="t m0 xb h2 y3d ff1 fs0 fc0 sc0 lsf ws38">their moves at the same <span class="_ _1"></span>time within the same time limit. </div><div class="t m0 xb h2 y3e ff1 fs0 fc0 sc0 ls15 ws39">All their moves will be exec<span class="_ _1"></span>uted at the same time with </div><div class="t m0 xb h2 y3f ff1 fs0 fc0 sc0 ls22 ws3a">the prio<span class="_ _0"></span>rity given<span class="_ _0"></span> to the pl<span class="_ _0"></span>ayer th<span class="_ _0"></span>at confi<span class="_ _0"></span>rms th<span class="_ _0"></span>e moves </div><div class="t m0 xb h2 y40 ff1 fs0 fc0 sc0 ls19 ws3b">the earliest. </div><div class="t m0 xc h3 y41 ff2 fs0 fc0 sc0 ls23 ws3c">2.<span class="_ _2"> </span>GAME DESIG<span class="_ _0"></span>N </div><div class="t m0 xb h2 y42 ff1 fs0 fc0 sc0 ls23 ws3d">The design refl<span class="_ _0"></span>ects the combin<span class="_ _0"></span>ation of both th<span class="_ _0"></span>e </div><div class="t m0 xb h2 y43 ff1 fs0 fc0 sc0 ls10 ws3e">sub-projects a<span class="_ _1"></span>fter integration. The init<span class="_ _1"></span>ial design of the </div><div class="t m0 xb h2 y44 ff1 fs0 fc0 sc0 ls12 ws3f">game engine is adapte<span class="_ _1"></span>d from an existing Java real-time </div><div class="t m0 xb h2 y45 ff1 fs0 fc0 sc0 ls12 ws40">strategic game engi<span class="_ _1"></span>ne. The base classes are built </div><div class="t m0 xb h2 y46 ff1 fs0 fc0 sc0 ls17 ws41">genericall<span class="_ _1"></span>y to fit with any game while reusability is </div><div class="t m0 xb h2 y47 ff1 fs0 fc0 sc0 ls24 ws42">maintained so that the same classes can be used by </div><div class="t m0 xb h2 y48 ff1 fs0 fc0 sc0 ls1c ws43">future updates.<span class="_ _1"></span> </div><div class="t m0 xd h2 y49 ff1 fs0 fc0 sc0 ls25 ws44">For the graphi<span class="_ _1"></span>cal impleme<span class="_ _1"></span>ntation o<span class="_ _1"></span>f this project,<span class="_ _1"></span> </div><div class="t m0 xb h2 y4a ff1 fs0 fc0 sc0 ls18 ws45">we adapted the use of a C#-DirectX-Visual Basic<span class="_ _1"></span> </div><div class="t m0 xb h2 y4b ff1 fs0 fc0 sc0 lsd ws46">wrapper library <span class="_ _1"></span>known as DxVBLib.dll that uses </div><div class="t m0 xb h2 y4c ff1 fs0 fc0 sc0 ls26 ws47">DirectX 7.0 interfaces, enabling a sense of <span class="_ _1"></span>backward </div><div class="t m0 xb h2 y4d ff1 fs0 fc0 sc0 ls1b ws48">compatibili<span class="_ _1"></span>ty to the game. This im<span class="_ _1"></span>plementation c<span class="_ _1"></span>ame </div><div class="t m0 xb h2 y4e ff1 fs0 fc0 sc0 ls13 ws49">from two open-source C#-DirectX game<span class="_ _1"></span>s we </div><div class="t m0 xb h2 y4f ff1 fs0 fc0 sc0 ls27 ws4a">discovered in th<span class="_ _0"></span>e &#8220;C# Corner&#8221; forum. Si<span class="_ _0"></span>nce the p<span class="_ _0"></span>roject </div><div class="t m0 xb h2 y50 ff1 fs0 fc0 sc0 lsc ws4b">emphasis is on ne<span class="_ _1"></span>tworking [2,4], optima<span class="_ _1"></span>l graphical </div><div class="t m0 xb h2 y51 ff1 fs0 fc0 sc0 ls28 ws4c">presentati<span class="_ _1"></span>on is sufficient, advance<span class="_ _1"></span>d graphics found in<span class="_ _1"></span> </div><div class="t m0 xb h2 y52 ff1 fs0 fc0 sc0 lsf ws4d">the later versions of DirectX was not required. <span class="_"> </span> </div><div class="t m0 xb h2 y53 ff2 fs0 fc0 sc0 ls22 ws22">Sprite cl<span class="_ _0"></span>ass: <span class="ff1 ls29 ws4e">Anything that is shown onscreen is a </span></div><div class="t m0 xb h2 y54 ff1 fs0 fc0 sc0 ls12 ws4f">BitmapObjec<span class="_ _1"></span>t (an image). H<span class="_ _1"></span>ence, Sprite is modeled as <span class="_ _1"></span>a </div><div class="t m0 xb h2 y55 ff1 fs0 fc0 sc0 ls12 ws50">sub class of Bi<span class="_ _1"></span>tmapObject. From the a<span class="_ _1"></span>bove analysis, it </div><div class="t m0 xb h2 y56 ff1 fs0 fc0 sc0 ls1c ws51">is also obvious that Sprite will be the parent for<span class="_ _1"></span> many </div><div class="t m0 xb h2 y57 ff1 fs0 fc0 sc0 ls1f ws52">other classes (s<span class="_ _1"></span>ee Figure 2) in the game,<span class="_ _1"></span> so it has to be </div><div class="t m0 xe h8 y58 ff4 fs3 fc0 sc0 lsb ws0">278</div><div class="t m0 xf h9 y59 ff5 fs4 fc0 sc0 lsb ws0"><span class="fc1 sc0">Authorized licensed use limited to: BEIJING UNIVERSITY OF POST AND TELECOM. Downloaded on March 31,2010 at 22:17:26 EDT from IEEE Xplore. Restrictions apply. </span></div></div><div class="pi" data-data='{"ctm":[1.611639,0.000000,0.000000,1.611639,0.000000,0.000000]}'></div></div> </body> </html>
评论
    相关推荐
    • sendmail.8.10.0.Beta10.tar.Z
      被广泛使用的发送邮件(SMTP)服务器
    • ZtsFw.zip
      使用Firewall Hook Driver技术进行端口过滤的一个简单防火墙的代码。
    • hadoop-0.20.0.tar.gz
      Hadoop 是一个实现了 MapReduce 计算模型的开源分布式并行编程框架,借助于 Hadoop, 程序员可以轻松地编写分布式并行程序,将其运行于计算机集群上,完成海量数据的计算。
    • netbus.zip
      类似pcanywhere的一个木马程序,用于远程控制对方机器。
    • anywhere.zip
      一个类似PCAnywhere的远程控制软件源码,分客户端和服务器端。
    • hehegu.rar
      红河谷邀请码生成器(2010年7月28日测试通过)
    • FTP总集.rar
      七个FTP的客户端和服务器端程序的源码,能够实现文件的上传,下载,修改,删除等诸多功能
    • Easy2Game.Pro2.1.rar
      Easy2Game.Pro2.1 网络代理工具
    • proxy.zip
      小型HTTP代理程序
    • QQ2004_Source_0.01.rar
      qq2004源代码,可以研究