<html>

<head>
<title>loonygames presents: Game Networking 101</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
a { text-decoration: none; }
a:hover { color:000000;  text-decoration: underline; }


</style>
</head>

<body bgcolor="#FFF4D0" link="#3333FF" vlink="#000000" alink="#000000">
<center>
</center>
<table width="100%" border="0" bgcolor="#3596B3" height="58">
  <tr> 
    <td height="69" width="29%" align="left" valign="top"> 
      <div align="left"> <font face="Arial, Helvetica, sans-serif" color="#FFFFFF"><b><i><img src="../../images/logo_new.jpg" width="182" height="63" border="0" usemap="#logoa"> 
        </i></b></font></div>
    </td>
    <td height="69" width="29%" align="center" valign="top"> <center>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-2373963192914918";
/* 468x60 */
google_ad_slot = "3417104156";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</center>
    </td>
  </tr>
</table>
<table width="100%" border="0" bgcolor="#3596B3" height="29">
  <tr> 
    <td height="20" width="25%" align="center" valign="middle" bgcolor="#86531A"> 
      <a href="../../../about.1"><font face="Arial, Helvetica, sans-serif" color="#FFFFFF"><b><font size="2">about</font></b></font></a></td>
    <td height="20" width="25%" align="center" valign="middle" bgcolor="#86531A"> 
      <a href="../../../feedback.1"><font face="Arial, Helvetica, sans-serif" color="#FFFFFF" size="2"><b>feedback</b></font></a></td>
    <td height="20" width="25%" align="center" valign="middle" bgcolor="#86531A"> 
      <a href="../../../archives/index.html"><font face="Arial, Helvetica, sans-serif" color="#FFFFFF" size="2"><b>archives</b></font></a></td>
    <td height="20" width="25%" align="center" valign="middle" bgcolor="#86531A"> 
      <b><a href="../../../submissions/index.html"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif" size="2">submissions</font></a></b></td>
  </tr>
</table>
<div align="center"> <br>
</div>
<table width="100%" border="0">
  <tr> 
    <td width="72%"> 
      <h5><b><font face="Arial, Helvetica, sans-serif">//<a href="../../../index.html"><font color="#7C420E">loonygames</font></a>://<a href="../index.html"><font color="#7C420E">issue 
        2.10</font></a>://<a href="index.html"><font color="#7C420E">Game Networking 
        101</font></a>://<a href="index.php"><font color="#7C420E">1</font></a>, 
        <a href="index2.php"><font color="#7C420E">2</font></a>, <a href="index4.php"><font color="#7C420E">3</font></a>, 
        <a href="index4.php"><font color="#7C420E">4</font></a>, <a href="index5.php"><font color="#7C420E">5</font></a>, 
        <a href="index6.php"><font color="#7C420E">6</font></a>, <a href="index7.php"><font color="#7C420E">7</font></a>, 
        8</font></b></h5>
    </td>
    <td align="right" valign="middle" width="28%"> 
      <div align="right"> 
        <h5><a href="../../cgi/printme.pl?url=%252F2.10%252Ffeat%252F"><img src="../../images/icons/print01.gif" width="27" height="27" align="baseline" border="0" alt="switch to printer-friendly version"></a></h5>
      </div>
    </td>
  </tr>
</table>
<br>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" valign="top" width="25%"> 
      <table border="0" width="99%" bgcolor="#D7B582" align="center" bordercolor="#E0E0E0">
        <tr> 
          <td align="LEFT" valign="TOP" width="100%"> <font color="#000000" face="Arial, Helvetica, sans-serif" size="2"> 
             </font> <p><webdog><font face="Arial, Helvetica, sans-serif" size="2" color="#0022A8"><b><font color="#693A0C">What's 
           new today:</font></b></font> 
          
<p><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="../../../index.html" target=""><b><font color="#00025E">New!!!</font></b></a><br></b>
  The archives have been cleaned up, dead links fixed, and the printable versions restored! Also, don't miss the new comments on the main page!</font></p>

 
<p><b><font face="Arial, Helvetica, sans-serif" size="2"><a href="../../2.15/feat/index.html" target=""><b><font color="#00025E">Livin' 
  With The Sims</font></b></a><br></b>
  theAntiELVIS explores the wild and wacky world that is Will Wright's <b>The Sims</b>, 
  asking the inevitable quesiton, &quot;is <b>The Sims</b> the first step toward a virtual 
  life where everyone is Swedish?&quot;</font></p>
<p><font color="#000000" face="Arial, Helvetica, sans-serif" size="2"><a href="../../2.15/pixel/index.html" target=""><b><font color="#00025E">Pixel 
  Obscura </font></b></a></font><font face="Arial, Helvetica, sans-serif" size="2"><br>
  Josh Vasquez on <b>Omikron: The Nomad Soul</b>.</font></p>
