Villager KissesGAM400

Technical Design DocumentSemester 7

Development Team

Villager Kisses: Game Overview

High Concept

Target Audience and Rating

Game Play

System Requirements

Minimum System Requirements

Recommended System Requirements

3rd Party Technologies

DirectX 9

FMOD

Game Code Overview

Code Dependency Layers

Villager Kisses Sub-Systems

Class: AutoList

Class: Singleton

Class: Handle

Class: HandleRef

Class: RandomNumberGenerator

Key Component: Game Application

Module: Game

Class: GameMgr

Module: User Interface

Class: MenuMgr

Class: UI Object

Class: Button

Class: ListBox

Class: EditBox

Class: SliderBar

Class: Image

Menu File Format

Class: KeyStrokeObject

Class: DropdownBox

Module: Command Console

Class: CommandMgr

Class: ParsedCommand

Module: Object System

Class: Object Manager

Class: Object

Class: Movement Grid

Class: Date Time

Class: Outdoor Weather

Class: Indoor Weather

Class: Outdoor Lighting

Class: Indoor Lighting

Class: Collision Volume

Class: Physics

Class: Energy Calculator

Class: Inventory

Class: Path Finding

Class: Yeti Controller

Class: Villager Controller

Class: Static Mesh

Class: Dynamic Mesh

Class: Particle System

Module: Village Terrain

Class: VillageMgr

Class: VillageTerrainPiece

Miscellaneous Application Classes:

Class: MusicMgr

Class: SoundFXMgr

Class: FXContentMgr

Class: PathNameMgr

Class: GameTime

Key Component: Graphics

Graphic Object Lifetime

Using D3DXEffects for Rendering

Pixel Shader Targets

Rendering Loop

Module: Display Manager

Class: DisplayMgr

Module: FX Resource Manager

Class: FXResourceMgr

Class: FXResource

Module: Texture Resource Mgr

Class: TextureResourceMgr

Class: TextureResource

Class: TextureFileResource

Class: TextureHLSLResource

Class: TextureRenderTargetResource

Module: Vertex Buffer Manager

Class: VBResourceMgr

Class: VBResource

Class: DynamicVBResource

Module: Index Buffer Manager

Class: IBResource

Class: IBResource

Class: DynamicIBResource

Module: Animated Models

Class: ModelMgr

Class: ModelHandle

Class: ModelResource

Module: Text Manager

Class: TextMgr

Class: Text

Module: Scene Graph

Class: SceneMgr

Class: ObjectNode

Class: ObjectNodeHandle

Module: Render Manager

Class: RenderMgr

Module: Quad Manager

Class: QuadMgr

Class: Quad

Module: Particle Manager

Class: ParticleMgr

Class: ParticleSystemInitializer

Class: ParticleSystem

Class: Particle

Miscellaneous Graphics Classes

Class: Render To Texture

Class: FXConstant

Class: RenderableGeometry

Key Component: Audio

Class: AudioMgr

Class: AudioData

Class: AudioDataHandle

Key Component: Input

Class: InputMgr

Project Milestones

Milestone: Implement FXContent and FXConstants, FXResource, and FXObject classes

Milestone: Implement RenderableGeometry set of classes

Milestone: Implement RenderMgr

Milestone: Implement a Procedural Texturing and Modeling Library

Milestone: Village Terrain

Milestone: Village Object Placement

Milestone: Village Lighting

Milestone: Village Terrain Texturing

Milestone: Ice Reflection Graphics Effect

Milestone: Model Loading and Texturing

Milestone: Model Animation

Milestone: Model Instancing

Milestone: Particle Management Framework

Milestone: Particle Drawing

Milestone: Particle Functionality Definitions

Milestone: Particle System Definitions

Milestone: Scene Manager

Milestone: GameMgr Structure

Milestone: UI Structure

Milestone: UI Parsing

Milestone: UI Objects

Milestone: GameMgr Finale

Milestone: UI Finale

Milestone: UI Templates

Milestone: Dropping Items

Milestone: Burning Items

Milestone: Grill and Melt Items

Milestone: Time System

Milestone: Weather System

Milestone: Dispense Items

Milestone: Energy System

Milestone: Collision

Milestone: Path Finding

Milestone: Villager Survival

