• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            天行健 君子當(dāng)自強(qiáng)而不息

            Getting Online with Multiplayer Gaming(4)

             

            Creating a Multiplayer Game Architecture

            When creating your game, if you were to stop mid-stream and try to add multiplayer
            features (features you hadn’t planned on including) chances are you would
            have a hard time making everything work out correctly. Let’s face it—you need to
            be prepared ahead of time, and if your game is going to be multiplayer-compatible,
            you must make sure that you have a solid foundation on which to work.

            You start by understanding what you’re up against when using networks and what
            you can do to ensure that everything works correctly. It will be helpful to look at
            how to use a client/server network architecture.

            NOTE
            A client application is the program the player interacts with during a networked gaming session.
            A server is the network application that serves as the central processing hub of the gaming
            world. Client applications connect to servers and begin communicating player actions back and
            forth. However, ultimately, the server handles the majority of the game-processing functionality.

             

            Working Together: The Client and the Server

            The client and the server communicate back and forth continuously. As players
            (the clients) perform actions in the game, those actions are sent as messages to the
            server for verification. The server, in order to maintain synchronization, takes the
            players’ actions, updates the game world, and then sends game updates to the
            clients. In this way, the server maintains the entire gaming world, whereas the
            clients are merely systems for collecting the players’ actions (and displaying their
            eventual outcomes on the clients’ screens).

            The types of messages sent between the server and clients are numerous, but with
            some well thought-out design, those messages are easily manageable. The messages
            can be the following:

            ■ Connection requests. Joining in a game means connecting to a server. Not
            just anyone can join, however; the server might be operating at its limit or
            the player might not have a valid account. Once a client is connected, the
            real action(s) begin!

            ■ Navigation. Players can move around maps, usually by pressing an arrow on
            the keyboard or clicking their destination on the map. Clients send in movement
            requests and leave it up to the server to return game update messages.

            ■ Combat. With swords swinging and spells erupting, it seems too much to
            deal with. If you were to strip away the fluff, however, you would discover that
            combat is nothing more than an attacker with his form of attack and a
            defender with his form of defense. Clients are the only ones to request combat;
            it’s the job of the server to take combat requests and work them into the
            game updates.

            ■ Resource management. With a world full of goods, players want to be able to
            buy, sell, find, and use just about any resource that they can get their hands
            on. I’m beginning to repeat myself, because resource management comes
            from the client, and requests are sent to the server to use for updates.

            ■ Conversation. What fun is a multiplayer game without the social interaction?
            Characters talk to each other in order to learn vital information or just to
            shoot the breeze. Either way, this is a simple matter of displaying a few lines
            of text. This conversation works both ways, from clients sending in text to the
            server returning text to display.

            ■ Game updates. As mentioned, the server needs to let all clients know the
            state of the game periodically, and the game update messages are just the
            ticket. Game updates usually include the positions of all characters in the
            game, plus information about items and other game resources.


            posted on 2007-12-18 14:58 lovedday 閱讀(171) 評(píng)論(0)  編輯 收藏 引用


            只有注冊(cè)用戶(hù)登錄后才能發(fā)表評(píng)論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問(wèn)   Chat2DB   管理


            公告

            導(dǎo)航

            統(tǒng)計(jì)

            常用鏈接

            隨筆分類(lèi)(178)

            3D游戲編程相關(guān)鏈接

            搜索

            最新評(píng)論

            久久久国产精品网站| 久久精品国产亚洲AV香蕉| 久久久久国产| 色综合久久久久久久久五月| 精品水蜜桃久久久久久久| 久久大香香蕉国产| 久久精品二区| 无码AV波多野结衣久久| 久久久WWW免费人成精品| 亚洲精品午夜国产VA久久成人| 亚洲狠狠久久综合一区77777| 欧美激情精品久久久久久久九九九| 久久99精品久久久久久久不卡| 久久SE精品一区二区| 亚洲а∨天堂久久精品| 欧美精品福利视频一区二区三区久久久精品 | 久久天天躁夜夜躁狠狠躁2022| 久久精品国产亚洲AV无码麻豆| 久久久精品久久久久特色影视| 久久人人爽人人爽人人片av高请 | 国产精品视频久久| 久久综合九色综合精品| 午夜精品久久久久久久| 色天使久久综合网天天| 久久综合九色综合网站| 精品水蜜桃久久久久久久| 久久青青草原国产精品免费 | 久久精品国产欧美日韩| 久久综合丁香激情久久| 久久狠狠高潮亚洲精品| 久久夜色精品国产欧美乱| 久久久久久国产精品美女| 一本一道久久a久久精品综合| 久久精品亚洲AV久久久无码| 色婷婷久久综合中文久久一本| 久久精品成人欧美大片| 久久人人爽人爽人人爽av| 久久久精品国产Sm最大网站| 手机看片久久高清国产日韩| 久久香蕉国产线看观看猫咪?v| 久久伊人精品青青草原日本|