1 game project development 王銓彰 ● 王俊堯. 2 game platform game platform game types game...

58
1 Game Project Game Project Development Development 王王王 王王王 王王王 王王王

Upload: hubert-foster

Post on 30-Dec-2015

242 views

Category:

Documents


7 download

TRANSCRIPT

Page 1: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

1

Game ProjectGame Project

DevelopmentDevelopment

王銓彰 王銓彰 ● ● 王俊堯王俊堯

Page 2: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

2

Game platformGame platform Game typesGame types Game teamGame team Game development pipelineGame development pipeline Game software systemGame software system ToolsTools

Introduction to Game DevelopmentIntroduction to Game Development

Page 3: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

3

PC is designed for office application.PC is designed for office application. Not for entertainment purposeNot for entertainment purpose A virtual memory systemA virtual memory system

– Unlimited system memoryUnlimited system memory But video memory is limited.But video memory is limited.

– For frame buffers, z buffers, textures, vertices, …For frame buffers, z buffers, textures, vertices, … PCI/AGP might be a problem for performance.PCI/AGP might be a problem for performance. Open architectureOpen architecture

– Hardware driver versionHardware driver version– Different capabilitiesDifferent capabilities– Different performanceDifferent performance

Compatibility test is important.Compatibility test is important. Development is easy to setup.Development is easy to setup.

– Visual C/C++ with DirectXVisual C/C++ with DirectX

Game Development on PCGame Development on PC

Page 4: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

4

Specific hardware designed for gamesSpecific hardware designed for games Single user OSSingle user OS Single process OSSingle process OS No hard disk drive (?)No hard disk drive (?) Closed systemClosed system Native coding environmentNative coding environment

– Proprietary SDKProprietary SDK– Hardware related featuresHardware related features– C language with assemblyC language with assembly

Limited resourcesLimited resources– Memory for everythingMemory for everything

» 32M for PS232M for PS2» 64M for Xbox64M for Xbox

One console runs, the others do !One console runs, the others do ! Use gamepad and no keyboardUse gamepad and no keyboard

Game Development for ConsolesGame Development for Consoles

Page 5: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

5

RPG (Role playing games)RPG (Role playing games) AVG (Adventure games)AVG (Adventure games) RTS (Real-time strategy games)RTS (Real-time strategy games) FPS (First-person shooting games)FPS (First-person shooting games) RSLG (RSLG ( 戰棋戰棋 )) SimulationSimulation SportsSports ActionAction Puzzle gamesPuzzle games Table gamesTable games MMORPGMMORPG

– Massive Multiple Player Online Role Playing GamesMassive Multiple Player Online Role Playing Games

Game TypesGame Types

Page 6: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

6

開發團隊開發團隊– 製作人製作人– 執行製作人執行製作人– 企劃團隊企劃團隊– 程式團隊程式團隊– 美術團隊美術團隊

行銷業務團隊行銷業務團隊– 產品經理產品經理 (PM)(PM)

測試團隊測試團隊 遊戲審議委員會遊戲審議委員會 遊戲經營團隊遊戲經營團隊

– 線上遊戲 線上遊戲 game master (GM)game master (GM)– Customer servicesCustomer services– MISMIS

Game Team MembersGame Team Members

Page 7: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

7

Team Leader (usually)Team Leader (usually) 資源管理 資源管理 ((Resource management)Resource management) 行政管理 行政管理 ((Administration)Administration) 專案管理 專案管理 ((Project management)Project management) 向上負責 向上負責 ((Upward management)Upward management) 團隊的決策團隊的決策 風險管理風險管理

Game Producer Game Producer 遊戲製作人遊戲製作人

Page 8: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

8

專案管理執行專案管理執行 Daily Daily 運作運作

– House keepingHouse keeping– Meeting coordinatorMeeting coordinator– Schedule checkingSchedule checking– Cross-domain communicationCross-domain communication

Usually not a full-time job positionUsually not a full-time job position– A position for training and becoming a producerA position for training and becoming a producer

遊戲執行製作人遊戲執行製作人

Page 9: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

9