<p><font color="#000000" face="Arial, Helvetica, sans-serif" size="2"><a href="../../rl/index.html" target=""><b><font color="#00025E">Real 
  Life </font></b></a></font><font face="Arial, Helvetica, sans-serif" size="2"><br>
  Check out our newest comic strip, <b>Real Life</b>! Updated daily!</font></p>
<p><font color="#000000" face="Arial, Helvetica, sans-serif" size="2"><a href="../../uf.1" target=""><b><font color="#00025E">User 
  Friendly</font></b></a></font><font face="Arial, Helvetica, sans-serif" size="2"><br>
  Updated daily!</font></p>
<p></webdog> </p>
 
            <p></p>
            <p> </p>
            <p></p>
             
            </td>
        </tr>
      </table>
      <br>
      <table width="100%" border="0" bgcolor="#D7B582">
        <tr bgcolor="#D7B582"> 
          <td> 
            <div align="center"> 
              <p align="left"><font size="-1"><font face="Arial, Helvetica, sans-serif" size="2" color="#0022A8"><b><font color="#00025E">Random 
                Feature:</font></b></font> </font> </p>
              <p><p align="CENTER"><img src="../../images/raven_thum.jpg" width="93" height="93" align="MIDDLE"></p><p><font face="Arial, Helvetica, sans-serif" size="-1"><a href="../../1.36/feat/index.html">Inside Raven Software</a>: Our definitive history of the company behind <B>Hexen</b>, <B>Heretic</b> and other classics.</font></p>

<i><font face="Arial, Helvetica, sans-serif" size="-2"> 
                </font> </i></p>
            </div>
          </td>
        </tr>
      </table>
      <br>
      <table width="99%" border="0" bgcolor="#D7B582">
        <tr> 
          <td> 
            <div align="center"> 
              <form method="get" action="http://www.google.com/custom" name="">
                <font face="Arial, Helvetica, sans-serif" size="-1"><b><font color="#339900">Search 
                the Archives!</font></b></font> 
               
                 <INPUT TYPE=text name=q size=12 maxlength=255 value="">
 <INPUT type=submit name=sa VALUE="Google Search">
 <INPUT type=hidden name=cof 
