Kathleen Tuite and Ben Samuel
Final Project: The Big Race!
Professor Alex Pang
TA: Adam Smith
3/22/2006

THE BIG RACE!!

___________________

SCREENSHOTS
___________________


Starting line and your enemy opponents!



Stuff!



You enemy being eaten by alligators that you flung into his lane! note the copious amounts of blood! (they're like little red blood cells flinging themselves everywhere..)



You jumping really high with your super shoes!



The end of the race! (MASTERY ... YES!!)



You not making it to the end of the race and dying!!


___________________

THE ORIGINAL
___________________

The Big Race -- HC11 Version, conceived in CE 12

___________________

PROGRAM DESCRIPTION
___________________

The goal of this program is to grant the user the single most greatest euphoric event they have ever experienced in their entire life. You assume the role of a dashing young hero who just so happens to be the greatest athelete in the world! How convenient! It is up to you to rescue the princess and save the world and win the gold medal, lest your enemies destroy you and all you hold dear! Of course, it won't be easy to accomplish your mission, for your wily foes have littered your race course with a multitude of traps! In addition to the officially sanctioned racing hurdles, you will have to overcome pits of giant crocadiles that hunger for the lean, well-toned flesh of a hero such as yourself! Will you be able to beat the odds and earn the best master ranking? Or will you succumb to DEATH BY ALLIGATOR!!! The only way to find out is to run... THE BIG RACE!
__________

HOW TO RUN
__________

Err, well, when in the lab, you compile it via Microsoft Visual Studio and then run the .exe file that is created. When you run it on our laptop, it requires a makefile (just run the command make Makefile.cygwin && game.exe to both make and run the game at the same time!) There always seems to be some amount of weirdness when it comes to getting it to work across platforms that we find very frusterating.

___________

HOW TO PLAY
___________

As previously mentioned, the goal of the game is to achieve the impossible. Fortunately, you have been blessed with super human athletic prowess to attain whatever goal you put your mind to! These amazing powers can be activated via the following keyboard commands:

------------
S -- Speed up power! Hit this to increase your velocity towards the finish line! Go go go!
J -- Jump Power! You will need to master this command if you hope to have a prayer at avoiding the traps lain by your foes!
B -- Backup Power! The wise man knows when the best way to move forward is to take a step back. Useful for getting running starts.
------------

Yet as incredible as you are, there are just far too many obstacles for you to be able to survive with your wits and skill alone. Luckily for you, Divine Providence has smiled upon you, and provided you with an arsenal of tools and weapons to overcome adversity! In order to make use of these tools, you must first pick them up from the ground! The observant hero will note that there is a maximum amount of space that you can carry in your inventory! Because even though you are fantastic, your pockets are significantly less than heroic. Once they are in your inventory though, you will still need to actually use them to derive their benifits. The commands to utilize your powers are as follows:

--------------
Z -- Zip up to the stars! If you have a SUPER SHOE, you can use this to perform a more powerful jump! You can even do it WHILE IN MIDAIR!
A -- Attack! If you have a GROOVY GLOVE, you can hit this key when you are near a hurdle to send it careening into the stratosphere, and out of your path!
--------------

You also have the ability to attain ALI-OFF (TM), the Alligator Repellent of choice of atheltic superstars everywhere! If you possess Ali-Off (tm) in your inventory if you unfortunately land in the gaping maw of an alligator, then the alligator will be so disgusted that he will flee to the lane of one of your opponents! The effects of Ali-Off (tm) are incredibly powerful, and so the mere fact that you possess it in your inventory is all that is necessary to make use of its protective properties!

However, if you are slain, you need not fear! While the world mourns your passing, in your last dying throes, you can use your god-like abilities to turn back the very face of time itself, and grant yourself another chance to put right what once went wrong! Or, if you successfully made it to the finish line and are interested in saving the world again, you can use your time-turning powers there, too! To activate this open mockery of the laws of nature, simply hit:

------------------
R -- Rewind time! Start back at the beginning of the race, fresh faced and full of vigor!
------------------

______________________________

HOW WE WENT ABOUT DOING THINGS
______________________________

So, you are the hero. You are a Racer. There is a Racer data structure that has information about your current position, your current inventory, flags for whether or not you are jumping, flags for whether or not you are dead, and also a dBodyID and a dGeomID. Both of these are incredibly important, because that if the hero has crashed into any other geomes in ODE. But, what other things are there to crash into, you ask? Well, that is a good question, and it shall be addressed presently:

We also have a Course data structure. This course contains a handful of nice variables to help us identify and render it, such as an ID, a length (so we know how far out into the world the quad that we draw that we run on needs to be) as well as a number representing the amount of times that the ground texture should be repeated so that it ends up looking pleasant and not too squished or stretched. However, the real meat of this data structure can be found within its many vectors. These vectors are like arrays in that they are essentially long lists of data, but unlike arrays, they can be allocated dynamicly, permitting us to constantly push more things onto them as we best see fit! These vectors are the things that 'make up the course' if you will, including the amount of items (divided up into an ali-off vector, a super shoe vector, and a groovy glove vector), as well as the amount of alligator pits and the amount of hurdles. As hinted, we don't actually specify the exact number here--that takes place in a nifty little function called populateCourse!

When the game is first initialized, in addition to all of the ODE physics stuff that needs to be set, we also want to fill up the race course with all of the items! The way that we do this is easy and great! You see, we have a set of predefined strings, and each string represents a different course. When we call the function pickCourse, we randomly pick one of these aforementioned strings, and pass it into the also aforementioned function populateCourse. populateCourse examines each character in the string, and based on what it finds, it pushes an object onto the appropriate vector. So, if we see an 'A', we know that we should place some Ali-Off (TM) at the specified location, an @ represents an Alligator pit, S is shoe, G is glove, H is hurdle, and so on and so forth. But, what is that specified location? Why, it is simply based upon the location of the character in the array! This provides us with an incredibly simple method to design and update as many courses as we so desire!

Also, before we get too off topic, we also have a particle data structure. This is vital for our particle systems, such as the snow gently falling from the sky, or the copious amounts of blood that spew forth from your tattered body after being mauled by Alligators. The particle data structure has information about the current x, y, and z position coordinants of the particle, as well as the x, y, and z of its velocity. Each particle also has a physics type, such as 'snow' or 'blood', which helps us calculate how the particles should be updated. The updating and redering of the particles takes place in a function appropriately titled, updateAndRenderParticles.

Well, that is all fine and dandy, but how do we actually get such simple tasks as walking and whatnot done? Well, whenever the user enters input, either flags are set or functions are called that respond accordingly. The most common response is the addition of FORCE to a body! If the user hits the speed up button, then a little bit of force is added to their x direction (conversely, if they hit the backup button, then a little bit of force is taken away from it.) If they hit the jump button, then a little bit of force is added to their z direction. If you hit a hurdle with one of your gloves, then... force is added to it to send it flying! If you run into a hurdle with your body, then force is added to your position to impede your progress! Truly , the simple act of applying force to things opens up a multitude of doors for special effects.

ALSO, sometimes the thing to do is not to apply a force, but to actually sink out hands down into the inner mesh which is ODE and fiddle around with specific values ourselves! If the hero is beginning to stray off of his lane, we are sure to set both his y position and his y coordinate back to zero, so that he doesn't go careening into the lanes of his opponents. Also, when you run into an item, we need to move the item right away so that this thing which is supposed to be helpful doesn't accidentally become another roadblock to your success! By this same logic, if you run into an alligator pit while possessing a canister of Ali-Off (tm), then we re-position it into the lane of one of your opponents! This is another invaluable tool that has many terrific uses!

The world is rendered through a ground plane that has several textures bound to it--the bulk of which is a repetition of the 'track' texture, though there is also a starting line and a finish line texture, not to mention some pure grass textures! Then there is a vertical plane in the distance (a wall, if you will, again, with a texture bound to it) that acts as the backdrop of our scene. In addition to rendering these two things, we also have a wide variety of "draw___" commands, functions, which provide the geometry to render all of the various items, enemies, and indeed you the player, to the screen. All of the objects we render were hand crafted by us! Well, glu certainly helped, but we didn't go out and find any fancy models to make things for us! We translated each cylinder by hand to make our Groovy Gloves and our shoe boxes, and we believe that the heart and soul that we put into every one of them truly shines through.

Another thing you may notice is the fact that you are not alone in your quest to the finish line! You have two bloodthirsty opponents! These opponents are lucky, because they only have the officially sanctioned hurdles to worry about. Of course, this makes perfect sense, considering the fact that it was THEY who installed the alligator pits on your lane! That's right, as evil as they are, they were able to put aside their differences in an attempt to destroy you; that is how great their passion is to see you eliminated. Your foes will see hurdles before them, and attempt to jump over them, in a masterful example of the powers of Artificial Intelligence.

_________

IN CLOSING
__________

We hope you have as much fun playing our game as we did making it! Thank you for the great quarter!