故事設計 故事設計 ((Story telling)Story telling) 腳本設計 腳本設計 ((Scripting)Scripting) 玩法設計 玩法設計 ((Game play design)Game play design) 關卡設計 關卡設計 ((Level design)Level design) 遊戲調適 遊戲調適 ((Game tuning)Game tuning) 數值設定 數值設定 ((Numerical setup)Numerical setup) AI AI 設計 設計 ((Game AI design)Game AI design) 音效設定 音效設定 ((Sound FX setup)Sound FX setup) 場景設定 場景設定 ((Scene setup)Scene setup) Game document writingGame document writing Game quality checkingGame quality checking

遊戲企劃遊戲企劃

Page 10: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

10

Visual setup for game designVisual setup for game design– 2D setup2D setup– 3D setup3D setup

Graphics design and productionGraphics design and production– 場景 場景 ((Terrain)Terrain)– 人物 人物 ((Character)Character)– 建模 建模 ((Models)Models)– 材質 材質 ((Textures)Textures)– 動作 動作 ((Motion / Animation)Motion / Animation)– 特效 特效 ((FX)FX)– User InterfaceUser Interface

遊戲美術遊戲美術

Page 11: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

11

遊戲程式 遊戲程式 ((Game Program) Game Program) 撰寫撰寫 遊戲開發工具 遊戲開發工具 ((Game Tools) Game Tools) 開發開發

– Level editorLevel editor– Scene editorScene editor– FX editorFX editor– Script editorScript editor– Game editorGame editor

遊戲遊戲 Data exporters from 3D animation SoftwareData exporters from 3D animation Software– 3dsMax / Maya / Softimage3dsMax / Maya / Softimage

Game engine developmentGame engine development Game technique researchGame technique research Online game server developmentOnline game server development

遊戲程式遊戲程式

Page 12: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

12

Basic Procedures for Game Development

Idea Proposal Production IntegrationTesting

Debug Tuning

ConceptApproval

Prototype Pre-alpha Alpha Beta Final

發想 發想 ((Idea)Idea) 提案 提案 ((Proposal)Proposal) 製作 製作 ((Production)Production) 整合 整合 ((Integration)Integration) 測試 測試 ((Testing)Testing)

– 除錯 除錯 ((Debug)Debug)– 調適 調適 ((Tuning)Tuning)

> Concept approval

> 雛形 (prototype)

> Pre-alpha

> Alpha

> Beta

遊戲開發流程遊戲開發流程

Page 13: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

13

遊戲類型 遊戲類型 ((Game types)Game types) 遊戲世界觀 遊戲世界觀 ((Game world)Game world) 故事 故事 ((Story)Story) 遊戲特色 遊戲特色 ((Features)Features) 遊戲玩法 遊戲玩法 ((Game play)Game play) 遊戲定位 遊戲定位 ((Game product positioning)Game product positioning)

– Target playerTarget player– Marketing segmentation / positioningMarketing segmentation / positioning

競爭對手評估競爭對手評估 風險評估 風險評估 ((Risk)Risk)

– SWOT (Strength/Weakness/Opportunity/Threat) SWOT (Strength/Weakness/Opportunity/Threat) 分析分析 產出物產出物

– Concept Design Document (CDD)Concept Design Document (CDD)

遊戲發想遊戲發想 ((Concept Design)Concept Design)

Page 14: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

14

系統分析 系統分析 ((System analysis)System analysis) GDD GDD 撰寫 撰寫 ((Game design document)Game design document) MDD MDD 撰寫 撰寫 ((Media design document)Media design document) TDD TDD 撰寫 撰寫 ((Technical design document)Technical design document) 遊戲專案建立 遊戲專案建立 ((Game project)Game project)

– ScheduleSchedule– Milestones / Check pointsMilestones / Check points– Risk managementRisk management

測試計畫書測試計畫書 團隊建立 團隊建立 ((Team building)Team building) 產出物產出物

– GDDGDD– MDDMDD– TDDTDD– The TeamThe Team

遊戲提案遊戲提案 ((Proposal)Proposal)

Page 15: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

15

美術量產製作美術量產製作– ModelingModeling– TexturesTextures– AnimationAnimation– MotionMotion– FXFX

