Eggeroids - an Asteroids remake in 3D
This is my entry
Here is a bunch of info about the project that I have put togther..
(full docs are contained in the Main.cpp code file at the top)
Effect Synopsis :
Real-Time Constantly Moving Stencil Shadows(both from object and light movement)
Real-Time Water-Ripple effect based on Player/Asteroid movement
Real-Time procedurally generated blend-mapped multilayer clouds effect - clouds change each wave, sometimes cloudy, sometimes fine
Particle Effects for Player\'s Ship, Water Wake, Explosions and various other things
Asteroids textured and detail mapped - both generated procedurally
- Asteroids have specular highlights and a "gloss" effect - no shaders
- Asteroids create a water ripple when they are destroyed
All textures and images procedurally generated
3D Dynamic GDK Object based Text
- NO SHADERS Metallic effect applied to Text objects
- Text numbers increment based on value passed to class's Set member functions
- member functions to position "number panels"
- "number panels" work like an old fashoined cash register with an analoge digit readout. Essentially
each number is an individual object, stored in an array and cycled through using a simple
incremential algorithim to set the values and excluding on/off.... they are hard coded
at the moment to not go below zero, but I will add negative number support when I work more on this class
Player's Ship has a "gloss" effect applied to its texture.
Player's Ship has engine lighting when thrust is engaged
Player's Ship has weapon lighting, you can see light flickering when you fire, like muzzleflash lighting
Basic sound effects triggered by certain events, shooting, collisions powerup etc...
Different sound generated for each effect - using memblock sounds
Effect are realistically placed on objects - explosions occur when an asteroid is destroyed, where asteroid is
destroyed. Player's jet engines originate from the player's ship's engines ... bullets from the gun mount
Slightly convoluted Object Oriented design - although basic in its implementation and not very efficient.
Story
The year is 1021 A.E.(After Egg). Your planet has been invaded by the dastardly Eggeroids. Semi-Intelligent
Egg-shaped floating rocks. They are everywhere. City after City, Nation after Nation, nothing
has stood before the unstoppable Eggeroids. Nobody knows where they came from, or why they are
here, all anybody knows for certain, is that if you get too close, you get squashed !!
You are a the newest member of your planet's last ditch effort at survival, a Cone Pilot.
Cone Pilots live on the edge, flying what some refer to as "Floating Icecream Cone Coffins", sort of sleek,
not quite shiny, almost agile and of course, Cone shaped, jet-powered-projectile cannon toting-anti-grav
shooty-ships.
Because you are the only Cone pilot to ever have failed every single briefing(even though they arent exams ?!) AND
crashed 74 Cone ships(on takeoff), All without killing a single Eggeroid, you have been selected
for a topbottom-secret mission of the utmost unimportance.
You are to fly the new prototype Cone Ship, the XV3-aIM mark 2, the mark 1 ship had some small problems that
her pilot identified for us most graciously, he even left the various parts of his body in the problem areas
for us so we could identify them from amongst the wreckage...he was a very dedicated pilot. We think
the R&D department have rectified the majority of the problems, at least the ones that seem to cause
some of the less desirable behaviours in your ship, things like spontaneous explosion and ground-ramming.
You will be inserted smack bang into the middle of the largest concentration of Eggeroids that
we can find. The goal of your mission is to kill at least ONE Eggeroid before you are
sent to meet your makers. We will be monitoring your ship's data feed and recording everything for posterity's
sake. Your sacrifice is a great one Pilot, it means that we have one less idiot crashing our multi-million dollar
Ships every day... GOOD LUCK PILOT !!
Gameplay and Codeing notes :
Basics:
The point of the game is to try and achieve the highest score that you can. Simple.
The Game starts out fairly slowly, with a few Eggeroids moving slowly around. Once
they are all dead, the next wave will be larger, faster and more difficult to survive.
Controls:
W - Forward thrust, normal velocity
S - Forward thrust, hyper velocity
A - Rotate ship Left
D - Rotate ship Right
P - Pause Game
MouseMove - Rotate ship left/right a little quicker than A and D
Left Click - Fire normal Projectile Cannon
Right Click - Fire special weapon Projectile Cannon
Details:
The Game plays in a manner similar to the Classic Asteroids game we all know. You control a small
"Cone Ship" and have to destroy the "Eggeroids", which float around the game field changing
their direction based on your ship\'s position, sometimes they will float away from you and sometimes
they will float straight at you. The Eggeroids movement speed will increase dramatically as they
are destroyed making it harder to target them.
The game plays out in Waves. When you have destroyed all of the Eggeroids in a wave, the
game will pause, and get everything re-initialized. It will take the game a few moments
to get the playing field all setup again between waves, as it has to make a bunch of new
Eggeroids, as each wave will increase the amount and speed(by 10 and around 20% respectively)
of the Eggeroids until you die. The game is basically never ending and the speed of the
Eggeroids and the amount of them will increase until either you get killed or get sick of it.
When you destroy an Eggeroids there is a small chance that 1 of 3 kinds of powerups will be
dropped, when a powerup drops, grab it quickly, as if another of the same type drops, the first
will disappear(there can only ever be 1 of each type of powerup active on the game field at a time)
The 3 Powerups are :
RED : Shield Recharge - very very rare and valuable
BLUE : Increase projectile count by 1
GREEN : Increase special weapon uses by 1
The RED and BLUE powerups are both very rare, only having a 1 in 50 chance to drop each time
an Eggeroid is destroyed. the GREEN powerups are more common and have something in the order
of a 20% chance of dropping when an Eggeroid is destroyed.
You start the game with Shields at 100% - Each time an Eggeroid hits you, your shields
will be reduced by 10%, when your shields reach 0%, your ConeShip will be destroyed and
the game will be over.
Your Projectile Cannon contains a finite amount of projectiles, you start the game
with 16, but this can be increased with powerups. You can never fire more projectiles
at once that your cannon contains. This includes firing either in normal mode or Special Mode.
Special Weapon mode required extra power that can only be obtained through powerups that are
dropped by Eggeroids on their destruction(you start with 3). Firing you special weapon will result in ALL projectiles
being recalled instantly to your cannon and released in Circular Pattern Omega(a high energy circle around your ship).
The projectiles will move much faster and further than normal when fired in special weapon mode.
Your projectile's speed is directly related to how fast you are moving.. If you move faster, your projectile cannon's
shots will travel further, faster..
SYSTEM REQUIREMENTS :
My DevPC run this game at 75fps constantly, dropping to 65-70ish during later levels at the start with many many eggeroids
on screen.
You will Require :
A Pentium 4 2gig(or AMD equiv) CPU
1gig of RAM at least
a Video card that supports PS/VS 2.0 minimum, with at least 256mb RAM
and support for 1024x768x32bit resolution
(these are the minimum specs to get the game to run, it will still be slowish)
Developed On :
Intel Core2 E8500
Gigabyte Intel P35 Chipset motherboard
2gig DDR2-800
Gigabyte NVidia 9800GT 512mb
Microsoft Visual Studio 2008 C++ Professional Edition
DarkGDK 7.4
March 2009 Microsoft DirectX SDK
Please note that after the initial Title Screen of the game, there is ALOT of setting up to do.
This game generate ALL of it's media and assets procedurally at run-time, and this takes time.
The game is using Custom Primitives, 3D object based text(custom meshes), generated textures
and generated sounds.
It will take a short amount of time, with the program appearing not to do much(trust me it is not idle) during this time
for the program to get all of it's media/assets setup and configured correctly. There are text alerts
that will tell you what phase of initialization the game is in.
If you have a slower PC, you will notice that the time to setup the game initially, and also inbetween "waves"
of asteroids, may be long. This is only because of things being generated before being used, so that
nothing is generated once the game actually starts(except bullets, they get added with powerups etc... and are created
dynamically based on the amount needed-very small sphere primitive though, no shader and onyl spec highlights so
not something that will impact performance at all, plus it only happens when a powerup of a certain kind(blue) is grabbed)
CODING NOTES :
This game's code is mostly developed around an OO principal. I didnt, however, sit down and do what I should have done
which was to plan out the classes and their interactions and the rest of the game properly. I did it quickly
and without thinking it out too far, and due to that, I had to build extra systems into classes and build
other systems to pass data back and forth between classes in what is fairly inefficient methods.
Alot of the code in this project is contained within the supporting framework. All of the image generation and object
creation is encapsulated away from the user and hidden inside the private members of the classes, all of the
object's themselves are managed with a baseclass called Object3D, which encapsulates all of the DarkGDK Basic3D
commands, and manages ID generation and recycling(it has a couple of drawbacks in its current form), All of the
particle effects are managed from a similar base class.(The exception is the 3dtext class, it only partially
uses the Object3D class)
There are 3 main classes that make up the "game" - cPlayer, cAsteroid and cBullet. All of the other classes make
up what is the game's framework and support code. The Main.cpp acts as the "controller" and ties
all of the classes together and acts as a conduit for data being passed between some of the game's higher
level classes.
Some of the various functions within some of the classes in this program have been taken from various DBPro snippets and
ported to GDK, and altered appropriately to do what I want them too. All of the functions that I have taken
from any other source are mentioned in the code as coming from another source originally, and have been heavily
modified. All of them besides the CreateSound function have been encapsulated into classes and structures.
The 3D Text object functions were originally a part of Cloggy's D3DFunc plugin for DBPro. I could never get his
GDK lib to work without some strange error or workaround required, so when I saw that he had released the source for
the DBPro version, I set about converting it into a class library for my own use right away. The class c3DText has
been pulled from that class library and modified heavily to work on it\'s own and within this game without
mucking anything up.
If you are interested in any of the classes or code contained in this project please feel free to ask and ill
do my best to answer. Alot of it is by nature quite generic and could be used in multiple apps.
Screenshots :
Attachment contains all of the code files and also my project file so that yuo can just add it so a solution and get an idea of the file structure.
Any question, just ask

If you find any bugs let me know any ill try to get em fixed.
If it ain't broke.... DONT FIX IT !!!