Results 1 to 25 of 25

Thread: Western Game 1.0 [C++ & OpenGL & Glut & Aux]

Threaded View

  1. #1

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Western Game 1.0 [C++ & OpenGL & Glut & Aux]

    Disclaimer:

    I am "proud" to represent my first OpenGL application. When I say proud I must admitt that I have never finished anything that big in this little time, so there is no optimisation, and there is a whole lot of sloppy code inside. There is a lot I would have changed if I had the time, and effort. But since it is a school project, and it should have been finished 2 days ago then I have to end it here, even if I havn't used more then 12 days to learn OpenGL and do this project.

    I have had one buddy on my team. He havn't written much, but what he has written is messier then my code, it also gave me a hard time implement it with my code, and his code has some Norwegian variable names, and comments and so on. Sorry for that.

    And I am also sorry for the game play. I threw that in the last minute. It wasn't a part of the assignment.





    How to use it:
    • Mouse: Move your mouse to move the camera (FPS camera).
    • Left click: To shoot.
    • Right click: Reload.
    • Arrow keys: Move the camera back and forth, and strafe.
    • S: Turn the skybox on and off.
    • T: Turn the terrain on and off.
    • D: Turn detailed terrain on and off.
    • R: Turn rooky mode on and off (turn the time off).
    • F: Turn fantasy mode on and off (turn the cowboys into blue smilies.
    • G: Make the gamera fly or follow the ground.
    • H: Turn on and off the hud.
    • P: Pause the app.
    • Esc: Quit the app.



    How to play:

    You are the good guy. Shoot the slim cowboys that appears around the terrain. When a new guy appears you have 10sec to shoot him. Time starts when he appears, so if one appears after 3 seconds you have 10 seconds from that time to shoot him. If an other guy apperas after 5 seconds, and you havn't shot the first guy yet, then it will be the time for the first guy you will see up in the left corner, and when you have shot the first guy, it is the time for the second guy you will see up in the left corner.

    Up in the right corner, you can see how many bad guys how are left.

    In the lower left corner you can see how many bullets are left in your magazine, and in down in the right corner you can see how many bullets you have left to put in the magazine.

    You have to press quit when it says game over, or you have managed to shoot them all, and then restart the app to start again (sorry for that).





    What is done:
    • Loading BMP.
    • Loading TGA with alpha values.
    • Rendering skybox.
    • Reading height map from a BMP file.
    • Rendering a terrain.
    • Blending details into the terrain.
    • Using masking.
    • Using alphablending.
    • Rendering in both projection mode (3D), and ortho mode (2D).
    • Camera class.
    • Vector class.
    • Math class (for the shooting and the camera).
    • Mip maps.
    • Simple Target class.



    What I would have changed/added if I had better time:
    • Cleaned up the code and changed all the Norwegian to English.
    • Made you fall from big heights, so you wouldn't follow the ground that fast. Right now it looks like shaking if you run fast.
    • Extended the game play.
    • Used Alpha blending all the way in stead of masking as I did on most of the HUD.
    • Made a larger terrain.
    • Used space partitioning.
    • Added fog.
    • Made better graphics.
    • Added 3D models to shoot, and not just simple Alpha blended quads.
    • Made some AI.
    • Moving clouds.
    • More levels.
    • Diffrent weapons.
    • Made Alt + Tab possible.
    • Get rid of the horrible glut stuff.
    • Made it possible to run in fullscreen, and other screen resolutions.
    • And optimised the whole thing, like the render states (they are messy), using a vertex array with indexes.
    • And a bunch of other stuff.




    The game

    The game can be downloaded from my site, I appologize for the big file (7.31Mb), but it is a lot of BMP and some Wave files there, and they have to be there to pull this off. Enjoy the game


    Tested on:
    • dsheller: Athlon 2400 XP, ti4200 (64MB), 768MB, Win2K = 61FPS [OK]
    • Electroman: P4 3GHz, FX5900 (128MB), 1Gb DDR, WinXP = 61FPS [Failed: While shooting]
    • NoteMe: AMD 1900+ MP, 9800PRO (128Mb), 1,25Gb DDR, Win2K = 61FPS [OK]
    • Acidic: Athlon 2000, TNT2 (32Mb), 768MB, WinXP (SP1) = 15FPS [Failed: While shooting at targets]
    • Svein Rune: P4 2.2GHz, GeForce4 MX 440 (32Mb), 512MB RAM, WinXP = xFPS [OK]
    • VisualAd: AMD 750Mhz, NViDIA (32Mb), 400Mb, Win2K = xFPS [Failed: Did not support multitexturing]
    • Stian HJ: P4 2.53Ghz, 512Mb RD, Ti4600 (128Mb), WinXP = 65FPS [Failed: While shooting]



    Glut:

    We where supposed to use glut for this project. I have never used it before, and as I am a DX guy, I found it hard to work with. So the only thing it is used for is to make the window. Something that isn't hard to do by your self. After that I have tricked it (ugly hack) so I am not actualy using it after that. Not for keyboard, nor mouse, or anything else. But since it is there, you have to have glut installed. It is supposed to more or less come with never versions of Windows, but if you don't have the files on your machine you have to download my attachment. Everything in the system32 folder has to be placed in your system32 (or what ever it is called) folder (PS: don't replace the files on your machine if you have a newer version there). But if you want to compile my project you also have to add the two other folders to your compilers linker. There is also an all ready compiled version of the game in the game zip. So if you trust me, you can use that one, and don't think about the compiler settings.
    Attached Files Attached Files
    Last edited by NoteMe; Apr 13th, 2005 at 10:08 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width