程式開發 程式開發 ((Coding)Coding) 企劃數值設定企劃數值設定 ……

量產 量產 !!

遊戲開發遊戲開發 ((Production)Production)

Page 16: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

16

關卡串聯 關卡串聯 ((Level integration)Level integration) 數值調整 數值調整 ((Number tuning)Number tuning) 音效置入 音效置入 ((Audio)Audio) 完成所有美術完成所有美術 程式與美術結合程式與美術結合 Testing within the game teamTesting within the game team Focus group (User study)Focus group (User study)

– Release some playable levels for focus group.Release some playable levels for focus group.– Get the feedback from focus group to adjust the game play.Get the feedback from focus group to adjust the game play.– Invited outside game players but evaluation in-houseInvited outside game players but evaluation in-house

遊戲整合遊戲整合 ((Integration)Integration)

Page 17: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

17

Alpha Alpha 測試測試– 除錯 除錯 ((Debug)Debug)– Make the game stableMake the game stable

Beta Beta 測試測試– 數值微調數值微調– Game play Game play 微調微調– 對線上遊戲而言 對線上遊戲而言 ((MMOG)MMOG)

» 封閉測試 封閉測試 ((Closed beta)Closed beta) Invited game playersInvited game players

» 開放測試 開放測試 ((Open beta)Open beta) Free for public playersFree for public players

極限測試 極限測試 ((Critical testing)Critical testing)– Only for MMOGOnly for MMOG– Continuously implementingContinuously implementing– For serversFor servers

遊戲測試遊戲測試 ((Test)Test)

Page 18: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

18

Bug Bug 分級 分級 ((Bug Classification)Bug Classification)– A BugA Bug– B BugB Bug– C BugC Bug– S BugS Bug

PrinciplesPrinciples– Bug Bug 分級從嚴分級從嚴– Tester vs DebuggerTester vs Debugger

Bug Classification

Bug Dispatch

Debug

Verify

Bug

FAQ

Y

N

?

BugsBugs

Page 19: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

19

Hardware

3D Graphics API 2D API Input Device OS API

3D Scene Mngmt 2D Sprite Gamepad NetworkAudio

Terrain Collision Character UIDynamics Sound FX

Fighting System FX System Game AI Script System

NPC System Virtual Agent Trading System Story

Game

Game PlayLayer

EngineLayer

SystemLayer

Game Software SystemGame Software System

Page 20: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

20

33D Graphics APID Graphics API– DirectX 9.0 SDK – Direct3DDirectX 9.0 SDK – Direct3D

» Newest update : DirectX 9.0c SDK Update (June, 2005)Newest update : DirectX 9.0c SDK Update (June, 2005)– OpenGLOpenGL

» 2.02.0 2D API2D API

– DirectX 9.0 SDK - DirectMediaDirectX 9.0 SDK - DirectMedia– Win32 GDIWin32 GDI

Input deviceInput device– DirectX 9.0 SDK – DirectInputDirectX 9.0 SDK – DirectInput

AudioAudio– DirectX 9.0 SDK – DirectSound / Direct3DSound / DirectMediaDirectX 9.0 SDK – DirectSound / Direct3DSound / DirectMedia– OpenALOpenAL

System Layer – APIs (1/2)System Layer – APIs (1/2)

Page 21: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

21

OS APIOS API– Win32 SDKWin32 SDK– MFCMFC

NetworkNetwork– DirectX 9.0 SDK – DirectPlayDirectX 9.0 SDK – DirectPlay– Socket librarySocket library

System Layer – APIs (2/2)System Layer – APIs (2/2)

Page 22: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

22

3D scene management system3D scene management system– Scene graphScene graph

ShadersShaders 2D sprite system2D sprite system Audio systemAudio system GamepadGamepad HotkeysHotkeys MousesMouses TimersTimers NetworkNetwork DDK interfaceDDK interface

Engine Layer (1/2)Engine Layer (1/2)

Page 23: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

23

TerrainTerrain Advanced scene management systemAdvanced scene management system

– Space partition techniqueSpace partition technique» BSP TreeBSP Tree

– OctreeOctree Character systemCharacter system

– Bone-skinBone-skin– Motion BlendingMotion Blending