VALUE="LW:216;L:http:/home/loonygames/loony.timedoctor.org/content/images/logo1.jpg;LH:55;AH:center;S:http://www.loonygames.com;AWFID:13a298c7abe84fd0;">
<input type=hidden name=domains value="loonygames.com"> 
<input type=hidden name=sitesearch value="loonygames.com">               
</div>
              </form>

              <p align="left"><i> </i></p>
            </div>
          </td>
        </tr>
      </table>
    </td>
    <td width="75%" align="center" valign="top"> 
      <table width="90%" border="0" cellpadding="0" align="center">
        <tr> 
          <td width="50%" valign="top"> 
            <table width="98%" border="0">
                <tr> 
                  <td width="55%"> 
                    <div align="left"> 
                      <p><b><font face="Arial, Helvetica, sans-serif" color="#0000FF"><i><font color="#904C10" size="3">Game 

                        Networking 101</font></i></font></b><br>
                      
                      <div align="right"> <font face="Arial, Helvetica, sans-serif" size="-1">By 
                        <a href="mailto:jsimpson@ravensoft.com">Jake Simpson</a></font></div>
                    </div>
                  </td>
                  <td width="45%" align="right" valign="top"> 
                    <h5 align="right"><b><font face="Arial, Helvetica, sans-serif" color="#00025E">Vol. 
                      2, Issue 10 <br>
                      January 31, 2000&nbsp; </font></b></h5>
                  </td>
                </tr>
              </table>
              <loonystart> 
              
              <p align="right">&nbsp;</p>
              <p align="left"> <font face="Arial, Helvetica, sans-serif">Now we'll 
                take a moment and talk about client prediction. And what a clever 
                but nasty beast this is. In the cases where both the client misses 
                a packet from the server, and the time between getting normal 
                gaming packets, (think about it - the server may only be running 
                at 10fps, but that doesn't mean you want the client side representation 
                to), the client needs to be doing something to make it look like 
                it IS still getting data. So we predict the world and events in 
                it. Since we know what's going on with the client's player - after 
                all, we are right there at the input point right? - we can predict 
                what he is going to do. If he fires a weapon, we can show it on 
                screen, since that's what we know he's going to do. We can also 
                predict - to a lesser degree - what the other players are doing, 
                at least to complete out any animations they may be in, if they 
                are dropping still have gravity performed on them and so on. Now 
                of course this only works for a time measured in seconds, but 
                usually that's enough for the packet system to come back on line, 
                and start re-receiving stuff from the server, at which time the 
                client can correct itself for any events that it predicted wrong. 
                At the best, it's totally on target, and you will never have known 
                that you were missing data. At middle, the client is a bit out, 
                so it starts correcting via a smoothing operation, that way no 
                one 'snaps' really obviously to a new location. And at worst, 
                you are dead via an attack you didn't even see, since it occurred 
                while you were missing packets. However, there is no way around 
                this situation so it's something that has to be lived with, and 
                it's better than jerky motion and snapping updates.</font></p>
              <p align="left"></p>
              <p align="left"><font face="Arial, Helvetica, sans-serif">However, 
                what do you do if you miss a baseline packet? IE one that has 
                a new object in it that wasn't there before? You've missed all 
                the information that came down initially, but you will be getting 
                updates from that point on. Well, to be honest - that&#146;s the 
                trick isn't it? I've given away most of the tricks of the trade 
                already, but some must remain. I'll give you a clue though; it 
                is possible to fix a situation like this :)</font></p>
              <p align="left"></p>
              <p align="left"><font face="Arial, Helvetica, sans-serif">In every 
                type of game there are some packet types that WILL require a guaranteed 
                delivery. So be prepared to create some kind of structure to cope 
                with this, because UDP doesn't. But be sure you don&#146;t use 
                it too much or you will end up back with the same problems that 
                TCP/IP has.</font></p>
              <p align="left"></p>
              <p align="left"><font face="Arial, Helvetica, sans-serif">Online 
                Cheating. There are a few ways to try to deal with this, but be 
                warned, what's man-made is man-hackable. This is not so much a 
                big deal at big frag fests since all the matches there are moderated, 
                but it can have an impact on those that qualify for these fests. 
                And of course, it just plain sucks to be playing on a server where 
                someone is unbeatable because they are cheating. Cheating can 
                occur in many ways, modifying the client to never display walls 
                in the game, adding lights or white skins to other players, displaying 
                a local map (if you want to get really ambitious), modifying your 
                aim so it's always dead on other players, or simply firing a weapon 
                at an opponent with deadly aim the moment they are in sight. All 
                of these are hacks to the client end of the game, and when done 
                properly, are pretty un-observable back at the server. There is 
                some stuff you can do, checking the accuracy of each player and 
                dumping those that go over a certain scale. You may lose some 
                really good players that way, but it's unlikely that anyone can 
                get over an 80% hit rate all the time. All the checks of the client 
                in the world can really be gotten around since the result of the 
                check has to be returned to the server at some point, and if it's 
                intercepted there and replaced with what the server expects, the 
                server is fooled. Using the result to decrypt the data that comes 
                from the server is possible, but again, it's done on the client 
                side and with enough patience and a good dis-assembler it can 
                be gotten around. Client integrity is the key here, and keeping 
                it the aim. The<b> Quake </b>1 &amp; 3 solution, that of a virtual 
                machine, where instead of the client loading the game up the client 
                'builds' or 'compiles' the game it's going to run via instructions 
                from the server, is a good start, since re-writing someone else's 
                compiler is beyond all but the very best of hackers. God knows, 
                writing it in the first place is a nightmare I wouldn't want to 
                contemplate. But it is within the bounds of possibility. All the 
                games developer can do is make it as difficult as he possibly 
                can for the budding hacker and be content with that.</font></p>
              <p align="left"></p>
              <p align="left"><b><font face="Arial, Helvetica, sans-serif">Last 
                thoughts for Developers.</font></b></p>
              <p align="left"></p>
              <p align="left"><font face="Arial, Helvetica, sans-serif">Peter 
                Lincroft who was involved with <b>X Wing vs. TIE fighter</b> had 
                an article in Game Developer Magazine and did a talk at GDC last 
                year about his experiences with net gaming, and I'd like to reiterate 
                some of his idea's here for completeness sake.</font></p>
              <p align="left"><font face="Arial, Helvetica, sans-serif">When testing 
                a game, make sure you find a really horrible ISP to do some real 
                Internet testing. Most games get built and tested to start with 
                on the internal LAN at the developer's offices. This isn't really 
                a fair test, since LAN's rarely drop packets and have great PING's. 
                Find a bad ISP and do some REAL testing. This really works wonders 
                for you later.</font></p>
              <p align="left"></p>
              <p align="left"><font face="Arial, Helvetica, sans-serif">Emulate 
                Internet conditions. Stick some code into your code base that 
                emulates packet dropping. Have it settable so you know at what 
                point your game is going to break down - is it 10% drop out or 
                30%? These are things you should know so you can automatically 
                drop someone from a game if this occurs. Something to bear in 
                mind here is that the Internet doesn't typically just drop one 
                packet. Usually they occur in batches, so don't just dump one 
                at a time, do them several at a time.</font></p>
              <p align="left"></p>
              <p align="left"><font face="Arial, Helvetica, sans-serif">Remember 
                your server is going to be sending out far more data than each 
                client has to worry about. If client messages are around the 2k 
                mark a second, and there are 10 clients, then the server is banging 
                out 10x2k packets, which is 20k. Be sure that the communications 
                infrastructure you are using is capable of supporting this.</font></p>
              <p align="left"></p>
              <p align="left"><font face="Arial, Helvetica, sans-serif">Well there 
                you have it, some ramblings and thoughts on Networking 101 for 
                Games. I've probably made some mistakes, but the gist of it should 
                be sound. Have fun out there, and be amazed it works at all. :)</font></p>
              <p align="left"></p>
              <p align="left"><font face="Arial, Helvetica, sans-serif">Big thanks 
                must go to James Monroe for adding any inaccuracies this article 
                may have. Blame him and send him mail for any mistakes instead 
                of me.</font></p>
              <p align="left"></p>
              <p align="left"></p>
              <p align="left"></p>
              <p align="left"></p>
              <p align="left"></p>
              <p align="left"></p>
              <p align="left"></p>
              <p align="left"><font face="Arial, Helvetica, sans-serif"><br>
                - Jake Simpson is a code monkey for Raven Software. He's badass.</font></p>
              <p></p></loonystart>
             
              <p align="left"><font face="Arial, Helvetica, sans-serif"><br>
                </font></p>
              <div align="center"> 
                <p align="left"><font face="Arial, Helvetica, sans-serif"> </font><font face="Arial, Helvetica, sans-serif"> 
                  </font></p>
              </div>
              <table width="100%" border="0">
                <tr> 
                  <td width="50%"><font face="Arial, Helvetica, sans-serif"><a href="index7.php"><font color="#7C420E"><b><font size="+1">&lt;&lt;Prev</font></b></font> 
                    </a></font></td>
                  <td width="50%"> 
                    <div align="center"> 
                      <p align="left"></p>
                      <p align="left"></p>
                    </div>
                    <p align="right">&nbsp; 
                  </td>
                </tr>
              </table>
    
            
            </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<br>
