• <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(5)

             

            A couple of things quickly come to mind when using the type of network communications
            just mentioned. First, because the server is the only system responsible for
            maintaining the game state, all connected clients would have to wait for those periodic
            updates to keep the game flowing.

            Unfortunately, network transmission speeds don’t allow instantaneous
            transmissions, so some of the data passing from client to server and
            back again are delayed. This delay in transmission is called latency, and it's
            this latency that can cause havoc in your game.

            NOTE
            Latency is measured in milliseconds (ms).

            Because the server is the only system allowed to make changes to the game world,
            the server must validate players’ actions before they can occur. As you can see from
            Figure 19.4, players trying to issue actions will experience a delay from the time the
            actions are initiated to the time they take place. This delay of action, called lag, can
            cause the game-play to be choppy (and thus unplayable).

            To keep things running smoothly and help alleviate the effects of latency and lag,
            clients are allowed to make small changes to the world between server updates.
            Those small changes are typically only to update the movement of characters. In
            that way, clients don’t have to wait for server updates in order to move characters;
            clients can just guess how to update all characters based on their last known state
            (as you can see in Figure 19.5). This form of guessing is called dead reckoning, and
            it is used in network gaming.

            When more serious actions, such as combat actions, come into play, using dead
            reckoning is unacceptable. The server is the authority, and if a system needs to
            determine who hits whom and how much damage is done, that system needs to
            query the server for resolution.

            As mentioned, when using a networking system, the second problem is game timing. Let’s
            face it—trying to synchronize possibly dozens of clients is almost impossible. Each computer
            hooked on the network has a different latency; some clients take longer sending messages
            to the server and receiving them back from the server.

            CAUTION
            If you leave any of the major decisions (such as combat) up to a client, you’re inviting trouble,
            because game hackers and cheaters will take full advantage of any loopholes. Remember
            that the server is the only system responsible for keeping track of the game; the clients are
            merely portals into the game world.

            On the client side, one player might make a move at the exact time as another
            player, but because their actions take a moment to reach the server, the client with
            the faster connection will have the advantage (as illustrated in Figure 19.6).

            All messages received by the client and server are recorded with the time of their
            receipt. The server uses that time to determine how to update the players. For
            example, if a message received by the server isn’t processed within 100 milliseconds
            (ms), the server compensates for that amount of time during updates. The same
            goes for clients. If an action message needs to be updated (especially during the
            use of dead reckoning), that time (the time the messages are received) is used to
            move characters appropriately.

            Now that you have an overview of how the clients and server work
            together, take a closer look at each one.

            TIP
            To help improve synchronization, the client and server both calculate latency into the
            time that a message is received.


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


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


            公告

            導(dǎo)航

            統(tǒng)計(jì)

            常用鏈接

            隨筆分類(178)

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

            搜索

            最新評(píng)論

            久久婷婷人人澡人人| 国产精品无码久久四虎| 人妻精品久久无码区| 97精品久久天干天天天按摩| 久久99久久无码毛片一区二区| 亚洲国产精品综合久久网络| 久久精品国产亚洲av高清漫画| 久久精品国产精品亚洲艾草网美妙| 精品综合久久久久久97| 日本精品久久久中文字幕| 久久久久久曰本AV免费免费| 亚洲成人精品久久| 亚洲AV无码久久精品狠狠爱浪潮| 91精品国产91久久久久久| 久久精品国产乱子伦| 久久久久四虎国产精品| 无码伊人66久久大杳蕉网站谷歌| 久久久久九国产精品| 久久午夜电影网| 久久精品蜜芽亚洲国产AV| 亚洲v国产v天堂a无码久久| 国内精品久久久久久久涩爱| 国产人久久人人人人爽| 囯产精品久久久久久久久蜜桃| 美女久久久久久| 久久精品成人免费观看97| 青青青国产精品国产精品久久久久| 国产亚洲精久久久久久无码77777 国产亚洲精品久久久久秋霞 | 日韩精品久久久肉伦网站| 国产精品中文久久久久久久| 久久乐国产精品亚洲综合| 久久久久这里只有精品 | 日日狠狠久久偷偷色综合免费 | 狠狠色丁香久久综合五月| 久久精品国产亚洲AV无码娇色| 少妇人妻88久久中文字幕| 日韩AV无码久久一区二区| 97r久久精品国产99国产精| 久久成人国产精品二三区| 久久亚洲国产欧洲精品一| 亚洲一本综合久久|