DOC

Project_Zeit_TDD

By Frank Grant,2014-05-13 06:33
9 views 0
Project_Zeit_TDD

    Project Zeit

    Team Skettios

    Version 1.0

    10-1-04

    GAM400A-F04

    Instructor: Mike Moore

    Designer: Aaron Wolak

    email: awolak@digipen.edu

    Producer: Jonas Holderman

    Technical Director: Dak Babcock

    Product Manager: Chris Plummer

    All contents copyright ? 2004, DigiPen (USA) Corporation. All rights reserved.

Project Zeit, Team Skettios, GAM400A-F04

    1. Contents

    Project Zeit .................................................................................................................... 1

    1. Contents ................................................................................................................. 2

    2. Revision History..................................................................................................... 6

    2.1 10/14/2003 v.1 ................................................................................................. 6 2.2 10/12/2003 v.06 ............................................................................................... 6 2.3 10/5/2004 v.01 ................................................................................................. 7 3. Project Overview ................................................................................................... 7

    3.1 Game Concept ................................................................................................. 7 3.2 Technical Goals ............................................................................................... 7

    3.3 Target Platform ................................................................................................ 7

    3.3.1 Operating System ..................................................................................... 7

    3.3.2 General Hardware Requirements .............................................................. 7

    3.3.3 Specific Hardware Requirements.............................................................. 7 3.4 Development Platform ..................................................................................... 8

    3.4.1 Software ................................................................................................... 8

    3.4.2 Hardware ................................................................................................. 8 3.5 Timeline and Milestones .................................................................................. 8 3.6 Risks ................................................................................................................ 9 4. Game Physics and Collisions ................................................................................. 9

    4.1 Physics............................................................................................................. 9

     4.1.1 Rigid Body ............................................................................................. 10

    4.1.1.1 Class .................................................................................................. 10

    4.1.1.2 Methods ............................................................................................. 10

    4.1.2 PhysicsEngine ........................................................................................ 11

    4.1.2.1 Class .................................................................................................. 11

    4.1.2.2 Methods ............................................................................................. 11 4.2 Collision Detection ........................................................................................ 12

     4.2.1 Procedure ............................................................................................... 13

    4.2.1.1 Radius Comparisons ........................................................................... 13

    4.2.1.2 Big Box Collision Detection ............................................................... 13

    4.2.1.3 Small Box Collision Detection ........................................................... 13

    4.2.1.4 Calculating Small Boxes..................................................................... 13

    4.2.2 Special Cases ......................................................................................... 13

    4.2.2.1 Super-Fast Moving Objects ................................................................ 13

    4.2.2.2 Ray Collisions .................................................................................... 14

    4.2.3 CCollidableObject .................................................................................. 14 5. Artificial Intelligence ........................................................................................... 15

    5.1 City Environment ........................................................................................... 15

    5.1.1 Traffic .................................................................................................... 15

    5.1.1.1 Road Nodes ........................................................................................ 15

    5.1.1.2 Steering and Speed ............................................................................. 15

    5.1.1.3 Object Avoidance ............................................................................... 16 All contents copyright ? 2004, DigiPen (USA) Corporation. All rights reserved. 2

    Project Zeit, Team Skettios, GAM400A-F04

    5.1.1.4 Lane Changing ................................................................................... 17 5.1.1.5 Intersections ....................................................................................... 17

    5.1.1.6 Path Realignment ............................................................................... 17 5.1.1.7 Car Pool ............................................................................................. 18

    5.1.1.8 Area Limits ........................................................................................ 18 5.1.1.9 Driving Routes ................................................................................... 19 5.1.1.10 Math ............................................................................................... 19

    5.1.2 Pedestrians ............................................................................................. 19 5.1.2.1 Sidewalk Nodes .................................................................................. 19

    5.1.2.2 Roaming ............................................................................................. 19 5.1.2.3 Object Avoidance ............................................................................... 20 5.1.2.4 Pedestrian Pool ................................................................................... 20

    5.1.2.5 Area Limits ........................................................................................ 20 5.1.3 Car Chases/Getaways ............................................................................. 21

    5.1.3.1 Chase AI ............................................................................................ 21

    5.1.3.1.1 Tracking Nodes ............................................................................ 21

    5.1.3.1.2 Object Avoidance ......................................................................... 21 5.1.3.2 Escape AI ........................................................................................... 21

    5.1.3.2.1 Detection Nodes ........................................................................... 21

    5.1.3.2.2 Object Avoidance ......................................................................... 22

     5.1.3.2.3 Driving Routes ............................................................................. 225.1.4 Patrol ..................................................................................................... 22 5.1.4.1 Paths .................................................................................................. 22 5.1.4.2 Tracking Nodes .................................................................................. 22 5.1.4.3 Visibility ............................................................................................ 23 5.1.4.4 Breadcrumb Nodes ............................................................................. 23 5.1.5 Gunfights ............................................................................................... 23

     5.1.5.1 Shooting ............................................................................................. 235.1.5.2 Shooting Visibility ............................................................................. 24 5.1.5.3 Protection ........................................................................................... 24 5.2 Scripting ........................................................................................................ 24 5.2.1 LuaPlus .................................................................................................. 24 5.2.1.1 Thread Manager ................................................................................. 25 5.3 References ..................................................................................................... 27

    6. Code Overview ..................................................................................................... 27

    6.1 Coding Standards: .......................................................................................... 27 6.1.1 Comments .............................................................................................. 27 6.1.2 File Structure.......................................................................................... 27 6.1.3 CPP Module Structure ............................................................................ 28 6.1.4 Class Header .......................................................................................... 29 6.1.5 Function Header ..................................................................................... 29 6.1.6 Global Constants .................................................................................... 30 6.1.7 Basic Types ............................................................................................ 30 6.1.8 Variable Nomenclature ........................................................................... 30 6.1.9 Function and Method Nomenclature ....................................................... 31 6.1.10 Pointers vs. References .......................................................................... 31

    All contents copyright ? 2004, DigiPen (USA) Corporation. All rights reserved. 3

    Project Zeit, Team Skettios, GAM400A-F04

    6.1.11 Whitespace, Indenting, and Braces ......................................................... 31 6.1.12 Breaking Statements up onto Multiple Lines .......................................... 33

    6.1.13 Preprocessor Use .................................................................................... 34 6.1.14 Programming Guidelines ........................................................................ 34

    6.1.15 Use of Variable Types ............................................................................ 35 6.1.16 Prefix vs. Postfix ................................................................................... 35 6.1.17 Header Files ........................................................................................... 35

    6.1.18 Passing by Reference vs. Passing by Value............................................ 35 6.1.19 Floating Point Math ................................................................................ 35

    6.1.20 Class Design .......................................................................................... 35 6.1.21 Build Releases ........................................................................................ 37 6.1.22 Code Review .......................................................................................... 37

    6.2 Control Loop ................................................................................................. 37 6.3 Message Handler............................................................................................ 38

    6.4 External Code ................................................................................................ 38 6.4.1 DirectX 8.1 ............................................................................................ 38 6.4.2 Display ................................................................................................... 38 6.4.3 Render States ......................................................................................... 38

    6.4.3.1.1 Methods........................................................................................ 38 6.4.4 CDisplayMesh3D ................................................................................... 39

     6.4.4.1 Class .................................................................................................. 396.4.4.2 Variables ............................................................................................ 39 6.4.4.3 Methods ............................................................................................. 39 6.4.5 CDisplayObject3D ................................................................................. 40 6.4.5.1 Class .................................................................................................. 40 6.4.5.2 Variables ............................................................................................ 40 6.4.5.3 Methods ............................................................................................. 40

     6.4.6 CComplex Object ................................................................................... 416.4.6.1 ................................................................................................................ 42 6.4.7 Skybox ................................................................................................... 42 6.4.7.1 Class .................................................................................................. 42 6.4.7.2 Methods ............................................................................................. 43 6.4.8 CEffect ................................................................................................... 43 6.4.9 Particle Engine System ........................................................................... 43 6.4.9.1 Class .................................................................................................. 43 6.4.9.2 Methods ............................................................................................. 44 6.4.10 3DAnimation ......................................................................................... 44 6.4.11 Billboarded Sprites ................................................................................. 44 6.4.12 CTimer ................................................................................................... 44 6.4.13 Sound ..................................................................................................... 45 6.4.13.1 Methods ......................................................................................... 45 6.4.14 SFX3D ................................................................................................... 46 6.4.14.1 Class ............................................................................................... 46 6.4.14.2 Methods ......................................................................................... 46 6.4.15 Input ...................................................................................................... 47 6.4.16 Text Output ............................................................................................ 47

    All contents copyright ? 2004, DigiPen (USA) Corporation. All rights reserved. 4