C++ Source Code Syntax Rules

HLSL and FX Source Code Syntax

Menu Skin Specification

Development Team

Name / Title / Development Tasks
Ryan Juckett / Designer / AI and Game Objects
Lewis Mohr / Product Manager / Graphics, Scene Graph, and User Interface
Gilberto Rosado / Technical Director / Graphics, Terrain, and Render Manager
Alexander Van Berg / Producer / Graphics, Audio, Input, Text, Models

Signatures

Ryan Juckett ______

Gilberto Rosado ______

Lewis Mohr ______

Alexander Van Berg ______

Villager Kisses: Game Overview

High Concept

Villager Kisses is a social strategy game in which the user must physically persevere and socially flourish in a villager community.

Target Audience and Rating

Villager Kisses has a target audience of teenage males and females. Its focus on social interaction will help it appeal to both of the sexes. Similar to the target audience, Villager Kisses has a target rating of “Teen” due to its potentially more mature implications.

Game Play

You, an ordinary everyday Villager, have been appointed by Kisskimo, the Villager cupid, to spread joy throughout your village. It is your mission to maintain as many friendships as possible with your fellow village members, and you have luckily been promised rewards for showing progress in this task. At first, it seems that it should be easy enough to be friendly and nice to your neighbors, but you soon learn that they are not fond of sharing your friendship with others. Their jealousy runs deep into the village’s social network and you are only able to achieve your goal through spreading lies and manipulating your friends.

While you may be cold hearted enough to take advantage of others, you definitely don’t have much time to do so. There is so much to be done during the day in order stay healthy, and without your health, there will be no one willing to talk to you. Constantly getting hungry and thirsty, you must cook above the fire at home, but what are you to cook? Only by gathering wood to start a fire and finding some fish to cook over it, can you satisfy your need for food. You probably also need to grab some snow for melting while you are out, but if you stay outside too long in a storm you might freeze. You may fear the cold at first, but it’s the yetis that thrive in the wilderness that will truly scare you away.

Having once lived the simple Villager life, it will take time to adjust to your new situation. Once working to survive alone, and perhaps maintain a friendship here and there, you now must support yourself and as many friends as possible. You can only hope that the rewards you receive as you progress up the ranks of society will allow you impress you friends with fancy presents and a fresher look of health on your face.

System Requirements

Minimum System Requirements

  • Operating System: Windows 98/ME/2000/XP
  • Video: NVIDIA GeForce 2 or ATI Radeon 7500 with 32MB VRAM
  • Processor: 1GHZ Intel Pentium or AMD Athlon
  • Memory: 128MB
  • Hard Drive Space: 60MB free hard disk space
  • Audio: Windows compatible sound card
  • DirectX: DirectX 9 runtime and video card drivers

Recommended System Requirements

  • Operating System: Windows 2000/XP
  • Video: ATI Radeon 8500/9600/9800 or NVIDIA GeForce 4 TI 4200/FX 5900
  • Processor: 1.8 GHZ Intel Pentium or AMD Athlon XP 1700+
  • Memory: 256MB
  • Hard Drive Space: 60MB free hard disk space
  • Audio: Windows compatible sound card
  • DirectX: DirectX 9 runtime and video card drivers

3rd Party Technologies

DirectX 9

Creator:Microsoft

Available at:

Usage:The game’s 3D renderer will be based on Direct3D9. The D3DX9 library will be used extensively for vertex and pixel shaders using Microsoft’s High Level Shading Language (HLSL), and mesh animation.

DirectInput8 will be used for keyboard and mouse user controls.

FMOD

Creator:Firelight Technologies

Available at:

Usage:FMOD is a platform independent audio engine. It supports 3d sound, midi, mods, mp3, ogg vorbis, wma, aiff, recording, obstruction/occlusion, cd playback, mmx, internet streaming, dsp effects, spectrum analysis, user created samples and streams, synchronization support, ASIO, EAX 2&3.

Game Code Overview

Code Dependency Layers

The code project for Villager Kisses has three layers of dependencies. The bottommost layer is composed of the sub-systems, a collection of common code dealing with data containers, memory management, math classes, and general helper code. The second layer consists of the Graphics, Audio, and Input systems. These systems are designed to be generic and are not meant to have any game-specific code. The third and topmost layer is the Application layer. The Application layer consists of all game-specific code including game-play, artificial intelligence, and game objects.