DynamicsDynamics– Particle systemParticle system– Rigid-body dynamicsRigid-body dynamics

Collision detectionCollision detection Sound FXSound FX User interfaceUser interface

Engine Layer (2/2)Engine Layer (2/2)

Page 24: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

24

NPC (Non-playable characters) managementNPC (Non-playable characters) management Game AIGame AI

– Path findingPath finding– Finite state machine (FSM)Finite state machine (FSM)– Steering behaviorSteering behavior

AvatarAvatar Combat systemCombat system FX systemFX system Script systemScript system Trading systemTrading system Number systemNumber system ……

Game Play LayerGame Play Layer

Page 25: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

25

System ToolsSystem Tools– Visual C/C++Visual C/C++

» .Net 2003.Net 2003 VC/C++ 7.1VC/C++ 7.1

» Visual C/C++ 6.0 + SP5Visual C/C++ 6.0 + SP5– NuMega BoundsCheckerNuMega BoundsChecker

» Finding memory leakingFinding memory leaking– Intel vTuneIntel vTune

» Finding computation performance bottlenecksFinding computation performance bottlenecks» for CPUfor CPU

– PIXPIX» Finding graphics performance bottlenecksFinding graphics performance bottlenecks» For GPUFor GPU

Game Development Tools for Programming (1/2)Game Development Tools for Programming (1/2)

Page 26: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

26

SDKsSDKs– System APISystem API

» Win32 SDK or MFCWin32 SDK or MFC» DirectX SDK or OpenGL DirectX SDK or OpenGL » Socket librarySocket library

– Middleware (Game engine)Middleware (Game engine)» RenderwareRenderware» UnrealUnreal» ……

Game Development Tools for Programming (2/2)Game Development Tools for Programming (2/2)

Page 27: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

27

3D animation tools3D animation tools– Discrete 3dsMaxDiscrete 3dsMax– MayaMaya– Softimage XSISoftimage XSI

2D tools2D tools– PhotoshopPhotoshop– IllustratorIllustrator

Motion toolsMotion tools– Motion capture devicesMotion capture devices– Motion BuilderMotion Builder– FiLMBOXFiLMBOX

Game Development Tools for ArtistsGame Development Tools for Artists

Page 28: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

28

RenderWare GraphicsRenderWare Graphics

Study GuideStudy Guide

Part IPart I

Page 29: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

29

Criterion Software Ltd.Criterion Software Ltd.– EAEA

Cross-platform graphics API for real-time 3D Cross-platform graphics API for real-time 3D applicationsapplications– PCPC

» D3D8 / D3D9 / OpenGLD3D8 / D3D9 / OpenGL– ConsoleConsole

» PS2 / Xbox/ GameCube / PSP / N-GagePS2 / Xbox/ GameCube / PSP / N-Gage The whole product lineThe whole product line

– RenderWare StudioRenderWare Studio– RenderWare GraphicsRenderWare Graphics– RenderWare PhysicsRenderWare Physics– RenderWare A.I.RenderWare A.I.– RenderWare AudioRenderWare Audio– RenderWare MobileRenderWare Mobile

Introduction to RenderWare Graphics 3.7 (1/2)Introduction to RenderWare Graphics 3.7 (1/2)

Page 30: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

30

RenderWare Graphics SDKRenderWare Graphics SDK– Version 3.7Version 3.7– C language bindingC language binding

» Cross-platformCross-platform– Scene managementScene management

» Tree structureTree structure» Built-in BSP scene management systemBuilt-in BSP scene management system

– ExportersExporters» 3dsMax 63dsMax 6» Maya 6.5Maya 6.5

– ViewersViewers– Retained / Immediate modesRetained / Immediate modes– 75% world-wide game middleware market share75% world-wide game middleware market share– All programming libraries are static.All programming libraries are static.– DocumentsDocuments

» ~\Graphics\docs~\Graphics\docs

Introduction to RenderWare Graphics 3.7 (2/2)Introduction to RenderWare Graphics 3.7 (2/2)

Page 31: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

31

Located :Located :– ~/Graphics/Docs~/Graphics/Docs

““Must-read”Must-read”

RenderWare Graphics DocumentsRenderWare Graphics Documents

