CS 638 Stage 0.5: Getting started with Target Arena

The next step in your progress with LithTech is to build, run, and play Target Arena. This is to make sure your Visual Studio settings are correct. It will also serve to familiarize you with the base game code before you have to implement anything yourself.

Target Arena is a basic first-person shooter (FPS) where you run around and shoot rockets at targets while a timer counts down. If you hit a target, you get a bonus in the form of points and extra time. When time runs out, your final score is displayed. Click here for some notes on its operation.

For this stage, you will need to make sure that your Visual Studio settings are set up correctly. The main thing to check is that the include and library directory paths are set up in Tools -> Options -> Directories as in Stage 0.0.


To better understand the way Target Arena works, you will need to read the following sections of the Programming Guide:

It is a good idea to just skim these sections the first time through. Then, after you've looked through the Target Arena source code, read the sections again to clarify particular issues. You can also search the LithTech API Reference for details on particular classes and functions. If something does not make sense, e-mail a question to the class mailing list.

The rest of this page descibes the steps necessary to get up and running with the game.


I. Get Target Arena 

   Copy the following file to your desktop (or some other directory in your account):

   p:\course\cs638-schenney\public\TargetArena.zip

   Next, double-click on the zip file to open it in WinZip (or whichever archive manager you have set up as default). Once it opens, click on the Extract button and choose a destination directory. The source files and other resources will now be decompressed in that directory.


II. Build Target Arena
 

   Navigate to the TargetArena folder that was created automatically in Step I. There you should find a workspace file called TargetArena.dsw. Double-click on this file to open the Target Arena workspace. Now, click on Build -> Batch Build. Make sure that all four boxes are checked (Debug and Release builds for both cshell and sshell ) and click Rebuild All. Watch the output window to make sure that the projects build without errors. If there is a problem, make sure that you have correctly set up the directory paths in Tools -> Options -> Directories as explained in Stage 0.0.


III. Play Target Arena

   In the TargetArena\bin directory are four files. The autoexec.cfg file specifies a few console variables that are to be loaded on start up (e.g., to set the screen resolution). More importantly, this file defines all of the controls that the game will use, as described in the Programming Guide.

   The two other important files are RunDebug.bat and RunRelease.bat. These files will copy the latest debug or release build to the rez directory and execute the game. You will notice that this serves the same function as the parameters you set up in Stage 0.0 within Visual Studio. Using these batch files allows you to choose which build you wish to run without having to copy files manually.

   Once you have built the game, you can double-click on either of the two batch files to run the game. An overview of the controls is linked above.


IV. Study Target Arena

   Once you have played the game, you should spend a good amount of time examining the source code. There are certain files in particular that you should examine at this point. These are the files that you will most likely be modifying for subsequent projects, and have therefore been heavily commented. Here are the files you should focus on in the cshell project:

   CGameClnt.cpp
   rocket.cpp
   target.cpp
   ui.cpp
   ltclientshell.cpp
   camera.cpp
   playerclnt.cpp
   commandids.h

   Here are the files to focus on in the sshell project:

   CFighter.cpp
   CGameSrvr.cpp
   CRocket.cpp
   CTarget.cpp
   ltservershell.cpp
   playersrvr.cpp

   In many of these files, you will see comment blocks similar to this one:

   ///***////////////////////////////...
   // This function does <stuff>

   These indicate areas of the source you should pay particular attention to when studying the code. They usually illustrate some important aspect of the engine or contain important game code specific to Target Arena. Look up things you are unsure about in the Programming Guide and the LithTech API Reference, and send an e-mail to the mailing list if you have questions about anything.