亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? full tutorial.htm

?? 通用網(wǎng)絡(luò)游戲開發(fā)框架
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
<CENTER><H3><FONT COLOR="#AOAO99">WinBattle - A Multi-player Game Tutorial and Reusable Framework</FONT></H3></CENTER><HR><h3>Introduction</h3><p>This is WinBattle. It's mainly a tutorial in writing a multi-playernetwork game but it also provides re-useable client/server framework codethat can form the basis of subsequent projects. Oh, and it resurrectsa game from the early 90s that I (and a lot of other people) used tofind great fun: XBattle.<h3>The Tutorial Game</h3> <p>It's quite simple. There is a playing board that represents alandscape. Sea is blue, flat land is green and darker shades of brownrepresents higher ground. Each player has bases (shown as circles)that generate troops which are shown as coloured circles. The moretroops present in a hexagonal cell the bigger the circle. Troops canbe made to move across the board by clicking on them to set movementvectors which show up as small lines. Click near the side of thehexagon in the direction you want to send your troops (you must havetroops in the hexagonal cell in order to set the vector).<p>A few minutes into a two-player game might look something like this:<!-- Sample image - gif or jpg --><P><IMG SRC="Full Tutorial_files/image001.jpg" ><p>The idea, of course, is to attack your opponent's troops, capturetheir bases and wipe them off the board.<p>To attack, just point your movement vectors at a cell occupied by theenemy. However, you'll find that you need to attack from more than oneside to successfully occupy a cell.  <h3>Origin and Acknowledgments</h3><p>Back in the early 90s real-time multi-player games were pretty muchunheard of. Computers were expensive and the only place you would findthem connected to a network was at work and they would usually berunning UNIX (or some manufacturer's proprietary operatingsystem). Games were available but they were almost exclusively singleplayer.<p>Then Steve Lehar released XBattle on the comp.sources.xnewsgroup. This was a two-player battle simulation that was picked upby Greg Lesher and developed (over a number of years) into amulti-player real-time battle simulation game that was quite unlikeanything seen before. And great fun to play.<p>You can find an excellent description of the game here:<A HREF="http://cns-web.bu.edu/pub/xpip/html/xbattle.html">The XBattle Home Page</A><BR><p>Greg Lesher stopped working on XBattle back in 1996. However, it isstill available for download for UNIX systems on the website (at leastit was when I wrote this). <p>Anyway, one wet weekend I was feeling nostalgic and reminiscing aboutthe old games. XBattle came to mind and a quick trip to Googledelivered me to the XBattle home page. After browsing the site Ithought it would be fun to play it again but I no longer have a UNIXworkstation so off I went in search of a Windows version thinkingsomebody must have done a PC version over the years. I didn't findone. There was a hint of a PC version on the XBattle home page (aprogram called Energy Battle) but that has long since disappeared. So,as I was looking for a hobby project at the time, I thought I'd portXBattle to windows thinking "how hard could it be?".<p>The answer is <i>very</i>. XBattle was written for the UNIX X-Window systemand is so tied into the way that works that getting the original codeworking under Windows would have taken quite a while. Also, theoriginal code is written in C when I prefer C++. So I wrote a Windowsversion from scratch.<p>Although I didn't use any of Greg's original code I wanted to carry onthe spirit of XBattle and release my version as free software. Ane-mail exchange with Greg verified he had no problem with this as longas I changed the name slightly to indicate that it is not an"official" follow-on from XBattle. Hence WinBattle.  <p>The demo project is, of course, a very fun game. However, I wanted torelease it as free software so that budding programmers have a(relatively) simple example of a way to build multi-player games. Justgetting programs to talk to each other has always been hard work andWinBattle includes an easy to use mechanism that can be reused inother projects.  <h3>Trying Out The Demo</h3><p>You'll find client and server programs available for download(WinBattle_demo.zip). Run the server on a PC and start up to 6 clientson networked PCs with the command:<p> winbattle <i>server computer name</i><p>Where <i>server computer name</i> is the name of the computer where theserver is running.<p> Or create a shortcut that does the same thing (by the way, the defaultserver computer name is <i>localhost</i> so if you want to try it out on justone PC just start the server and one or two clients on that machine toplay). Press the start button on the server and away you go.<p>The server has a small number of options that are available in thedialog that looks like this:<P><IMG SRC="Full Tutorial_files/image004.jpg" ><p>The <i>Explore</i> option means your troops have to scout out the terrainbefore you can see what's there. Turn it off and all players see thewhole board from the start.<p>The <i>Attrition</i> option will cause troops to slowly waste away. Thisprevents the build up of totally massive amounts of troops.<p>The <i>Group Bases</i> option does just that. A player's bases will bepositioned close together when this option is set and randomlyscattered when it isn't.<p>The <i>Disrupt</i> option will cause enemy movement vectors to becancelled when attacked. This allows a small number of troops to wrecksupply lines that have to be constantly repaired.<p>The <i>Hide Enemy Vectors</i> option means you can only see an enemy'smovement vectors if there are troops present in the cell (thisprovides a stealthier start to games as tracks back to your basesaren't obviously visible if you scout with a small number of troops).<p>Finally, you can set the number of bases each player is given.<p>On the client side the commands implemented are:<p> <b>Mouse:</b><p>left mouse button - Set a movement vector adding to any already set<br>right mouse button - Set a movement vector cancelling any others<br>shift + left mouse - March troops automatically across the board<br>Click in centre of cell - Cancel all movement vectors<p> <b>Keyboard:</b><p> a - Attack: position cursor over cell to attack<br>f - Fill-in sea: set one movement vector to point to the sea cell to fill in<br>s - Scuttle a base: position cursor over base to scuttle <p>And that's basically it. If you would like a considerably moredetailed description of how to play I recommend you visit the<A HREF="http://cns-web.bu.edu/pub/xpip/html/xbattle.html">XBattle Home Page</A>and read the first few pages of the tutorial. As far as thebasic operation is concerned XBattle and WinBattle are prettyidentical.<h3>Project Contents</h3>The source code zip file expands to produce the following folders:<p>Client - Contains the client-side specific code<br>Common - Contains utility functions used by the client and server<br>Game - All of the code that is specific to WinBattle is held here<br>Notes - Holds the full tutorial (in HTML format)<br>Server - Contains the server-side specific code<p>The project was built with Visual Studio version 6 although it hasalso been tried with Visual Studio .Net. Should you want to compilethe source code you only need to compile and build the client andserver components. They will automatically pull in what they need fromthe <i>common</i> and <i>game</i> folders.  <h3>Tutorial Introduction</h3> <p>This tutorial section talks about the WinBattle client server programsin general (how they start-up, communicate, etc.). There is nothingrelated to the game itself here because the client and server codedoesn't really care which game it's running.<p>What this means is that if you want to write a new game all you haveto do is write the game code. You can re-use the client and servercode pretty much as is. Of course, it isn't <i>quite</i> that simple but moreon this later.  <p>Note, although you can read this tutorial in isolation, to get themost from it you really should take a peek at the code in the clientand server folders to get a feel for what's going on. Pretty mucheverything else can be ignored.<p>Anyway, as should be apparent by now, there are two programs used torun the game: a server and a client. The server actually runs thegame, updating the board in real-time and sending the current state toall the clients. The client does very little. It displays the currentstate of play and accepts commands from the player which it justpasses on to the server.<p>The clients and server communicate using sockets. Sockets can betricky to get right so all of the detail is hidden in a <i>Socket</i>class. As far as using it is concerned, it's just like reading andwriting from a file. For example, to send some value from a clientprogram to the server just requires the following line of code in theclient:<pre>server << some_value << "\n";</pre><p>In order to read this value in the server, again, just requires oneline of code:<pre>client >> some_value;</pre><p>You can find more details on using the Socket class later on in thetutorial. For now, we'll concentrate on how the client and serverprograms interact.<h3>Start-up</h3> <p>The server main program can be found in <i>server.cpp</i>. All thisdoes is pop up a dialog box that allows a number of options to be setsuch as the number of bases, whether bases are grouped together,etc. All of the dialog handling can be found in<i>main_dialog.cpp</i>. It's pretty much standard Windows programmingalthough some of the details of the Windows API calls are tucked awayin the class <i>Control</i> for readability.As part of the dialog initialisation, the server starts two threads:<i>game_handler</i> and <i>update_handler</i>. The first threadhandles commands going back and forth between the clients and theserver and the second thread sends game updates to the clients oncethe game is actually started.<p>Actually establishing the network communication is probably thehardest part so let's begin by looking at the <i>game_handler</i>thread, the core of its operation is the following code:<pre>Socket server(server_port);while (true) {   server.listen();   for (int i = 0; i < max_players; i++) {       if (! clients[i].in_use) {          clients[i].connection = server.get_connection();          clients[i].in_use     = true;          DWORD thread_id (0);          CreateThread(0, 0, client_handler,                        reinterpret_cast<LPVOID>(i), 0, &thread_id);          break;       }   }}</pre><p>The code creates a socket telling it the port number to use. Portnumbers are just a unique number so that many programs can use socketswithout worrying about getting other program's messages. As long asthe clients and servers both use the same number then everythingshould work just fine. The default for the WinBattle client andservers is set at 3333 as there isn't much chance of that number beingin use on most PCs. However, if it is and you get a "port in use"error when you start the server, you can change it to any free port(you'll find that the port number is defined in the <i>common</i>folder in the file<i>universal.h</i>). <p>You can find out which ports are in use on your PC by issuing thefollowing command at a DOS prompt (the port numbers are the ones afterthe ":" in the command output):<pre>netstat -a</pre><p>The thread then calls <i>listen</i>. This function will simply waituntil some client program says it wants to communicate with the serveron port 3333 (this is done from the client with a call to<i>connect</i> in <i>client.cpp</i>). Once a client has connected the<i>listen</i> function returns and the code runs through a table of

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
av欧美精品.com| 日韩一级二级三级| 全部av―极品视觉盛宴亚洲| 欧美精品一区二区三| 欧美主播一区二区三区美女| 国产美女在线精品| 日本在线不卡视频| 亚洲摸摸操操av| 亚洲午夜在线观看视频在线| 精品国产1区2区3区| 欧美日韩一级片在线观看| 成人免费视频视频在线观看免费| 日韩电影在线免费观看| 亚洲免费资源在线播放| 国产精品久99| 中文在线一区二区| 精品国产区一区| 91精品久久久久久蜜臀| 91国内精品野花午夜精品| 成人激情图片网| 国产福利视频一区二区三区| 蜜臀91精品一区二区三区| 亚洲第一激情av| 亚洲午夜视频在线观看| 中文字幕一区二区在线播放| 国产午夜亚洲精品羞羞网站| 精品粉嫩aⅴ一区二区三区四区| 在线不卡欧美精品一区二区三区| 色94色欧美sute亚洲13| 91视频com| 色天天综合久久久久综合片| 99视频超级精品| 色综合天天在线| 99久久99久久精品免费观看 | 中文字幕精品在线不卡| 26uuu精品一区二区| 欧美大片在线观看| 精品精品欲导航| 精品国产乱码久久久久久闺蜜| 欧美三级蜜桃2在线观看| 色综合一个色综合亚洲| 色综合久久久久久久久久久| 色综合夜色一区| 91精品1区2区| 欧美亚洲国产怡红院影院| 欧美在线你懂得| 欧美日韩精品综合在线| 91麻豆精品国产自产在线观看一区| 在线成人免费观看| 精品裸体舞一区二区三区| 午夜婷婷国产麻豆精品| 亚洲国产一区二区三区青草影视| 一区二区三区电影在线播| 亚洲高清三级视频| 美女一区二区三区| 国产乱码字幕精品高清av| 成人免费视频国产在线观看| 色婷婷综合视频在线观看| 欧美日韩中文精品| 日韩欧美123| 国产精品久久久久毛片软件| 亚洲欧美日韩在线不卡| 亚洲成av人片一区二区梦乃| 久久99久久99| 成人午夜伦理影院| 在线观看视频一区二区欧美日韩| 91精品国产入口| 26uuu欧美| 亚洲美女淫视频| 蜜臀av性久久久久蜜臀aⅴ| 成人三级伦理片| 欧美日韩成人综合| 欧美国产1区2区| 亚洲一区免费观看| 精品系列免费在线观看| av在线一区二区三区| 欧美高清视频一二三区 | 丰满少妇在线播放bd日韩电影| 不卡的电影网站| 51精品国自产在线| 欧美国产日韩一二三区| 亚洲成人午夜影院| 高清不卡一二三区| 欧美情侣在线播放| 中日韩av电影| 美洲天堂一区二卡三卡四卡视频| 成人中文字幕在线| 884aa四虎影成人精品一区| 日本一区二区久久| 青青草国产精品97视觉盛宴| 不卡一区二区三区四区| 日韩欧美视频一区| 亚洲国产综合在线| 成人午夜电影久久影院| 91精品国产全国免费观看| 亚洲欧洲精品一区二区三区不卡| 美女mm1313爽爽久久久蜜臀| 色婷婷综合久久久久中文一区二区 | 欧美成人伊人久久综合网| 国产精品久久国产精麻豆99网站| 久久黄色级2电影| 欧美性色黄大片| 中文字幕制服丝袜一区二区三区| 韩日精品视频一区| 欧美一区二区三区四区在线观看| 亚洲视频一区在线观看| 高清视频一区二区| 国产亚洲综合色| 久久精品国产精品亚洲精品| 欧美日韩一区久久| 一区二区三区欧美在线观看| 粉嫩一区二区三区在线看| 欧美电视剧在线观看完整版| 亚洲一区二区精品视频| 成人精品电影在线观看| 久久夜色精品国产噜噜av| 日本午夜精品视频在线观看| 色呦呦网站一区| 中文字幕制服丝袜一区二区三区| 国产成人综合自拍| 精品粉嫩aⅴ一区二区三区四区| 午夜成人免费电影| 欧美亚洲一区二区在线| 亚洲精品成人天堂一二三| 成人白浆超碰人人人人| 国产免费成人在线视频| 国产乱一区二区| 久久蜜桃香蕉精品一区二区三区| 久久精品国产免费| 欧美一级电影网站| 麻豆成人免费电影| 日韩欧美一区二区久久婷婷| 美女网站在线免费欧美精品| 日韩精品一区二区三区在线| 日本亚洲欧美天堂免费| 欧美一区二区三区四区高清| 日韩av午夜在线观看| 欧美草草影院在线视频| 国模大尺度一区二区三区| 久久精品无码一区二区三区| 国产91丝袜在线播放0| 视频一区免费在线观看| 在线不卡一区二区| 另类的小说在线视频另类成人小视频在线| 久久精品理论片| 日韩欧美成人午夜| 韩国成人福利片在线播放| 国产日产亚洲精品系列| eeuss鲁片一区二区三区| 最新久久zyz资源站| 色欧美日韩亚洲| 亚洲成人在线观看视频| 日韩一区二区视频| 国产精品一二三四| 国产精品久久久久三级| 欧美综合久久久| 日本aⅴ亚洲精品中文乱码| 精品国产欧美一区二区| 成人sese在线| 亚洲va欧美va人人爽| 精品女同一区二区| zzijzzij亚洲日本少妇熟睡| 一区二区三区在线免费播放 | 国产精品热久久久久夜色精品三区| 成人精品一区二区三区四区| 亚洲人成网站在线| 日韩一区和二区| 粉嫩蜜臀av国产精品网站| 亚洲精品国久久99热| 欧美一区二区三区四区五区| 国产成人自拍网| 亚洲午夜日本在线观看| 亚洲精品在线免费播放| 91在线无精精品入口| 免费一级欧美片在线观看| 国产日产欧美一区二区视频| 欧美丝袜丝交足nylons| 黑人巨大精品欧美黑白配亚洲| 亚洲欧美另类小说视频| 欧美成人乱码一区二区三区| 91免费看视频| 激情文学综合网| 亚洲电影激情视频网站| 国产亚洲婷婷免费| 欧美日韩一区小说| 成人免费看片app下载| 三级久久三级久久| 国产精品二三区| 精品久久久三级丝袜| 欧美系列亚洲系列| 粉嫩13p一区二区三区| 日韩中文字幕av电影| 亚洲欧美视频一区| 国产亚洲欧洲997久久综合| 日本道色综合久久| 国产成人av一区二区| 免费xxxx性欧美18vr| 亚洲一区二区三区视频在线播放| 久久久精品影视| 欧美一区二区三区视频免费|