Figure 1: The Relationship between the main code components.

Villager Kisses Sub-Systems

The Villager Kisses Sub-Systems are a collection of helper classes and functions in the project. These classes are available for use to any part of the game project, and their usage is encouraged to help unify the coding styles and implementations of the different programmers in the project.

Use of the C++ Standard Template Library (STL) is also strongly encouraged to be used by the programmers of the Villager Kisses project. The STL defines many ready to use containers and algorithms. Documentation on the STL can be found in the MSDN library, the Internet, and countless C++ books.

Class: AutoList

Description:The AutoList design pattern is used when a list of all instances of a class is desired. If a class inherits from AutoList, all instances of that class are inserted to the list as they are created, and are removed when they are destroyed.

Public Interface:

Function Names / Description
GetAutoListBegin / Returns an iterator to the first element of the list.
GetAutoListEnd / Returns the end iterator of the list.
GetAutoListCount / Returns the number of elements in the list.

Usage: A class that desires AutoList functionality inherits from the AutoList class. For example:

class ListMe : public TAutoList< ListMe >

{

};

When a user wishes to iterate through all instances of the ListMe class, they ask for the Begin and End iterators.

//get begin iterator

list<ListMe*>::type::iterator it_beg =

AutoList<ListMe>::GetAutoListBegin( );

//get end iterator of all of the windows

SS::list<ListMe*>::type::iterator it_end =

AutoList<ListMe>::GetAutoListEnd( );

SS::list<ListMe*>::type::iterator it;

//for all of instances

for(it = it_beg ; it != it_end; ++it)

{

}

Class: Singleton

Description: The Singleton design patter is used when there should only be one instance of a class.

In this implementation the user can get a reference to the Singleton object by calling the static Get( ) Function.

Public Interface:

Function Names / Description
Initialize / Creates the Singleton.
Unintialize / Destroys the Singleton.
Is_Initialized / Returns true if the Singleton is currently initialized.
Get / Returns a reference to the Singleton.

Usage: To create a Singleton class, derive from Singleton. For example:

Class MakeMeSingleton: public Singleton<MakeMeSingleton>

{

};

Class: Handle

Description: Handles are used when more than one pointer needs to reference the same object. By using handles, the user need not worry about deleting the memory it is referencing because once the referenced object’s internal reference count reaches zero, it will automatically be deleted.

In the Villager Kisses project, the handle class is used in conjunction with the HandleRef class. See the documentation of the HandleRef class for an example of using the Handle and HandleRef classes.

Note:

In this document, when it is mentioned that a Handle is being used or passed back from a function, it is assumed that it’s an object derived from the Handle class.

Requirements:

  • Must properly interact with the referenced object to keep the correct referenced count.
  • Must overload the appropriate copying operator and constructors to ensure the proper reference count at all times.

Public Interface:

Function Names / Description
Is_Valid / Returns true if the handle is currently referencing an object.
Relase / Releases the handle, decreases the reference count of the object formerly being reference.
Reference / Sets the object being referenced by the handle.

Implementation Details: The Handle class may only reference objects that derive from the HandleRef class.

Class: HandleRef

Description: Classes of objects that need to be referenced counted should derive from the HandleRef template class. HandleRef objects are referenced by objects derived from Handle.

Requirements:

  • Must properly keep track of its reference count

Public Interface:

No public interface

Usage:

A class that needs to be referenced is defined in the following manner:

class ReferenceMe : public HandleRef<ReferencedMe>

{

};

The corresponding Handle class is defined as shown below:

class HandleToReferenceMe : public Handle<ReferenceMe>

{

}

The handle is used as follows:

HandleToReferenceMe handle;

handle.Reference( new ReferenceMe ); //get a handle

//do stuff with handle

handle.Release( ); //done using the handle, release it

Class: RandomNumberGenerator

Description: RandomNumberGenerator serves as a base class for classes implementing random number algorithms. Several child classes are implemented in the project.

Requirements:

  • Separate instances of RandomNumberGenerator classes must provide separate streams of numbers. Specifically, getting a random number from one object should not affect the next random number returned from another object.

Public Interface:

Function Names / Description
Seed / Seeds the random number generator algorithm.
Rand / Returns a random number.

Key Component: Game Application

Description: The Game application component implements game specific features. Modules in the Game Application include the GameMgr, which is responsible for transitioning the game from the title-screen to the menus and then to the actual gameplay.

Modules:

  • Game Manager
  • User Interface
  • Command Console
  • Object System
  • Village Terrain

Module: Game

Description: Handles the more general aspects of the game, such as state changes, loading screens, etc.

Dependencies: Not directly dependant on any modules, but will be calling functions from several modules, including the ObjectMgr.

Classes:

  • Game Manager

Class: GameMgr

Module: Game Manager

Description: Handles state transitions between menus and game.

Requirements: Handle state transitions between menus and game.

Public Interface:

Function Names / Description
Update / Update all active modules in the current state.
Render / Render all active modules in the current state.

Implementation Details: The GameMgr is a state machine with 3 major states, Intro, Menus, and Game. Each one of these has 3 minor states, Loading, Normal, and Exiting. As of the current design, this would use a flexible coded design using function pointers or derived classes.

Module: User Interface

Description: Load up scripted menu files to display the user interface in the game. Functionality will be included in the script files, as strings to be executed through the Command Manager.

In the event that executing commands through the CommandMgr is not sufficient for our purposes, it is designed such that adding specific derived types is very easy.

Dependencies: Command Manager, Quad Manager

Classes:

  • MenuMgr
  • UI Object
  • Button
  • ListBox
  • EditBox
  • SliderBar
  • Image
  • Keystroke
  • DropdownBox

Class: MenuMgr

Module: User Interface

Description:

Requirements: Load, Update and Draw menus.

Public Interface:

Function Names / Description
LoadMenuTree / Load up the descriptor file, and a menu file, and recursively load up all referenced menus in that file.
Update / Update the active menu.
Draw / Draw the active menu.
Set/GetActiveObject / Gets/Sets a Boolean as to whether or not there is an active object. Used primarily for edit boxes and dropdown boxes to avoid conflicts with other objects in the menu.

Implementation Details: The script files look similar to XML, each object is delimited by angle brackets, and each object block starts with the type of the object. Please see the Menu File Format specification section for more details.

The system for active objects allows multiple objects to be active at a given time, but this is mainly so that objects can be constantly active, such as the mouse cursor, or something animating. In general, there will only be one active object that can be directly interacted with.

Class: UI Object

Module: User Interface

Description: An abstract base class for all UI Objects.

Requirements: Allow Update and Render to be called on this object.

Public Interface:

Function Names / Description
Update / Pure Virtual.
Render / Pure Virtual.
SetAsActiveObject / Sets a Boolean that this object is active.
IsActiveObject / Retrieves the Boolean as to whether or not this object is active.

Class: Button

Module: User Interface

Description: A simple click-to-use button.

Requirements: Highlight when moused-over, depress when clicked, activate when released.

Public Interface:

Function Names / Description
Update / Update the logic for this object.
Draw / Draw this object to the screen.

Implementation Details: The button stores a list of strings to be executed in the CommandMgr when the button is activated, as well as a string with a CommandMgr command executed to gain the new value to update itself with.

The button class contains four Image UI Objects.

State Machine:

Disabled:

Button is grayed out.

No Events

Normal:

MouseOver  Highlighted

Highlighted:

Button changes appearance to become brighter, etc.

MouseDown  Selected

!MouseOver  Normal

Selected:

Button changes appearance to become pressed.

!MouseOver  Normal

!MouseDown  Execute String Data  Normal

Class: ListBox

Module: User Interface

Description: ListBox is derived from UI Object, and contains a SliderBar object.

Requirements: Allow the user to select from a scrollable list of items.

Public Interface:

Function Names / Description
Update / Update the logic for this object.
Draw / Draw this object to the screen.

Implementation Details: Contains 3 Image UI Objects

State Machine:

Disabled:

No events

Normal:

MouseOver Highlighted

Highlighted:

Active item is highlighted, moused-over item is highlighted in different color.

!MouseOver  Normal

MouseDown  Selected

Selected:

Only the moused-over item is highlighted.

!MouseOver  Normal

!MouseDown  Set var to current value.  Normal