<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>, 
        6, <a href="index7.php"><font color="#7C420E">7</font></a>, <a href="index8.php"><font color="#7C420E">8</font></a></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/freak_thumb.jpg" width="102" height="120" align="MIDDLE"></p><p><font face="Arial, Helvetica, sans-serif" size="-1"><a href="../../1.7/feat">The Community Summit</a>: Our exclusive chat with the folks who run your favorite gaming pages (from our seventh issue).</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"> 
            <div align="center"> 
              <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">So ok, 
                we&#146;ve seen the mess that is the Internet, and all the pitfalls, 
                what can we do about them as game developers? </font></p>
              <p align="left"></p>
              <p align="left"><font face="Arial, Helvetica, sans-serif">Rats, 
                I knew someone was going to ask that. I thought I was done, Check 
                please. But noooo, more stuff to have to type up. Oh well.</font></p>
              <p align="left"></p>
              <p align="left"><font face="Arial, Helvetica, sans-serif">The first 
                thing we should do is define the difference between client/server 
                type games and peer to peer games.</font></p>
              <p align="left"></p>
              <p align="left"><font face="Arial, Helvetica, sans-serif">Peer to 
                peer involves two or more games talking to each other, each running 
                the game itself and only exchanging input data. This reduces network 
                traffic to a minimum, but brings several other problems to the 
                table, like coping with lost traffic. This is far more important 
                when more than one game is running, since contention occurs over 
                who is correct and who is not. Variance in game play can get very 
                sticky in these situations, as each game must stay synchronized 
                with the others. Additionally, each game must wait for the input 
                from the others before it can simulate the next frame &#150; remember 
                playing <b>DOOM</b> and it would lock up momentarily?</font></p>
              <p align="left"></p>
              <p align="left"><font face="Arial, Helvetica, sans-serif">Client/Server 
                involves one machine running the game and dictating to all the 
                clients what the state of play is and what they should be displaying. 
                Effectively the clients become pretty much dumb terminals transmitting 
                the user input to the server, and letting it handle almost everything. 
                They draw the scene the server tells them to display, and play 
                the sounds the server tells them to play. Actually, it's not quite 
                as bad as this, as the server does on occasion tend to offload 
                functionality onto the client, but that's the basic idea.</font></p>
              <p align="left"><font face="Arial, Helvetica, sans-serif">What I'm 
                going to discuss has more to do with Client/Server type setups 
                than peer to peer since almost all online type games have some 
                degree of Client/Server architecture to them - every game has 
                to have one client that 'hosts' the game and is considered 'correct' 
                in the case of world event contention between peers. (Unless they 
                don&#146;t, in which case, you&#146;d just get an &#147;out of 
                synch&#148; error and quit.)</font></p>
              <p align="left"></p>
              <p align="left"><font face="Arial, Helvetica, sans-serif">Ok, now 
                on to our problem list - The TCP/IP selection is a no brainer 
                - we don't have to discuss that anymore. </font></p>
              <p align="left"></p>
              <p align="left"><font face="Arial, Helvetica, sans-serif">One down.</font></p>
              <p align="left"></p>
              <p align="left"><font face="Arial, Helvetica, sans-serif">Packet 
                bloating. This one can be tricky. Obviously a max packet size 
                in the code is in order here to stop modem buffer overloading. 
                We here at Raven are actually implementing a floating max packet 
                size, for those people who are running over a local network, or 
                that have large bandwidth available to them. When you hit a packet 
                that breaks your buffer size, the secret is to split the data 
                into two smaller chunks - only send in the first packet what is 
                really necessary to be there that instant. Data like entity movements 
                and so on. Stuff like chat messages can wait till the next packet, 
                since no one is going to miss that being one packet late. Still, 
                tough decisions need to be made as to what's important and what 
                isn't, and sometimes this can make the game feel a little sluggish 
                and unresponsive. This is where the floating packet size can be 
                helpful, since it should remove that feeling from those with large 
                bandwidth or running local games. Not the best solution, but one 
                that's worth a try.</font></p>
              <p align="left"></p>
              <p align="left"><font face="Arial, Helvetica, sans-serif">Other 
                stuff that's worth thinking about includes tokenizing text messages. 
                If your server is sending a lot of preset text messages, it makes 
                more sense to have these pre-loaded on the client, and just send 
                them a text string reference number rather than the whole string. 
                This reduces out message traffic considerably. The same trick 
                can be played with sending down filenames when the server asks 
                the client to load something. For instance you can break down 
                the file into path names, and then filenames. If you are asking 
                for a bunch of sound files to be loaded, then only send the path 
                once, and from then on, refer to the path as a token in the string. 
                For instance we'll ask the client to load</font></p>
              <p align="left"><font face="Arial, Helvetica, sans-serif">&quot;sound/weapons/death.wav&quot;. 
                Once the client receives this string, it will store away the path 
                as a token, and the next time we want a sound, we send &quot;%1pain.wav&quot; 
                and the client knows by the %1 to go away and use that path it 
                got first time to load this sound. Little things, but they all 
                help.</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"><font face="Arial, Helvetica, sans-serif"><br></loonystart> 
                </font> </p>
            </DIV>
            <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="index5.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"><font face="Arial, Helvetica, sans-serif"><a href="index7.php"><font color="#7C420E"><b><font size="+1">Next 
                    &gt;&gt;</font></b></font> </a></font> 
                </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>