Tutorials :Tutorials :– ~/Graphics/Examples/Tutorials~/Graphics/Examples/Tutorials

Page 32: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

32

RenderWare Graphics ArchitectureRenderWare Graphics Architecture RwCoreRwCore

– Core libraryCore library– ‘‘Rw’Rw’– For example,For example,

» RwCaremaCreate, …RwCaremaCreate, …

RW ToolkitRW Toolkit– Utility functionsUtility functions– ‘‘Rt’Rt’– For example,For example,

» RtLtMp, …RtLtMp, …

RW PluginRW Plugin– Extensibility functionsExtensibility functions– ‘‘Rp’Rp’– For example,For example,

» RpLODAtomic, …RpLODAtomic, …

Page 33: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

33

RenderWare NamespacesRenderWare Namespaces ‘‘Rw’Rw’

– Functions situated in core libraryFunctions situated in core library– rwcore.hrwcore.h– rwcore.librwcore.lib

‘‘Rp’Rp’– Functions situated in plugin librariesFunctions situated in plugin libraries– Linked and attached to appropriate headers and libraries.Linked and attached to appropriate headers and libraries.

‘‘Rt’Rt’– Indicated as a toolkitIndicated as a toolkit

‘‘Rx’Rx’– Used by Powerpipe APIUsed by Powerpipe API

‘‘Rs’Rs’– Source code to a simple platform abstraction layer.Source code to a simple platform abstraction layer.– ““~/Graphics/Examples/Tutorials”~/Graphics/Examples/Tutorials”

‘‘rw’rw’– System constantsSystem constants

Page 34: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

34

RenderWare Fundamental Types (1/4)RenderWare Fundamental Types (1/4) BooleanBoolean

– RwBoolRwBool– TRUE / FALSETRUE / FALSE– 4 bytes4 bytes

CharactersCharacters– RwCharRwChar– 1 byte for ANSI1 byte for ANSI– 2 bytes for Unicode2 bytes for Unicode

IntegersIntegers– RwInt8 / RwUInt8 - 1 byteRwInt8 / RwUInt8 - 1 byte– RwInt16 / RwUInt16 - 2 bytesRwInt16 / RwUInt16 - 2 bytes– RwInt32 / RwUInt32 – 4 bytesRwInt32 / RwUInt32 – 4 bytes– RwInt64 / RwUInt64 – 8 bytesRwInt64 / RwUInt64 – 8 bytes– RwInt128 / RwUInt128 – 16 bytesRwInt128 / RwUInt128 – 16 bytes

Page 35: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

35

RenderWare Fundamental Types (2/4)RenderWare Fundamental Types (2/4) RealsReals

– RwRealRwReal» 4 bytes4 bytes

– RwFixedRwFixed» 16 bits integer + 16 bits fraction fixed point value16 bits integer + 16 bits fraction fixed point value» Rare usedRare used

VectorsVectors– RwV2dRwV2d

» x and y componentsx and y components

– RwV3dRwV3d» x, y, zx, y, z

Page 36: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

36

RenderWare Fundamental Types (3/4)RenderWare Fundamental Types (3/4) Coordinate systemCoordinate system

– Right-handed for modelsRight-handed for models– Left-handed for camerasLeft-handed for cameras– Axis naming conventionsAxis naming conventions

MatricesMatrices

V = U [ M ]

Page 37: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

37

RenderWare Fundamental Types (4/4)RenderWare Fundamental Types (4/4) FramesFrames

– RenderWare objects holding transformation matricesRenderWare objects holding transformation matrices– Two matrices :Two matrices :

» Local transformation matrixLocal transformation matrix LTMLTM Converting the model from local space to world spaceConverting the model from local space to world space

» Model matrixModel matrix MMMM

Page 38: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

38

Hierarchical Models (1/2)Hierarchical Models (1/2) Hierarchical modeling explicitly models joints, or Hierarchical modeling explicitly models joints, or

connecting models.connecting models. In RenderWare, the joints are represented by In RenderWare, the joints are represented by

“frames”.“frames”.– RwFrame()RwFrame()– Frame defines the hierarchy.Frame defines the hierarchy.

