Project #4 readme Group members: 1. NAME: SHAWN LIWEI LUO 2. NAME: SUNG-HOON KIM 3. NAME: HAOYU ZHOU What's our game? Our game is a combination of a maze-solving game and an FPS game. The player's goal is to walk from the start of the maze to the exit, within a time limit. Inside the maze there are monsters and obstacles, and the player has to dodge the monsters or kill them with his weapon in order to move on. Its contents are heavily influenced by Counter-Strike and StarCraft series. REQUIRED FRAMEWORK: 1. 3D object Maze walls, monsters, snowman, guns and so on are 3D objects. 2. 3D camera We use a quaternion FPS camera for the player to navigate within the game. The player can move and look in different directions just like in any other FPS game. 3. Interactivity The player's movement can be controlled by using the keyboard and the mouse, and aim / shoot a monster in the scene using the mouse buttons. 4. Lighting and shading We have one opengl light(uses the default Gauroud shading) for non-Cg items, and 4 Cg lights(uses Phong shading with Blinn-Phong lighting) for items that are rendered with Cg. Two out of the four lights that uses Cg are spotlights. 5. Picking We have implemented the following features using picking. The player can right click on a monster to see its health point value. Also the player can also right click on the ghost snowman floating in the sky to check the current game information, such as the number of monsters left, etc. 6. Texturing: We have added textures to the maze walls, floors and the Skybox(with changing textures to simulate a space ad. effect. The maze walls and floors are textured within Cg to work with Phong shading so that they look a lot more realistic. 7. On-screen control panel We have added player HP, crosshair, ammo indicators, fps display, a timer, and also texts to indicate when the player loses or wins the game in our HUD. 8. Game play The player has to overcome monsters and solve the simple maze within the time limit to win the game. The player can press enter key to restart the game in case of defeat. FEATURE OPTIONS: We have done five extra features as we have three group members. 1. Advanced rendering effects Bill boarding on the ghost snowman, and spot light effects. We originally planned to add shadow mapping to our game, but after spending a huge amount of time researching for it, we did not manage to implement it due to difficulties in actual implementation plus the significant amount of wasted time due to poor documentations of Cg. 2. Particle System We have used point sprites to implement particle systems to simulate sparks and laser beams. 3. Collision detection Collision detection has been applied to appropriately handle player-wall, player-item, player-monster and bullet collisions. 4. Animation We have added patrol and death animations to the monsters. 5. Shader Cg is used to implement Phong shading with Blinn-Phong lighting, texturing and handle all light effects in our game to make the scenes look much more realistic. EXTRA FEATURES: We have added sound to guns, laser beams and other things to enhance the gameplay experience. How did we implement these? The maze is constructed using 'Wall' objects which are highly object-oriented to facilitate collision detection as well as texture mapping. To construct a Wall object, 6 parameters (the wall position(x,y,z) and the size of the wall(x,y,x)) must be specified. Then, once the wall is constructed, we can simply call 'draw' method to draw the walls. The SOIL library is used for the texture mapping. The library enables loading image files. Then we can apply the loaded pictures as wall textures by invoking “initTexture” method of the Wall data structure. The environment around maze is implemented using 4 large galaxy textured cubes. The GLM library is used for loading the third-party 3D models (obj file) into the project. After loading the model, we can use the OpenGL‟s transformation functions to place them in the desired positions as well as animating them simply by changing global variables. The rifle is drawn in the viewing coordinate so that it moves along with the camera as the player moves around the maze. Lastly, FTGL library was used to load external fonts for fancier looking HUD. Billboarding: Resetting the rotational part of the modelview matrix to identity. Cg: Vertex transformations in the vertex program, and lighting calculations in the fragment program. Particles: Point sprites with different accelerations, position, life spans size attenuations and colors. Camera: Quaternion for rotations to avoid suffering from Gimbal Lock. How to play the game? Control your movement with w (forward), s (backward), a (left), d (right), space (jump), camera orientation with mouse movement, shooting with left mouse button, check monster's hp and current game hints(snowman in the air) with right mouse button. There are indicators in the HUD for the player's hp, ammo, and the amount of time left. There are also different items in the game that the player can pick up to for example gain some hp. Good luck and have fun! References and external libraries: SOIL library: http://www.lonesock.net/soil.html GLM library: http://devernay.free.fr/hacks/glm/ FTGL library: http://homepages.paradise.net.nz/henryj/code/#FTGL GLEE library: http://elf-stone.com/glee.php SDL Mixer: http://www.libsdl.org/projects/SDL_mixer/ GameDev : http://www.gamedev.net/ DevMaster : http://www.devmaster.net/ Cg Tutorial: http://http.developer.nvidia.com/CgTutorial/cg_tutorial_frontmatter.html Lighthouse 3d: http://www.lighthouse3d.com/opengl/ Also, the gameplay is heavily influenced by Counter-Strike, and a lot of models, sounds, and images are from StarCraft series. Known Issues: 1. Sound does not immediately play when the program is told to do so. So there can be slight delays between when you left-click and when the gun sound actually plays. Pre-loading the sound files into the memory doesn't make any difference. This could be a problem with the SDL mixer library. 2. It is possible for the player to slip through walls while forced to move along the tangent of a wall by collision detection. But this is a trade-off between allowing movement along the tangent and not allowing. 3. It could be hard to get hit by monsters and lasers since they are considered 'points' in collision detection.