Final Project Report


Chris Johnson
Mike Fouquette
Mike Gilbert
Mike Stone

General Description of Snakes Apocalypse

Snakes Apocalypse is a multiplayer hotseat game where several teams of snakes have an arsenal of various weapons to use to destroy each other. The game begins by generating a random fractal terrain and places each team's snakes randomly on a piece of land. The terrain has a particular water level, where everything at or below this level is filled with water, and will cause instant death to snakes who walk there or are hurled there. The game has three camera views which can be switched between except in certain circumstances. Top-down view will have the camera directly above the terrain at a height that will allow the user to see the entire map. From third person view, the user is stuck looking at the current snake, with freedom to rotate about it, and zoom in and out. From this mode, the player can switch to first person, which is good for aiming weapons. Once the game starts, players take turns controlling one of their snakes. At this point they are able to move the snake, switch camera views, select a weapon, and fire a weapon. This is all done in real time. Once the snake has fired their weapon, there is a small time to retreat, after which no more input is allowed, and the next player's turn begins. A turn has a specific amount of time to move around before firing their weapon. If the time limit is reached, the player's turn is forfeit.

Each player controls a certain number of snakes, and all snakes on the same team are colored the same.

Game Environment

The terrain is be generated randomly at startup using a fault formation fractal algorithm. The resulting terrain is then lightmapped, texture mapped and detail mapped. It is deformable by nearly all the weapons in the game. The algorithms, texture maps, and detail maps will be based on those in Focus on 3D Terrain Programming, by Trent Polack.

Character Descriptions

The snake models are somewhat cartoonish. These were created by Michael Gilbert using 3D Studio Max.

Goal of the Game

The goal of the game will be to use your team of snakes to kill the other team of snakes. Weapons will be available to accomplish this goal. Various weapons will allow various ways of killing the other team's snakes. The weapons can hurt your own team as well, so care must be taken when aiming.

General Description of Rules

Each snake has a specific amount of health to start at. Health will drop due to weapons striking them directly or exploding near them. During a player's turn, there is a specific amount of time to move the active snake and fire a weapon, as described in the general description. The overall goal of the game is to kill all the other snakes (that are not on your same team) by reducing their health to zero with the provided weapons.

Special Effects

Most of the special effects are described in the "Game Features" section. Additionally, we implemented decent explosions and sound effects. The explosion effects are all done with particle systems and the sound effects were done using a library named fmod.

Game Features

  • Terrain (Mike Stone, Mike Fouquette) The terrain was done with a fault line algorithm to produce the height map. A texture was produced and algorithmically applied. This created a smooth looking terrain with rolling hills that change in texture based on elevation.
    • Light Map – A slope lighting technique was used to produce light maps for the terrain after it is generated and then the light map is applied to the terrain.
    • Quad Tree – The terrain was placed in a quad tree data structure in order to increase the efficiency of view frustum culling. The leaves of the tree are geo mip-map squares, and each square contains information about its children and neighbors.
    • Geo Mip-mapping – Geo mip-mapping was implemented for the level of detail. Each mip-map square contains the same number of vertices and is drawn with a different number of triangles based on the distance of the camera from the geo mip-map. This allows terrain that is far away to be drawn with a low number of vertices.
    • Geo-Morphing – This was implemented in an attempt to avoid popping (which we later discovered to be at least partially caused by the texture map). In a way it worked, the vertices of each mip-map are slowly changed to the new positions when the level of detail changes. Thus, instead of “popping” directly to their new position and being noticeable, each change in level of detail is slowly done. This works well most of the time, but when the terrain has drastic elevation differences between two very close triangles can cause a type of swimming effect when combined with geo-morphing.
  • Texture Mapping (Everyone) Textures are applied to every model in the game to make things realistic looking.
  • Collision Detection (Everyone) Collision detection happens between any object and the terrain, snakes and water, snakes and weapons, and camera and terrain. Collision between an explosion and a snake includes the force the explosion has on the snake (including direction and magnitude). Appropriate consequences will result from other collisions. Collision detection is done several ways, but in most cases bounding spheres are used to detect collisions.
  • Weapon Development (Everyone) Our variety of weapons, described in detail later on, were developed by everyone.
  • Explosions (Mike Gilbert, Mike Fouquette, Chris) The explosions were developed using a particle system with alpha blending.  They consisted of a main explosion, smoke particles, and shrapnel pieces.  Each explosion is made unique by using a random number generator to affect different aspects of the explosions.
  • Camera Manipulation (Mike Gilbert, Mike Stone, Chris) The camera has three main modes: Attached, Detached, and Sky view.  Attached view means that wherever the camera is aiming, the worm follows.  Detached allows for free movement of the camera.  Sky view moves the camera to an overhead view, allowing for a view of the entire map.

Extra Game Feature

  • Terrain Deformation (Mike Gilbert, Chris) Explosions will deform the mesh in appropriate ways, and will adjust the texture and the lightmap to take the changes into account.

Game Weapons

  • Bazooka A cylinder appears next to the snake, aligned with where the weapon is aimed. As the snake changes aim, the cylinder will follow. Pressing and holding the fire button will increase the charge of the rocket. The higher the charge, the more force the rocket is sent from the cylinder. The rocket will be a simple bullet mesh that travels in a parabolic curve relative to forces of gravity and wind. Upon impact on anything, a small explosion occurs.
  • Air Strike This weapon can only be fired from top-down view. The user clicks an initial point on the terrain, and drags to another point. The line along the terrain specified by these 2 points are then bombed at random positions with a particular pre-set number of bazooka bullets. A smaller specified line has precision, while a longer line has less chance of hitting desired targets. An addition, if time provides, will be to have the camera follow the bombing after it begins.
  • Dynamite When fired by pressing the fire button, the snake drops a stick of dynamite, which is a red cylinder with a white smaller cylinder for the fuse on top. The fuse will diminish until it hits the top of the dynamite, and then an explosion occurs.
  • Mine This weapon is fired in a similar manner to the dynamite stick.  However, it does not explode immediately.  The fuse is only lit when another game object moves within a certain distance of it.  It will then begin a countdown to detonation.
  • Grenade Similar to a dynamite stick, but it can be thrown great distances.  It also bounces on the terrain more than other weapons.
  • Nuclear Strike Similar to the Air Strike, except that it is always dropped in the middle of the map, and the damage it does is many times that of any other weapon.
  • Holy Hand Grenade Similar to a grenade, but it deals significantly more damage.

 

Users Guide

Keys:

  • Arrow Keys: Move the snake relative to it’s gaze vector/look direction.
  • Mouse: Controls the gaze vector/look direction
  • Space Bar: Fires the currently selected weapon.  The longer it is held, the farther the weapon will fly, if applicable.
  • Comma, Period: Cycles through the available weapons.
  • ‘z’: Goes to a top-down view of the map.  Press ‘z’ again to return to a ground-level view.
  • ‘f’: Goes to a first-person view, excellent for aiming.
  • ‘d’: Detach the camera from the snake, allowing for freer movement.
  • ‘b’: Activates the secret bunny mode!
  • ‘g’: Activates the secret ghost mode!
  •  ‘q’: Quits the game.

Debugging Keys

  • ‘l’: Shows only the light map.
  • ‘c’: Toggles culling.
  • ‘w’: Toggles wire-frame mode.
  • ‘t’: Toggles textures.

Sources

http://www.nehe.com – Tutorials were consulted for bump mapping, but not used.

Polack, Trent.  Focus on 3D Terrain Programming.  Cincinnati: Premier, 2003.

http://www.fmod.com – Library for sounds.