The model data is sectioned.The model data is sectioned. Each section is stored in an “atomic”.Each section is stored in an “atomic”.

– RpAtomic()RpAtomic() An atomic can be linked to a frame.An atomic can be linked to a frame. With a collection of atomics and frames, forms a With a collection of atomics and frames, forms a

hierarchical model.hierarchical model.– RpAtomicSetFrame()RpAtomicSetFrame()– RwFrameAddChild()RwFrameAddChild()

Page 39: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

39

Hierarchical Models (2/2)Hierarchical Models (2/2)

LTM1 = MM1

LTM2 = MM2 x LTM1

LTM3 = MM3 x LTM2

A clump is a container for a set of atomics. A clump is a container for a set of atomics.

Page 40: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

40

Matrix Combination Flags (1/2)Matrix Combination Flags (1/2) Matrix and frame transformation functions in Matrix and frame transformation functions in

RenderWare Graphics takes a parameter, RenderWare Graphics takes a parameter, combineOPcombineOP, to perform the transformation , to perform the transformation combination effects.combination effects.

The available combination flags are :The available combination flags are :– rwCOMBINEREPLACErwCOMBINEREPLACE

» Same as the REPLACE in TheFly3DSame as the REPLACE in TheFly3D– rwCOMBINEPRECONCATrwCOMBINEPRECONCAT

» Same as the LOCAL in TheFly3DSame as the LOCAL in TheFly3D– rwCOMBINEPOSTCONCATrwCOMBINEPOSTCONCAT

» Same as the GLOBAL in TheFly3dSame as the GLOBAL in TheFly3d

[M][ML] [MG]

Page 41: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

41

Matrix Combination Flags (2/2)Matrix Combination Flags (2/2) For example :For example :

RwFrameScale() forms a scale matrix :

Page 42: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

42

RenderWare Initialization (1/2)RenderWare Initialization (1/2) Three steps :Three steps :

– Initialization for memory management & default file systemInitialization for memory management & default file system» RwEngineInit()RwEngineInit()» Two memory management solutions :Two memory management solutions :

OS-level memory management functionsOS-level memory management functions– RwMalloc() / RwFree() / RwRealloc() / RwCalloc()RwMalloc() / RwFree() / RwRealloc() / RwCalloc()

FreelistFreelist– RwFreeListXXXX() RwFreeListXXXX()

– Setting the video modeSetting the video mode» Opening the RW Graphics engineOpening the RW Graphics engine

RwEngineOpen();RwEngineOpen(); On PC, sending the window handle to RWOn PC, sending the window handle to RW

» Choosing Graphics subsystemChoosing Graphics subsystem RwEngineGetNumSubSystems()RwEngineGetNumSubSystems() RwEngineGetSubSystemInfo()RwEngineGetSubSystemInfo() RwEngineSetSubSystem()RwEngineSetSubSystem()

Page 43: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

43

RenderWare Initialization (2/2)RenderWare Initialization (2/2)» Setting video modeSetting video mode

RwEngineGetNumVideoModes()RwEngineGetNumVideoModes() RwEngineGetVideoModeInfo()RwEngineGetVideoModeInfo()

– WidthWidth– HeightHeight– Color depthColor depth– Refresh rateRefresh rate– Pixel formatPixel format– Flags (i.e. rwVIDEOMODEEXCLUSIVE for full screen)Flags (i.e. rwVIDEOMODEEXCLUSIVE for full screen)

– Attaching the plugins & starting RenderWare GraphicsAttaching the plugins & starting RenderWare Graphics» Attaching the all plugins used before starting the RW Attaching the all plugins used before starting the RW

graphics enginegraphics engine For example : For example :

– Attaching the RpWorld plugin, the retained mode Attaching the RpWorld plugin, the retained mode scene management system : RpWorldPluginAttach()scene management system : RpWorldPluginAttach()

» Starting the engineStarting the engine RwEngineStart()RwEngineStart()

Page 44: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

44

RenderWare De-initializationRenderWare De-initialization Three steps :Three steps :

– RwEngineStop()RwEngineStop()– RwEngineClose()RwEngineClose()– RwEngineTerm()RwEngineTerm()

