First Person Shooter: The Ring

Brian Levonius, BrianPL@hotmail.com

CSC 471 Final Project

Spring 2005, Dr Wood

Cal Poly, San Luis Obispo, CA

Table of Contents

Introduction

I grew up playing first person shooter games like Doom and Quake. I still play them actually... I have Doom 3 for the XBOX. So, for my final project I wanted to make a dark 3D first person shooter. I decided to use a theme from the movie "The Ring" because its one of the scariest movies I have ever seen. My goal for the game was to include as many cool features as I had time for in two weeks.

Building and Running

The source code includes VS.NET project and solution files. The only non-standard library you will need is Glut 3.7.

The program requires one command-line argument- the world text file. Use the supplied "MyWorld.txt" file like this: "final.exe myworld.txt"

Notes about source code:

Player Controls (how to play)

Left, Right, Up, Down Arrow keys: player movement in the world

'G' key: Toggle on/off gun

'B' key: Fire the gun

'S' key: toggle on/off Samara

Player Movement and the World

I got the basics for moving around in a 3D world from NeHe's tutorial #10. Virtual camera rotations and translations are made based on user keyboard input. I call them "virtual" because they aren't actually used to move the camera: the world gets transformed instead to simulate camera/player transformations. It loads the world by reading triangle coordinates from a text file. It also textures the walls with traditional FPS textures (and one wall with pictures from The Ring).

Flashlight

I really wanted to get a good flashlight effect like in Doom 3. I use an OpenGL spotlight with attenuation both radially outward and forward. Since the camera never moves neither does the flashlight. It looks "ok" (see above pic). There just isn't enough polygons in the world to really make it work like it should.

Collision Detection

You can't walk through walls. I detect collisions with the sphere-plane test.

Gun and Sound

The gun recoils when you shoot it and it makes a sound. I made the gun with OpenGL quadrics (see pic above). With time constraints, I had to make the sound code platform dependent (windows). When it was playing the gun sound it was causing the game to pause, so I put that in a separate thread. The sound is a little late for the first shot only, then it synchronizes correctly with the graphics.

Samara

Yes, evil Samara is in the game. Be careful! I made her by texture mapping a picture onto a square. Then I got transparency using bitmap blending. See NeHe's tutorial #20 for more info on how to do this. I made her flicker by not drawing her 10% of the time. She will always face the player.

Conclusion and Future Work

I'm happy with it and I look forward to showing it to family and friends. I wish I had had more time to be able to shoot Samara and have her move around and try to "get you". I am *really* looking forward to CSC 476 so I can learn how to do 3D games.

References

Nehe Productions, http://nehe.gamedev.net/

"The Ring"- http://www.ring-themovie.com/

Special Thanks

Dr ZoŽ Wood- for teaching us Graphics!

Filip Iliescu- for Photoshop work on Samara