Project Zeit, Team Skettios, GAM400A-F04

    6.4.16.1 FontLook2D ................................................................................... 47

    6.4.16.2 CTextMaster ................................................................................... 47

    6.4.17 CLogFile ................................................................................................ 47 6.4.18 File Parsing ............................................................................................ 47

    6.4.19 CDataBuffer ........................................................................................... 48 6.4.20 Console .................................................................................................. 48

    6.4.20.1 Class ............................................................................................... 48

    6.4.20.2 Methods ......................................................................................... 48 6.4.21 STL ........................................................................................................ 49

    7. Code Objects ........................................................................................................ 49

    7.1 LevelObjects .................................................................................................. 49 7.2 Road Nodes ................................................................................................... 49

    7.2.1 Class ...................................................................................................... 49 7.2.2 Methods ................................................................................................. 50

    7.3 TrafficLight ................................................................................................... 50 7.3.1 Class ...................................................................................................... 50 7.3.2 Methods ................................................................................................. 51 7.4 Conversations ................................................................................................ 51 7.4.1 Conversation Manager ........................................................................... 51 7.4.2 Conversation .......................................................................................... 54

     7.5 Cell Phone ..................................................................................................... 587.5.1 Phone Directory ..................................................................................... 58 7.5.2 Phone Directory File Format: ................................................................. 59 7.5.3 Cell Phone .............................................................................................. 59 7.5.4 File Format: ........................................................................................... 62 7.6 Terrain ........................................................................................................... 62 7.6.1 CTerrainObject ...................................................................................... 62

     7.6.2 CTerrainPatchObject .............................................................................. 637.7 Mission Object ............................................................................................... 64 7.8 CHeat ............................................................................................................ 65 7.9 CHUD ........................................................................................................... 65 7.10 Weapon ......................................................................................................... 65 7.10.1 Variables ................................................................................................ 66 7.10.2 Methods ................................................................................................. 66 7.11 Projectile........................................................................................................ 66 7.11.1 struct ProjectileStage .............................................................................. 66 7.11.2 CProjectile ............................................................................................. 66 7.11.3 Variables ................................................................................................ 67 7.12 CCinema ........................................................................................................ 67 8. Game Object File Formats .................................................................................. 67

    8.1 In Game Asset Managment ............................................................................ 67 8.1.1 CAsset.................................................................................................... 68

    8.1.1.1 Variables ............................................................................................ 68

    8.1.1.2 Methods ............................................................................................. 68

    8.1.1.3 AssetType .......................................................................................... 68 8.1.2 CAssetManager ...................................................................................... 69 All contents copyright ? 2004, DigiPen (USA) Corporation. All rights reserved. 5