Page 45: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

45

RenderWare World LibraryRenderWare World Library Scene & static modelsScene & static models Dynamic modelsDynamic models LightsLights CamerasCameras

Page 46: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

46

RenderWare Scene (1/3)RenderWare Scene (1/3) RenderWare Graphics retained mode APIRenderWare Graphics retained mode API

– RpWorld() & RpWorldSector()RpWorld() & RpWorldSector() SceneScene

– Static models – the ‘scenery’Static models – the ‘scenery’– Dynamic models – objects can be moved or animatedDynamic models – objects can be moved or animated– Dynamic lightsDynamic lights– CamerasCameras

RpWord objectRpWord object– RpWorld is the container for scenes.RpWorld is the container for scenes.– And is bounded by a single box which is subdivided into And is bounded by a single box which is subdivided into

static sectors.static sectors.» RpWorldSector objectRpWorldSector object

– Each sector defines cuboid volume within the scene.Each sector defines cuboid volume within the scene.– The sectors are created by dividing up the static scenery The sectors are created by dividing up the static scenery

using a binary space partitution (BSP) tree.using a binary space partitution (BSP) tree.» Speeding up the rendering performanceSpeeding up the rendering performance

Page 47: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

47

RenderWare Scene (2/3)RenderWare Scene (2/3)» Performing fast collision detectionPerforming fast collision detection

– The sectorization process is performed at 3D animation tool The sectorization process is performed at 3D animation tool during exporting process and imported using during exporting process and imported using RtWorldImport() toolkit.RtWorldImport() toolkit.

– Dynamic objects such as atomics, lights, cameras can be Dynamic objects such as atomics, lights, cameras can be added to a world and linked to world sectors.added to a world and linked to world sectors.

– When the objects moving, the world plugin will decide which When the objects moving, the world plugin will decide which sector they should be linked to.sector they should be linked to.» Only the world sectors that are visible to the camera Only the world sectors that are visible to the camera

used for rendering are rendered.used for rendering are rendered. RpWorld iteratorsRpWorld iterators

– RenderWare does not explore his scene management RenderWare does not explore his scene management structure to public.structure to public.

– You must use the RpWorld iterators to explore all objects You must use the RpWorld iterators to explore all objects within a world.within a world.

– Binding a callback function to the iterator.Binding a callback function to the iterator.– You can access the world object.You can access the world object.

Page 48: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

48

RenderWare Scene (3/3)RenderWare Scene (3/3)– Four iterators :Four iterators :

» RpWorldForAllClumps()RpWorldForAllClumps()» RpWorldForAllLights()RpWorldForAllLights()» RpWorldForAllMaterials()RpWorldForAllMaterials()» RpWorldForAllWorldSectors()RpWorldForAllWorldSectors()

RpWorldSector iteratorsRpWorldSector iterators– Three iterators :Three iterators :

» RpWorldSectorForAllAtomics()RpWorldSectorForAllAtomics()» RpWorldSectorForAllLights()RpWorldSectorForAllLights()» RpWorldSectorForAllMeshes()RpWorldSectorForAllMeshes()

Page 49: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

49

Creating a WorldCreating a World From foreign dataFrom foreign data

– Use World Import toolkit to load a scene data created by Use World Import toolkit to load a scene data created by artists using 3D software.artists using 3D software.

– This will be demonstrated next week during the instruction This will be demonstrated next week during the instruction for RW exporters.for RW exporters.

Page 50: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

50

Rendering a WorldRendering a World When calling RpWorldRender(), the BSP tree is When calling RpWorldRender(), the BSP tree is

searched and the visible world sectors are rendered.searched and the visible world sectors are rendered. You can hook a rendering callback to world sector You can hook a rendering callback to world sector

rendering process.rendering process.– RpWorldSetSectorRenderCallback()RpWorldSetSectorRenderCallback()– The callback, type of RpWorldSectorCallbackRender(), will be The callback, type of RpWorldSectorCallbackRender(), will be

triggered prior to rendering each sector.triggered prior to rendering each sector.

Page 51: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

51

RenderWare Dynamic Models (1/4)RenderWare Dynamic Models (1/4) RenderWare Graphics retained mode API RenderWare Graphics retained mode API