<table width="100%" border="0" bgcolor="#3596B3" height="29">
  <tr> 
    <td height="20" width="25%" align="center" valign="middle" bgcolor="#86531A"> 
      <a href="../../../about.1"><font face="Arial, Helvetica, sans-serif" color="#FFFFFF" size="2"><b>about</b></font></a></td>
    <td height="20" width="25%" align="center" valign="middle" bgcolor="#86531A"> 
      <a href="../../../feedback.1"><font face="Arial, Helvetica, sans-serif" color="#FFFFFF" size="2"><b>feedback</b></font></a></td>
    <td height="20" width="25%" align="center" valign="middle" bgcolor="#86531A"> 
      <a href="../../../archives/index.html"><font face="Arial, Helvetica, sans-serif" color="#FFFFFF" size="2"><b>archives</b></font></a></td>
    <td height="20" width="25%" align="center" valign="middle" bgcolor="#86531A"> 
      <b><a href="../../../submissions/index.html"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif" size="2">submissions</font></a></b></td>
  </tr>
</table>
<table width="100%" border="0" bgcolor="#3596B3" height="29">
  <tr> 
    <td height="20" width="35%"><a href="../../../index.html"><font face="Arial, Helvetica, sans-serif" color="#FFFFFF"><b><i>loonygames</i></b></font></a></td>
    <td height="20" width="65%"> 
      <div align="right"><font face="Arial, Helvetica, sans-serif" color="#FFFFFF">  </font></div>
    </td>
  </tr>
</table>
<p><i><font face="Arial, Helvetica, sans-serif" size="-2">Credits: Illustration 
  &copy; 2000 Costas (<a href="http://www.freespeech.org/darkpathimages/dpathmain.htm">Darkpath 
  Images</a>) and Andy, This article is &copy; 2000 Jake Simpson. All other content 
  is &copy; 2000 loonyboi productions. Unauthorized reproduction is prohibited. 
  So don't do it, or we'll give you really, really, bad lag.</font></i></p>
 <map name="logoa">
  <area shape="rect" coords="52,47,112,59" href="http://www.bluesnews.com">
  <area shape="rect" coords="3,3,179,46" href="../../../index.html">
</map>
</body>
</html>