Project Zeit, Team Skettios, GAM400A-F04

    8.1.2.1 Variables ............................................................................................ 69

    8.1.2.2 Methods ............................................................................................. 69

    8.2 File Types ...................................................................................................... 69

    8.2.1 Text Bases .............................................................................................. 69

    8.2.2 Textures ................................................................................................. 69

    8.2.3 Meshes And Mesh Animations ............................................................... 70

    8.2.4 Sound File Formats ................................................................................ 70

    8.2.5 Config File Format ................................................................................. 70 9. Game Flow ........................................................................................................... 70

    10. User Interface................................................................................................... 71

    10.1 Title Screen .................................................................................................... 71 10.2 Option Select Menu ....................................................................................... 71

    10.3 Display Option Menu ..................................................................................... 72 10.4 Sound Options Menu ..................................................................................... 72

    10.5 Controls Menu ............................................................................................... 73 10.6 In Game Main Menu ...................................................................................... 74 10.7 Load Menu .................................................................................................... 74 10.8 Save Menu ..................................................................................................... 75 11. Art and Video ................................................................................................... 75

    11.1 Weapon Models ............................................................................................. 75

     11.2 Car Models .................................................................................................... 7611.3 Misc. Models ................................................................................................. 76 11.4 Character Models ........................................................................................... 76 11.5 Character Animations .................................................................................... 76 12. Sound and Music.............................................................................................. 77

    12.1 Music ............................................................................................................. 77

    12.2 Sound Effects ................................................................................................. 77 13. Installer ............................................................................................................ 77

