README FOR PANZERJÄGER First Person, 3D Tank shooter game ============================================ Yan Liu Wei Koh Kun Bian ============================================ Hardware Requirements: - 566Mhz or better CPU, preferably Pentium III or AMD Athlon - Nvidia TNT2 or better 3D video graphics accelerator - 128MB of RAM - 180MB of Hard drive space Software Requirements: - Microsoft Windows 95/98/2000 with OpenGL and DirectX 7.0 support - GLUT ver 3.7 (DLL included with the game) Demo platform: - Intel Celeron II at 566Mhz - 384 MB of RAM - Nvidia GeForce2 GTS with 64MB of RAM - Windows 98 Second Edition - OpenGL 1.1 - DirectX 7.0 For Stereoscopic Display: - StereoGraphics EPC2 Sync Doubler/IR Transmitter - StereoGraphics CrystalEyes 3 Liquid Crystal Shutter Eyewear - 21" Monitor running at 1024x768 at 120 Hz (set video card to 60 Hz). Other supported resolution/refresh rates: - 1024x960 at 60 Hz - 1024x768 at 60 Hz - 800x600 at 60 Hz INSTALLATION/BUILD INSTRUCTIONS: =================================================== PANZERJÄGER utilizes five background music files and a variety of sound and and texture files, which total over 170MB in size. You can also omit the music files and the total size is just over 3MB. Both of them should be available from the game home page. This is a compressed ZIP archive that you must uncompress. Copy the glut32.dll file to the C:\Windows\System directory on Windows 9x, or C:\Windows\System32 directory on Windows 2000. If you downloaded the music files seperately, then place the music directory under the "data" directory. Finally, find the file named panzer.exe and launch it. The game was developed with Microsoft Visual Studio 6.0. The project and the workspace file is included with the source code. Find and open the file named panzer.dsw with Visual Studio 6.0. Then launch the "Build->Build" menu item, or press F7. It requires the following set of extra libraries: Graphics libraries: glu32.lib glut32.lib opengl32.lib glaux.lib DirectSound libraries: dsound.lib dxguid.lib PLAYING THE GAME =================================================== Your mission is to take out a group of missile-launching enemy tanks while navigating around in a maze. Fortunately, you have a missile launcher of your own strapped on your shoulder and can take a fair amount of damage (100 health units) before dying. To win, you must take out all the enemy tanks in 4 different levels. Each level takes place in a larger maze than the previous level with more enemies lurking around you. To aid you in your mission, there are an assortment of powerups located at random positions around the maze. To pick them up simply walk over them. These powerups include: - First aid kits for healing your wounds (some kits are more effective than others, the size of the kit denote their relative effectiveness) - Extra supplies of missiles (you can carry a maximum of 20) - Land mines. Mines may be laid by you or by the enemy. They activate two seconds after they are dropped (when they change from having a yellow orb to having a red orb; land mines not picked up have a blue colored orb) Mines laid by you do not hurt you, and mines laid by the enemy do not hurt the enemies. However, they look the same so be careful! Also, armed land mines are always detonated by explosions in the immediate area! You may carry a maximum of five land mines. - A periscope for getting a bird's eye view of the area around you without the enemy detecting you. You can only carry (and need) one periscope. - A radar unit for detecting enemies and powerups around you, combines with the electronic map. You can only carry (and need) one - An electronic map showing the layout of the maze, combines with the radar unit. You can only carry (and need) one - Dynamite for blowing out sections of walls (keep a safe distance after lighting it). You can carry a maximum of five dynamites - A jetpack for flying around in the maze (watch your fuel level). You can carry a maximum of one. However, when the fuel is depleted the current jetpack you are carrying are abandoned so you may pick up another one. Player Controls: Level transitions: Mouse leftclick, - During intro sequence or level/death transition, go space bar, exit the sequence or go to the next level or life or enter Navigation/Aiming/Firing: Mouse up & down - look/aim your weapon down and up (switchable) Mouse left & right - turn left and right Mouse left Click - fire missile Mouse right Click - jump Up & Down Arrows - move forward & backwards Left & Right Arrow - strafe to the left and right Using your Powerups: p - toggle periscope mode d - place dynamite and light fuse m - lay a land mine z/Z - zoom in/zoom out of the level map Page Up & Page Down - Thrust up or down using your jetpack Game Options: y - invert the mouse Y-axis movement for aiming S - toggle between stereoscopic/monoscopic mode (stereoscopic mode requires proper equipment) b - toggle bump mapping on/off q - quit the game 0 - CHEAT: Gives you all the powerups in the level that you can pick up 9 - Toggle music 8 - Toggle sound effects > - Raise music volume < - lower music volume TECHNICAL FEATURES =================================================== Graphical/Visual: - Texture mapping - Textured sky, moving texture - Textured walls and ground (also see bump-mapping below) - Fixed and moving lights - player has a spot-head light - each projectile/explosion has its own light source - Bump-mapped walls and ground - Implemented by embossing, painting the geometry in three passes with three different textures (regular texture, bumpmap texture, and inverted bumpmap texture) - the bumpmap texture is a grayscale texture that specifies the relative "height" of each texel. - First pass paint the regular bumpmap texture, no blending, no lighting, with GL_REPLACE - Second pass perturb the (S,T) coordinate toward the light by the projection of the light vector to the current vertex to the surface. Paint the inverted bumpmap texture, still no lighting, blend GL_ONE to GL_ONE - Last pass paint the regular texture, this time with GL_MODULATE, lit, and blend GL_DST_COLOR to GL_SRC_COLOR - This feature can be turned on or off since it affects frame rate - Particle systems, used to blow up the model of the wall and the enemy tank, regular explosions, rocket exaust, and the burning dynamite fuse - Each particle has a position, velocity, life, color, orientation, and rotation angle, all relative to the "center" of the particle system (which might be the center of the explosion, or the end of the dynamite fuse) - for normal explosions, each particle is a billboarded texture - When "blowing up" walls and enemy tanks, each particle is a piece of the wall or the model of the tank itself - All particles are affected by gravity, wall/tank particles are also affected by the ground, which when hit cause them to bounce a little bit - Billboarding, used to implement the particles and the smoke trail - Animated Introduction sequence - Stereoscopic mode - With the appropriate hardware (see equipment list above), the game can be played in stereoscopic mode - Separate perspective-view frustums and separate viewpoints are defined for each eye and are optimized for a viewer sitting 24" in front of a 21" monitor. - These 2 images are then displayed in the above-and-below format where the image for the left eye is vertically compressed into the upper half of the display and the image for the right eye is similarly compressed into the lower half of the display. The stereo hardware intercepts the signal, expands each half to a full frame, and alternates between the images at double the video card refresh rate. The shutter glasses synchronize with the IR transmitter to block out alternating images such that each eye will only see the image intended for itself, refreshed at the half of the display rate, or equal to the video card refresh rate setting. - The game utilizes a good combination of negative and positive parallax, such that objects will appear to be located in front of as well as behind the surface of the screen, minimizing eye strain/discomfort. - Dynamically generated models, for the broken wall - When the maze for the current level is initialized, ten models for the broken walls are generated. It treats the cross section of the broken wall as a one-dimensional terrain, and uses the mid-point displacement terrain generation algorithm to generate a height field. The height field is then used to create the model which essentially ex-trudes the height field into a solid object. - 2D control panel Speed up techniques: - View frustum/portal culling engine - When the player is on the ground, the portal culling is enabled. The boundaries of the viewing frustum is intersected with the four walls or "portals" in each room of the maze. If no intersection occur then that wall or portal is ignored. If here is an intersection and it is a wall, then the wall is drawn. If it is a portal, then the viewing frustum is shrunk by how much it overlaps with the angle of the viewing position with the portal and recurse into the next room over, until no more portals are being intersected. - Level of detail - All objects that are drawn with opengl or glut primitives have level of detail, which modifies how many triangles is used to represent the object, depending on how far the object is from the view point. - Each object also has a minimum and a maximum level of detail which are different. For example, mines and dynamites both have cylinders in them, however since the dynamite are seven long and narrow cylinders, while the base of the mine is a short but wide cylinder. In the first case, the dynamite can be allowed to be drawn with only four sides to each cylinder which is not noticeable when viewed from far away. However, the mine-base has a minimum of eight sides. Gameplay/AI: - Mouse control of user face-direction and pitch angle, with invertible Y-axis - use multiple keys at the same time - Enemy tank AI, with multiple modes of action - Enemies does not know the maze at the start of the game. They build a "path table" that contains where they've been and how to get back to there. - Enemies start out in patrol mode, which is designed to get them to explore and build the "path table." They are also initialized with five mines. - If they "see" the player, which means there is a direct line of sight between them and the player, they will go into chase mode - In chase mode, the enemy tank will come at the player based on information stored in the path table, and fire rockets at the player. However, if its gets too hurt, the enemy tank will go to evade mode - In evade mode, the enemy tank will run away from the player and lay mines on the ground; if it ever gets cornered it will go into the final suicide chase mode - In the suicide chase mode, the enemy tank will chase after the player, shooting and start laying all the mines it has - Simulated physical forces from explosions and the jetpack powerup - At the initialization stage of each explosion, it checks surrounding enemy tank, player, or land mines that might be affected by it. Affected player and enemy have an external force applied to them which may send them flying thru the air or knock them back, left or right. The exact force and direction is determined by their relative positions with the explosion. (This means that explosions caused by a rocket hitting the wall can hurt the enemies and the player, for example). Land mines gets blown up - The jetpack powerup allows the player to fly. However, firing the thrusters on the jetpack will accerlerate the player in that direction, and this acceleration changes the direction and speed that the user is currently traveling. - Simulated gravity, air resistance, and ground resistance - Particles, player, and enemy are affected by gravity. Player and enemy are affected by air and ground resistances so the external force by the explosion does not send them flying forever. - In the jetpack mode, a clamping value is also used for the player's speed so the player does not go flying across the level at speeds too fast to be playable. Sound: - 16 channels of music and sound with directsound. The basic interface to direct sound was obtained from the course directory (sound_winface.h and sound_winface.cpp) However much code is added to support background music and advanced stereo sound effects - positional/vectored sound sources, stereo sound effect, doppler effect - sound sources may have positon and velocity - the position vector is used to find the distance of the sound source from the player, with modifiable max and minimum distances The sound is then attenuated according to the attenuation factors, which just like openGL lights, have constant, linear, and quadratic attenuations that may also be set differently for each sound source - the position vector plus the player position and the angle at which the player is currently facing are used to find the relative angle of the sound to the player, and in turn sets the "pan" of the sound buffer - The velocity vector, combined with the velocity vector of the player, is used to calculate the relative speed of the sound source and the player as well as whether the sound is getting closer or farther away from the player. The frequency of the sound buffer is adjusted accordingly to create a doppler shift effect. External Sources of Models/Textures/Sounds/Inspiration: - The models for the enemy tanks, scud missiles, level map powerup, as well as the wall and ground textures and some of the sound effects were obtained from www.3dcafe.com - Background Music for the intro and in game - The intro theme is taken from the soundtrack to "The Hunt for the Red October" - The four background music pieces: - a techno remix of the theme of "Terminator 2" done by unknown artist - "Armageddon" by Kryptonic http://artists.mp3s.com/artists/7/planet_krypton.html - "March of Diablo" by Mel David http://artists.mp3s.com/artists/8/mel_david.html - "Aliens" by Ville Laaksonen http://artists.mp3s.com/artists/138/ville_laaksonen.html - The bitmap and outline font package is borrowed from Jeff Molofee's OpenGL Windows Tutorials. His tutorials on particle systems, billboarding, and bump-mapping were extremely helpful: http://nehe.gamedev.net/opengl.asp - Information for implementing the stereoscopic mode came from the StereoGraphics Developer's Handbook by Lenny Lipton, available for download at: http://www.stereographics.com/support/developers/handbook.pdf - OpenGL Programming Guide, Third Edition - and, of course, Quake III