distinguishes the static models and dynamic models.distinguishes the static models and dynamic models.– Static model is like the scenery.Static model is like the scenery.– Dynamic models are the actors.Dynamic models are the actors.

Three primary dynamic model objects :Three primary dynamic model objects :– Clump (RpClump)Clump (RpClump)– Atomic (RpAtomic)Atomic (RpAtomic)– Geometry (RpGeometry)Geometry (RpGeometry)

The geometry objects :The geometry objects :– VerticesVertices– Triangle indicesTriangle indices– Texture coordinatesTexture coordinates– ……– No linkage to a frameNo linkage to a frame

» Static !Static !

Page 52: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

52

RenderWare Dynamic Models (2/4)RenderWare Dynamic Models (2/4) The atomic objects :The atomic objects :

– An atomic object contains a pointer to a geometry object An atomic object contains a pointer to a geometry object and a frame object.and a frame object.

– It also has a bounding sphereIt also has a bounding sphere– The atomic is a container of a geometry.The atomic is a container of a geometry.– The geometry defines the data.The geometry defines the data.

The clump objects :The clump objects :– The real game world needs more complex geometry The real game world needs more complex geometry

structure to construct the 3D scene. That means multiple structure to construct the 3D scene. That means multiple atomics need to be kept track of to manage complex atomics need to be kept track of to manage complex models.models.

– A clump is a container for dynamic objects associated with a A clump is a container for dynamic objects associated with a frame hierarchy.frame hierarchy.

– A clump can :A clump can :» Add and remove atomics using RpClumpAddAtomic() or Add and remove atomics using RpClumpAddAtomic() or

RpClumpRemoveAtomic().RpClumpRemoveAtomic().» Render atomics in the clump. (RpClumpRender())Render atomics in the clump. (RpClumpRender())

Page 53: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

53

RenderWare Dynamic Models (3/4)RenderWare Dynamic Models (3/4)» Get and set frames in a clump using RpClumpGetFrame() Get and set frames in a clump using RpClumpGetFrame()

and RpClumpSetFrame().and RpClumpSetFrame().» Load and save clump.Load and save clump.

– A typical clump hierarchy of atomicsA typical clump hierarchy of atomics

Page 54: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

54

RenderWare Dynamic Models (4/4)RenderWare Dynamic Models (4/4)– Another more complicated example :Another more complicated example :

Page 55: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

55

Model Creation Overview (1/2)Model Creation Overview (1/2) It’s common to create the models offline.It’s common to create the models offline.

– By artists using 3D toolsBy artists using 3D tools Then export the data from the tools.Then export the data from the tools.

– By default, an “.RWS” file is generated during export process.By default, an “.RWS” file is generated during export process.– This file can contain any number of clump objects.This file can contain any number of clump objects.

The RenderWare streaming API will be used to find a The RenderWare streaming API will be used to find a clump in this RWS file.clump in this RWS file.

Modeling tools :Modeling tools :– ExportersExporters

» Discrete 3dsMax 6.0 or higher (?)Discrete 3dsMax 6.0 or higher (?)» Alias Maya 6.5Alias Maya 6.5

– ViewersViewers» wrldviewwrldview

for .bsp filefor .bsp file» clmpviewclmpview

for .dff filefor .dff file

Page 56: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

56

Model Creation Overview (2/2)Model Creation Overview (2/2) Procedural model creationProcedural model creation

– Please reference “geometry” SDK example for more Please reference “geometry” SDK example for more practical demo code.practical demo code.

– Including :Including :» Assign the vertices data.Assign the vertices data.» Assign the triangle topology.Assign the triangle topology.» Create the materialsCreate the materials» Attach the textures to materials.Attach the textures to materials.

Page 57: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

57

RenderWare GraphicsRenderWare Graphics

Model CreationModel CreationUsing 3ds MaxUsing 3ds Max

Page 58: 1 Game Project Development 王銓彰 ● 王俊堯. 2 Game platform Game platform Game types Game types Game team Game team Game development pipeline Game development

58

RenderWare GraphicsRenderWare Graphics

Study GuideStudy Guide

Part IIPart II