Heart Attack

Team Members
-------------------------------------------------------------------------------
Lee Hendrickson (lthendri)
Jens Pillgram-Larsen (jenspl)
Tarang Vaish (tarangv)


Website
-------------------------------------------------------------------------------
http://www.stanford.edu/~lthendri/HeartAttack/index.html


Story
-------------------------------------------------------------------------------

In Heart Attack, you play a futuristic nano-robot whose mission is to combat
infections in the human body. In this specific scenario, a particularly nasty
virus has targeted the heart of a patient, if you don't clear up the infection
in time and protect the heart the patient will surely die!


Gameplay
-------------------------------------------------------------------------------

The game environment consists of a section of the patient's bloodstream as your
main pathway through the body will be the veins and/or arteries ultimately
leading to the heart cavity. As these corridors can be very twisty and turny,
navigating them can be a challenge. You have a full range of 3D motion in which
to manuever, be sure to take advantage of this fact!

Along the way you will surely meet many of the infiltrating virii. At first,
they will probably not pay much attention to you, their attention on racing to
the heart, intent on destroying it. But, if you engage them, their attention
will turn to you instead! Destroy them using the state-of-the-art anti-virus
weapons your nano-robot has been outfitted with. However, in order for the
patient's immune system not to attack the nano-robot itself certain parts of it
are organic in nature and can be damaged by a virus' attacks as well!

If you can make it to the heart unscathed you will need to clear the heart
cavity of any still present virii and protect it from incoming virii until the
body has a chance to fully build up its immunity. If you can keep the heart
alive for that long then you have succeeded in your mission!


Controls
-------------------------------------------------------------------------------

Control of your nano-robot is handled through both the mouse and keyboard. The
mouse is used to control the direction the ship is facing and thus its
direction of thrust and firing. Pressing the left mouse button will fire the
ship's weapon once, holding down the left mouse button will unleash a constant
stream of projectiles.

Keys:

  * up arrow: thrust in the ship's forward direction.
  * down arrow: thrust in the ship's backward direction.
  * left arrow: thrust in the ship's left direction (strafe left).
  * right arrow: thrust in the ship's right direction (strafe right).
  * ctrl + left arrow: rotate the ship's view left.
  * ctrl + right arrrow: rotate the ship's view right.
  * ESC: return to the main menu.
  * p: pause the game.

When a virus is killed many of them will leave behind some of their DNA which
the nano-robot can pick up to more effectively destroy future virii. This can
take the form of enhancing the ship's weapon strength, armor, or health.


Features
-------------------------------------------------------------------------------

# On-screen control panel: Various information about the state of the game is
dynamically displayed through the game's from-scratch HUD. At a glance the
player is informed of not only their own state (health, weapons, armor, etc.)
but also the heart (health and immunity) and the virii (relative positions on
the radar). Game events such as the player being hit by a virus are also
dynamically displayed on the HUD.

# Frustum Culling: Given the tesselated models of the world and also objects
inhabiting the world, an octree data structure is precomputed for each model.
For each frame to be rendered the current viewing frustum is computed and all
octrees are recursively tested for exclusion/inclusion/intersection with that
frustum. Any nodes of the octree not in the frustum can be discarded and not
rendered.

# Collision Detection: Using the same octree structures built for frustum
culling, collisions between objects in the world (and between objects and the
world itself) are computed initially using the intersection of the simple
bounding volumes of octree nodes. If a leaf of the octree is reached in the
recursion then triangle-triangle intersection is performed to give a highly
accurate, yet efficient, collision detection routine. To allow for necessary
game dynamics (e.g., projectiles), further functionality such as ray-octree
collision detection has also been implemented.

# Simulated Dynamics: The dynamics of collision response are simulated using
the physical phenomena of friction, impulse response (restitution), and, for
non-static bodies, conservation of momentum. Given the game's environment, the
player's velocity is continually affected by a simulated viscous drag modeled
from the physical parameters of blood.

# AI: Every virus has a personality that seeds its behavior. A virus then
"learns", through time, to more efficiently achieve the essential goals of its
personality using a simple neural network. Events happening both to the virus
and because of the virus are fed as factors into the network to produce a
dynamic improvement in behavior. Pathfinding is also predicated on the same
model, if a virus finds itself colliding with the world too often the factors
governing its movement are fine-tuned to make its progress more efficient.

# Advanced Rendering: To give the game environment a more realistic and
dynamic feel every object (and the world itself) have their own pixel and
vertex shaders written in GLSL. Lighting effects such as diffuse, specular and
spotlight shading are computed on a per-pixel basis. For virii, a form of
displacement mapping is also used to give them a more organic look. To make the
heart and veins also appear more alive dynamic texture warping and modulation is
performed. (Note that because of this feature a graphics card which support
OpenGL 1.5 is required.)


Building and Running
-------------------------------------------------------------------------------

Heart Attack depends on several open-source libraries.  These include:

1.) SDL 1.2.9
2.) SDL_ttf 2.0.7
3.) SDL_image 1.2.4 (which itself depends on libpng)
4.) SDL_mixer 1.2.6
5.) guichan 0.4.0
6.) glew 1.3.3

The support directory included with the game's distribution includes all
necessary header's and libraries needed to run the game, at least on a 
linux (debian) platform.

To run Heart Attack, run "build-linux/HeartAttack" from the root directory.
