Life is an Obstacle Course - Midterm Report

From EQUIS Lab Wiki

Revision as of 03:07, 29 February 2008 by Aclarridge (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Group Name

Shake and Bake

Project Title

Life is an Obstacle Course

Group Members

  • Adam (aka Magic Man)
  • Tad (aka El Diablo)

Project Description

Goals

The original Life is a Village (LIAV) program was developed as a strategy/adventure game. A player can traverse the map and collects resources in order to create a village with the help of the automated villagers found in the game. Although the basic game framework is functional and rather impressive, the gameplay is somewhat basic and open ended with no clear goal or way to win the game.

Our goal is to transform LIAV in its current state into a racing game. This also affords us the opportunity to explore the flexibility of the LIAV game architecture since we are radically changing the game functionality.

In order to create the “Life is an Obstacle Course” (LIAOC) game, the following features need to be implemented:

  • A start line to begin the course and finish line to complete the course
  • A clear path on the map for the player to follow
  • Various objects (or obstacles) for the player to avoid
  • A timer and/or scoring system

To make the obstacle course somewhat more entertaining we would also like to add in power-ups (e.g. speed-up items) and traps (e.g. slow-down items), should time permit.

Changes to Gameplay

When the game is launched the player’s avatar will appear at the starting line of a race course. As soon as the player crosses the start line a timer (displayed as a HUD) will begin. The player is able to control the direction and speed of their avatar as they manoeuvre through the course. The avatar will move quickest on the track, slower when off course, and come to a complete stop when colliding with an obstacle.

File:Midterm presentation LIAOC 1.PNG

The LIAOC game will be playable with input from an exercise bike (similarly to the original LIAV game). Resistance on the bicycle gears will be lowest when the avatar is on the track, and will increase when the avatar veers off course or strikes an obstacle. The game will also be playable without a bike by using a keyboard for input.

Controls from the current LIAV game will be stripped down since there will be less user input required. The basic controls will be:

  • forward
  • left
  • right
  • reverse
  • brake
  • change camera view

Camera controls will be limited to three views: a FPS type view or “bumper cam”, a view from directly behind and just above the avatar, and a view from a further distance away.

User Interface

The displays from the current LIAV game are stripped down with only the current speed and gear shown. Additionally, a race timer will be added to the display along with text showing the currently enabled power-up or trap. Display messages for “Start Race” and “Race Complete,” as well as final results (i.e. time to complete the course) will also need to be displayed to the user.

Art Requirements

In order to create the LIAOC game, the following art models are needed:

  • vehicle avatar (hover-craft, created by Travis)
  • obstacles: boxes, barrels (some already exist in the Ogre samples)
  • start/end flags
  • power-ups (engine, created by Travis)
  • traps (glue bottle created by Travis)

File:Midterm presentation LIAOC 3.PNG File:Midterm presentation LIAOC 4.PNG File:Midterm presentation LIAOC 5.PNG

Project Milestones

Milestone Status
Creating a map with a track Completed
Implementing the different camera views Completed
Adding in the ability to reverse the avatar Completed
Modifying the HUD displays Mostly done (timer and power-ups missing)
Adding obstacles to the course Mostly done
Adding in new art models Mostly done
Adding start/finish triggers March 7
Adding power-up and trap triggers March 7
Implementing speed value based on terrain type March 14
Display a “fastest times” list upon race completion March 21
Adding in sound to the game Optional
Particle effects when hitting an object Optional
Testing, debugging, documentation Final 2 Weeks

Changes Made

The following is a brief but comprehensive list of changes made to the source files up until this point:

  • Obstacles: In WorldResourceManager, disabled resource node distribution, added obstacles instead
  • Terrain Mapping: map/heightfield/terrain files generated from new mappainter.py
  • Removing Buildings and Villagers: disabling method calls in CAXGame
  • Changing Views/Reverse: input.cfg (in Release folder), InputManager, CAXAvatar (overloaded getDesiredCameraPos to include camDistance), CAXGame (call to getDesiredCameraPos)
  • HUD/Overlays: changes to concept.overlay and CAXGameState
  • Change avatar model: removed all avatar animation (CAXAvatar)

File:Midterm presentation LIAOC 2.PNG

Technology

Race Timing

The timing in LIAOC will consist of ProximityTriggers at the start and finish lines of the obstacle course, whose firing will call the setState method of CAXGameStateManager to toggle the racing/non-racing game state. The start trigger will also zero the Race Timer, which simply uses the InputManager's mStartClock. If the game state is set to racing, the HUD will display the "Race Time", and if it is set to non-racing, that part of the HUD will be blank. Eventually the time will be recorded in a "Quick Times" list, which is displayed at the end of the race.

Loading Obstacle Items

Since LIAOC does not use resources or buildings, we believe it makes sense to merge the CAXWorldResourceManager and the CAXBuildingManager into a CAXObstacleManager, and change CAXBuilding into CAXObstacle. The functionality for randomly placing objects on a terrain type already exists and is located in CAXWorldResourceManager. We plan to modify this code to also support random placement of obstacles with associated ProximityTriggers whose firing causes the object to disappear and changes the user's speed and/or pedaling resistance.

New Player Controls

Reversing the avatar is achieved with a button press and hold (i.e. back arrow) and camera views are selected with number keys (i.e. 1,2,3). In order to implement this, changes were made to the input manager (this is where user input is handled). New keys had to be assigned in the code and added to the input.cfg file.

When the reverse key is pressed, the direction vector of the avatar is simply negated. In order to change the camera views, a new method had to be added to the input manager in order to store and pass the new camera positions. When the game loop executes and the camera is updated, the function now requests the desired camera position from the input manager.

Terrain Mapping

In order to generate a map with a track, we required the use of the mappainter.py application. No changes to the code were necessary, but the following instructions were created for future reference:

The following files and programs are needed in order to correctly generate the terrain heightmaps: mappainter.py (modified by Rob Fletcher on 2/5/2008), the Python CGKit Library and Imaging Library (PIL) must be installed, and ImageMagick must also be installed (it does "blending" on the heightmap file so that there aren't sudden jagged changes in height between terrain types with different height ranges).

Read the documentation in mappainter.py before starting in order to get an idea of what the program does. Ensure that the two input files (usually rsrcmap.xml and rsrcmap.png) have the same name. Make sure that the rsrcmap.png file has finitely many different colours (making it in MS Paint works) and that each different colour has a corresponding terrain type in the rsrcmap.xml file. Finally, run mappainter.py (it should be run from the LIAV\media\terrain folder, where rsrcmap.xml and rsrcmap.png are too) with the command line argument "rsrcmap". When it is finished, you must manually save one of the output files, "newhf.png" as a grayscale image. GIMP does this quite well - open it up and go to Image->Mode->Grayscale, then save and close.

Interaction with Other Groups

The LIAOC game is being developed separately from the other groups in the course. Initially, there was discussion of working with Scott to possibly build in a multiplayer feature into the game; however no progress has been made in this direction.