Defend Earth

[binary download] [source download]

[postmortem]

It may require the 2008 Visual Studio C++ Redistributable Package [link]

To build, it requires wxWidgets with the OpenGL Canvas enabled [link]

 

This was a game I made for CS 454 - Computer Graphics in Spring 2009 for our mini project. We had exactly 21 days to make a project using OpenGL that was fully three dimensional, used a camera, and had moving parts. I decided to make a game. See my Postmortem for a more in depth discussion.

 

To run: double click on "CS 454 Mini Project.exe"

 

 

Features

 

Challenging Short Space RTS Game.

 

Full 3D.

 

Intuitive Controls for a Space RTS Game.

 

Can you Defend Earth?

 

 

Picture of my game Defend Earth

It is kind of hard to tell what is going on but, it looks better at a higher resolution or in game.

 

 

The point of this game is simple: you must defend Earth from four green invaders. You have three two tools at your disposal, your capital ship and your wits. Sorry, your fighter craft just got blasted out of orbit. Can you destroy the invaders before Earth or yourself is destroyed?

 

Most of the time the invaders are focused on planet Earth. If you just try to blast them from your current position then you might not destroy every one until Earth is history. You have to carefully dance in the stream of fire but, don't stay too long as you can't take much yourself.

 


Controls


Left mouse button: select a ship
Right mouse button: attack a ship with selected ship
Middle Mouse button(or hold down ctrl and right mouse button): rotate camera
W - move camera forward
A - strafe left (pan)
D - strafe right (pan)
S - move camera backwards
N - start a new game



Credits


Nico Marrero, Instructor for Computer Graphics CS 454 at New Mexico Tech, for great instruction and feedback.

oera@online.no
http://www.oera.net/How2/TextureMaps2.htm
Moon Texture base (compiled from nasa images)

Nasa Blue Marble (Earth texture)
http://veimages.gsfc.nasa.gov/2433/land_shallow_topo_2048.jpg

Kamram
OBJ loader base (I added on textures and normals. It was quite easy to extend)
http://forums.devshed.com/c-programming-42/opengl-obj-loader-507718.html

Cloud texture for Earth
JC Francois
http://www.noirextreme.com/digital/Earth-Clouds2700.jpg
http://www.noirextreme.com/

 

 

Postmortem

 

My game turned out quite well. It far exceeded all of the project requirements. I focused heavily on the underlying code base and 3d graphics. Besides the requirements, it has these features: texturing (anisotropic filtering enabled), mouse picking, 3d collisions, object oriented (it has a easy to use Scene Graph and the graphics engine is separate from the game), model loading, light normals for models(lighting wasn't fully implemented at this stage.), and text output to the screen with good looking(true-type) fonts.

 

The game turned out to be quite fun. It was entertaining blasting the enemies or watching Earth get blown up. It was especially entertaining to see if there was any way the fighter craft could be saved. The reception of my game was great. There wasn't any major game breaking bugs. My simple AI's randomness increased the replay value of the game.

 

 

Lessons Learned

 

Initial camera view for a game matters a lot. The user will interact and play with your game based on the default camera setting. Initially, the default camera view required the user to maneuver it  and thus wasted valuable seconds.

 

User testing is very important. Many people found my game too difficult. One reason was that the user was thrown into the game as soon as it started up.

 

Some sort of effect should have occurred in the future like a cool explosion effect to reward the player when he destroyed a ship. A neat effect for Earth being destroyed would have been nifty. It would also let the player realize the game was over.  

 

Yes, being able to attack the moon was intentional :) It is an easter egg. It is "working as intended."

 

An in game help menu or giving initial instructions before the game started would have been valuable for making the game easy to pick up.

 

The game used Euler angles for their ease and simplicity to visualize in one's head. Unfortunately, it resulted in the bug where the ship would sometimes go perpendicular or 180 degrees away from where you wanted it to go. Looking back, quaternions would have been a better choice and the bug would have been resolved. I used quaternions before for my work at ICASA.

 

Different container objects for the good guys and the enemies would have been more useful instead of throwing them into one generic ship container. Keeping separate variable counters of how many enemies and friendlies is prone to failure and software bugs. There was no reason to keep around destroyed ship objects either unless if they were going to be reused.

 

C++ exception handling may have been more robust for error checking over C-like logic.

 

[top]