<html>

<head>
<title>loonygames presents: Anatomy of a Video Game</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.8</font></a>://<a href="index.html"><font color="#7C420E">Anatomy of a 
        Video Game</font></a>://<a href="index.php"><font color="#7C420E">1</font></a>, 
        2, <a href="index3.php"><font color="#7C420E">3</font></a><a href="index2.php"><font color="#7C420E"></font></a>, 
        <a href="index4.php"><font color="#7C420E">4</font></a><a href="index4.php"><font color="#7C420E"></font></a>, 
        <a href="index5.php"><font color="#7C420E">5</font></a>, <a href="index6.php"><font color="#7C420E">6</font></a><a href="index6.php"><font color="#7C420E"></font></a>, 
        <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="http://www.loonygames.com/includes/printme.pl?url=/2.8/feat/&amp;withimages=yes"><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"> 
            <!--#exec
cgi="/includes/rand_quot.cgi"--> </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>
            <!--#include virtual="/includes/includes/commerce_ssi.htm" --> 
            <!--#include virtual="/includes/includes/art_ssi.htm" --></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><!--#exec
cgi="/includes/rand_thumb.cgi"--><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">Anatomy 
                        of a Video Game</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 8 <br>
                      January 10, 2000&nbsp; </font></b></h5>
                  </td>
                </tr>
              </table>
              <loonystart> 
              <h5 align="right">&nbsp;</h5>
              <p align="left"> <font size="+1"><b><font face="Arial, Helvetica, sans-serif">Renderer</font></b></font></p>
              <p align="left"><font face="Arial, Helvetica, sans-serif">One of 
                the most crucial parts of most games is the part that actually 
                does the hard work of drawing what you want to see. In this module 
                goes some of the most time critical code - the 3D matrix math. 
                All of today&#146;s 3D games, we have lots of 3Dgeometry going 
                on. In lots of ways, this particular module will set the frame 
                rate of your game, since both the quality of the code, and the 
                amount of triangles you try and pass through it will affect the 
                amount of time you spend in this part of your code. Optimization 
                usually starts in this module, and ends in this module too, since 
                changes here can make the most difference. When it comes to actually 
                drawing data on the screen, almost no one actually uses software 
                to render anymore (ie programming the CPU to draw individual pixels). 
                When you consider the resolutions that most of today&#146;s games 
                run at, and the amount of overdraw that goes on, its just not 
                feasible to expect the CPU to be able to do it fast enough. And 
                when you start adding semi transparency for individual pixels 
                into the mix, it gets very slow very fast. Most PC games today 
                are using 3d accelerator cards to do the rendering for us. We 
                hand it the triangles we want to render, hand it the textures 
                we want to use, turn on the features we want, like fogging, or 
                tri-linear interpolation, and it handles the actual drawing for 
                us. Now I'm going to get a little technical here for a second, 
                if you&#146;re not a techy, just tune out for a second J. Since 
                there are multitudes of different video cards out there, with 
                all different abilities, a universal method of drawing to them 
                is required. Now, we, as game developers, don&#146;t want to spend 
                the time writing drivers for each and every card, so we use an 
                off the shelf API (API stands for Application Programmer Interface). 
                This is just a standardized way we can &#145;talk&#146; to the 
                graphics cards. Almost all card manufacturers supply one of two 
                graphic API drivers. Direct3D, developed by Microsoft - which 
                is very complete, but incredibly hard to use, or OpenGL, developed 
                20 years ago and now maintained by Silicon Graphics. We use the 
                OpenGL standard, simply because that&#146;s what id uses, and 
                since we use their engines, well... </font></p>
              <p align="left"> </p>
              <p align="left"></p>
              <p align="center"><img src="images/pp.gif" width="455" height="374"></p>
              <p align="left"><font face="Arial, Helvetica, sans-serif">Here you 
                can see the relationship from the top-level code right down to 
                the pixel pipeline on the graphics card itself.</font></p>
              <p align="left"><font face="Arial, Helvetica, sans-serif">For consoles 
                and Arcade machines, the rendering technology is somewhat different. 
                Firstly, you always know what kind of display systems you have 
                at your disposal; they don&#146;t change from machine to machine. 
                This means that once you&#146;ve written a renderer, you don&#146;t 
                need to change it from game to game. Plus, you almost always get 
                much closer to the metal. For instance, in all the Mortal Kombat 
                games, the programmers talk to the graphics chip directly; setting 
                registers and so on without any kind of API layer. It&#146;s harder 
                to keep track of what&#146;s going on, but it does generally result 
                in a faster graphics pipeline, plus a much greater understanding 
                of exactly what the hardware is doing.</font></p>
              <p align="left"> </p>
              <p align="left"><font size="+1"><b><font face="Arial, Helvetica, sans-serif">AI</font></b></font></p>
              <p align="left"><font face="Arial, Helvetica, sans-serif">Unless 
                you are doing a purely one on one game - i.e. one person against 
                another, you are going to need some form of Artificial Intelligence 
                code in the game, in order for the player to have something to 
                play against. In Tetris, this would take the form of deciding 
                which block to send down next, something relatively easy with 
                a decent random number generator. In Solider of Fortune for instance, 
                this expands a little into pathway tracking, enemy tracking, decision 
                making, (deciding whether to run away, shoot at the player, follow 
                someone, or whatever). The system has to take into account the 
                local environment, so the bad guy doesn&#146;t fall down a hole, 
                or try and run through a wall. Convincing AI can make a huge difference 
                to a good game playing experience. One of the biggest problems 
                is making the AI not too smart. Since the world you are playing 
                in is generated within the game, it means that the bad guy AI 
                has access to all information regarding this world, and your actions 
                in it. This can mean that the bad guy is aware of everything, 
                and when he shoots at you, he will never miss. Bit of a boring 
                game that. So we have to tone it down a bit to make it more fun. 
                Another thing we have to do is include lots of different animations 
                for the bad guys, since he more they are visually capable of doing, 
                the less predictable they are. If all the guy can do is run, shoot 
                and die, then he&#146;s only got that range of operations. However, 
                if he can walk, crawl, duck, roll, and jump, then he has a far 
                greater range, and is less predictable. Another thing to take 
                into account is the visual and aural acuity of the bad guy. Let 
                me explain that with graphics.</font></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"></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="index.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="index3.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"><!--#exec
cgi="/includes/rand_bot.cgi"--></font></div>
    </td>
  </tr>
</table>
<p><i><font face="Arial, Helvetica, sans-serif" size="-2">Credits: Illustration 
  &copy; 2000 <a href="http://www.3dpalette.com/dimension">Durrenberger David 
  (dines)</a>. 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 dissect you.</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>