2. Revision History

    2.1 10/14/2003 v.1

    ; Major revision

    2.2 10/12/2003 v.06

    ; Updated Formatting

    ; Added in missing sections for other team members

All contents copyright ? 2004, DigiPen (USA) Corporation. All rights reserved. 6

Project Zeit, Team Skettios, GAM400A-F04

    2.3 10/5/2004 v.01

    ; Began TDD

3. Project Overview

    3.1 Game Concept

    Jimmy Farmon has been chosen to travel through time to change the world‟s future in this

    new 3D action adventure game.

    3.2 Technical Goals

    Our technical goal is to create a fun 3D game. Our motto is simple program with complex

    results. We want to have a flexible 3D engine that supports AI, 3D objects and 3D object

    animations, simple input management, and 3D sound. Basically we want to create a product that shows we are competent enough to get a job in the industry.

    3.3 Target Platform

    3.3.1 Operating System

    Windows NT/XP

    3.3.2 General Hardware Requirements

     PC with 1 GHz or equivalent processor

     64 Megs DirectX 3D accelerator

     50 Megs system memory

     256 Megs RAM

     DirectSound compatible sound card (for sound)

     Keyboard/Mouse

     Monitor

     CD ROM Drive

     LAN connection (required for internet play)

     Speakers (required for sfx)

    3.3.3 Specific Hardware Requirements

     Motherboard running at100 MHz front side bus or greater

     12x CD ROM drive

     32 Megs PC100 or faster memory

     AGP Video Card

     5200 rpm HDD w/ 2 megs or greater cache

     10BaseT LAN or better.

    All contents copyright ? 2004, DigiPen (USA) Corporation. All rights reserved. 7

    Project Zeit, Team Skettios, GAM400A-F04

     Stereo or Surround Sound video card with support for 32 voices or

    more (for sfx only)

     DirectX 8.1 runtime

    3.4 Development Platform

    3.4.1 Software

     Microsoft Windows XP Pro

     Microsoft Visual C++ .Net 2003

     Microsoft Office XP Pro

     Discrete 3D Studio Max 5.1

     GIMP

    3.4.2 Hardware

     PC meeting Target Platform requirements

    3.5 Timeline and Milestones First Engine Proof 11/15/2004 Graphics Engine 99%

    Sound Engine 98%

    Input 98%

    Special Effects 35%

    Artificial Intelligence 40% User Interface 40%

    Game Features 10%

    2D Graphics Assets 50%

    3D Graphics Assets 45%

    Sound Assets 20%

    First Playable 12/6/2004 Graphics Engine 100%

    Sound Engine 100%

    Input 100%

    Special Effects 55%

    Artificial Intelligence 70% User Interface 75%

    Game Features 45%

    2D Graphics Assets 70%

    3D Graphics Assets 60%

    Sound Assets 50%

Alpha 2/7/2005

    All contents copyright ? 2004, DigiPen (USA) Corporation. All rights reserved. 8

Project Zeit, Team Skettios, GAM400A-F04

    Graphics Engine 100%

    Sound Engine 100%

    Input 100%

    Special Effects 75%

    Artificial Intelligence 100%

    Networking 100%

    User Interface 85%

    Game Features 95%

    2D Graphics Assets 80%

    3D Graphics Assets 80%

    Sound Assets 80%

    Beta 4/7/2005

    All 100%, polish and bug fixes only.

    Gold 5/14/2005

    Final.

    3.6 Risks

    Performance

    A potential technical risk is the overall performance of the graphics engine. We

    have many models to draw for any given frame given the nature of our city based

    environments. However, our team is confident that any problems can be

    overcome.

    Content

    A potential technical risk is the overall amount of content our game calls for. 4. Game Physics and Collisions

    4.1 Physics

    The physics code for the game is going to have to support all necessities for car physics and combine it with a rigid body system for all the other objects that can be moved in the world. The rigid body physics will support collision between two rigid bodies and also resting contact between two rigid bodies. The physics is accomplished using a Rigid Body class that keeps track of an objects mass, momentum, angular momentum, position, and orientation. The class allows for objects in the world to be moved by applying forces to them or by modifying there velocities and momentums directly. The rigid bodies update positions, velocities and the likes using an implementation of Runge-Kutta‟s

    Fourth order differential equation solver. The rigid bodies are managed with a class that is called the Physics Engine. The Physics Engine is in charge of determining what to do All contents copyright ? 2004, DigiPen (USA) Corporation. All rights reserved. 9

    Project Zeit, Team Skettios, GAM400A-F04 when two rigid bodies collide. It also updates the rigid bodies that have been registered

    with it. The cars in the game will apply forces to there rigid bodies to get them to move.

    4.1.1 Rigid Body

    The rigid body portion of the physics is a class that contains all of the data needed to

    manage and manipulate an object in 3d space.

    4.1.1.1 Class

    class RigidBody

    {

    public:

    RigidBody();

    ~RigidBody();

    //Typical functions for getting and setting member variables

    .

    .

    .

    bool ParseKeywords( CDataBuffer * pDataBuffer );

    void AppendExternalForce(D3DXVECTOR3 *extForce);

    void AppendExternalTorque(D3DXVECTOR3 *extTorque);

    void Update();

private:

    D3DXVECTOR3 Force(float t, float mass, D3DXVECTOR3 *X,

     D3DXQUATERNION *Q, D3DXVECTOR3 *P, D3DXVECTOR3 *L,

     D3DXMATRIX *R, D3DXVECTOR3 *V, D3DXVECTOR3 *W);

    D3DXVECTOR3 Torque(float t, float mass, D3DXVECTOR3 *X,

     D3DXQUATERNION *Q, D3DXVECTOR3 *P, D3DXVECTOR3 *L,

     D3DXMATRIX *R, D3DXVECTOR3 *V, D3DXVECTOR3 *W);

    float m_mass,m_invMass;

    D3DXMATRIX m_inertia,m_invInertia;

    D3DXVECTOR3 m_X; //Position

    D3DXQUATERNION m_Q; //Orientation

    D3DXVECTOR3 m_P; //Linear Momentum

    D3DXVECTOR3 m_L; //Angular Momentum

    D3DXMATRIX *m_R; //Orientation Matrix

    D3DXVECTOR3 m_V; //Linear Velocity

    D3DXVECTOR3 m_W; //Angular Velocity

    D3DXVECTOR3 m_kExternalForce, m_kExternalTorque;

     D3DXVECTOR3 m_kInternalForce, m_kInternalTorque; };

    4.1.1.2 Methods

    ParseKeywords: Reads data about the Rigid Body from a file.

All contents copyright ? 2004, DigiPen (USA) Corporation. All rights reserved. 10

Report this document

For any questions or suggestions please email
cust-service@docsford.com