3D Game Programming 王銓彰 kevin.cwang@msa.hinet.net 2005 1 課程大綱 Introduction to Game Development (3hr) Game System Analysis (3hr) The Game Main Loop (3hr) 3D Game Engine Training (Using TheFly3D) (6hr) Game Mathematics & Geometry (3hr) Terrain (3hr) Characters (3hr) Game Control System (3hr) Advanced Scene Management System (3hr) Game AI (6hr) Game Physics (3hr) Game FX (3hr) Network Gaming (3hr) MMOG (3hr) Summary Wang’s Method for Real-time 3D Game Development 2 課程要求 One term project The students are in teams. Use TheFly3D 3D engine to code a Real-time 3D Game. Action RPG The teacher will provide graphics materials and setup the game design. Final examination Homework will be closely coupled with the term project. 3 王銓彰 (1/3) 目前 學歷 數位內容學院 專任講師 / 顧問 宇峻奧汀 顧問 鈊象電子 3D技術顧問 台灣大學土木工程學系畢業 資歷 04-04 資策會網路多媒體研究所 專案顧問 97-04 昱泉國際股份有限公司 技術長 96-96 虛擬實境電腦動畫股份有限公司 研發經理 93-96 西基電腦動畫股份有限公司 研發經理 90-93 國家高速電腦中心 助理研究員 89-90 台灣大學土木工程學系 CAE Lab 研究助理 4 王銓彰 (2/3) Game作品 Current TheFly3D 3D Engine 昱泉國際 DragonFly 3D Game Engine M2神甲奇兵, VRLobby, 天劍記 Lizard 3D Game Engine 幻影特攻、笑傲江湖 I & II、神鵰俠侶 I & II、風雲、小李飛刀、 笑傲江湖網路版、怪獸總動員、聖劍大陸、笑傲外傳 西基電腦動畫 Ultimate Fighter 1st real-time 3D fighting game in Taiwan 5 王銓彰 (3/3) 專長 (Expertise) 3D Computer Graphics Geometric Modeling Numerical Methods Character Animation Photo-realistic Rendering Real-time Shading Volume Rendering 應用領域 (Applications) 即時3D遊戲開發 (Real-time 3D Game Development) 電腦動畫 (Computer Animation) 虛擬實境 (Virtual Reality) 電腦輔助設計 (Computer-aided Design, CAD) 科學視算 (Scientific Visualization) 6 1st Introduction to Game Development 7 Introduction to Game Development Game Game Game Game Game Tools platform types team development pipeline software system 8 Game Platform PC Console Single player Match Makings MMOG (Massive Multi-player Online Game) Web-based Games Sony PS2 MS Xbox Nintendo GameCube Arcade Mobile Nintendo GBA Nintendo DS Sony PSP Hand-held 9 Game Development on PC PC is designed for general office application. Not for entertainment purpose A virtual memory system But video memory is limited. For frame buffers, z buffers, textures, vertices, … PCI / AGP might be a problem for performance. Open architecture Unlimited system memory Hardware driver version issue Different capabilities Different performance Compatibility test is very important. Development is easy to setup. Visual C/C++ with DirectX 10 Game Development for Consoles Specific hardware designed for games Single user OS Single process OS No hard disk drive (?) Closed system Native coding environment Limited resources Proprietary SDK Hardware related features C language with assembly Memory for everything 32M for PS2 64M for Xbox One console runs, the others do ! Use gamepad and no keyboard 11 Game Types RPG (Role playing games) AVG (Adventure games) RTS (Real-time strategy games) FPS (First-person shooting games) RSLG (戰棋) STG Sports Action Puzzle games Table games MMORPG Massive Multiple Player Online Role Playing Games 12 Game Team Members 開發團隊 行銷業務團隊 產品經理(PM) 測試團隊 遊戲審議委員會 製作人 執行製作人 企劃團隊 程式團隊 美術團隊 Game project approval 遊戲經營團隊 線上遊戲 game master (GM) Customer services MIS 13 Game Producer 遊戲製作人 Team leader (usually) 資源管理 (Resource management) 行政管理 (Administration) 專案管理 (Project management) 向上負責 (Upward management) 團隊的決策 風險管理 14 遊戲執行製作人 專案管理執行 Daily 運作 House keeping Meeting coordinator Schedule checking Cross-domain communication Usually not a full-time job position A position for training and becoming a producer 15 遊戲企劃 (1/2) 故事設計 (Story telling) 腳本設計 (Scripting) 玩法設計 (Game play design) 角色設計(Character design) 動作設計(Animation design) 關卡設計 (Level design) 特效設計(Effect design) 物件設計 介面設計(User Interface design) 遊戲調適 (Game tuning) 數值設定 (Numerical setup) AI 設計 (Game AI design) 音效設定 (Sound FX setup) 16 遊戲企劃 (2/2) 場景設定 (Scene setup) Game document writing Game quality checking 17 遊戲美術 Visual setup for game design 2D setup 3D setup Graphics design and production 場景 (Terrain) 人物 (Character) 建模 (Models) 材質 (Textures) 動作 (Motion / Animation) 特效 (FX) User Interface 行銷支援 (封面.海報..等) 18 遊戲程式 遊戲程式 (Game Program) 撰寫 遊戲開發工具 (Game Tools) 開發 遊戲Data exporters from 3D animation Software Level editor Scene editor FX editor Script editor Game editor 3dsMax / Maya / Softimage Game engine development Game technique research Online game server development 19 遊戲開發流程 Basic Procedures for Game Development Idea Proposal Concept Approval Production Prototype 發想 (Idea) 提案 (Proposal) 製作 (Production) 整合 (Integration) 測試 (Testing) 除錯 (Debug) 調適 (Tuning) Integration Pre-alpha Testing Debug Alpha Tuning Beta Final > Concept approval > 雛形 (prototype) > Pre-alpha > Alpha > Beta 20 遊戲發想(Concept Design) 遊戲類型 (Game types) 遊戲世界觀 (Game world) 故事 (Story) 遊戲特色 (Features) 遊戲玩法 (Game play) 遊戲定位 (Game product positioning) 競爭對手評估 風險評估 (Risk) Target player Marketing segmentation / positioning SWOT (Strength/Weakness/Opportunity/Threat) 分析 產出物 Concept Design Document (CDD) 21 遊戲提案(Proposal) 系統分析 (System analysis) GDD 撰寫 (Game design document) MDD 撰寫 (Media design document) TDD 撰寫 (Technical design document) 遊戲專案建立 (Game project) Schedule Milestones / Check points Risk management 測試計畫書 團隊建立 (Team building) 產出物 GDD MDD TDD The Team 22 遊戲開發(Production) 美術量產製作 Modeling Textures Animation Motion FX 量產 ! 程式開發 (Coding) 企劃數值設定 … 23 遊戲整合(Integration) 關卡串聯 (Level integration) 數值調整 (Number tuning) 音效置入 (Audio) 完成所有美術 程式與美術結合 Testing within the game team Focus group (User study) Release some playable levels for focus group. Get the feedback from focus group to adjust the game play. Invited outside game players but evaluation in-house 24 遊戲測試(Test) Alpha 測試 Beta 測試 除錯 (Debug) Make the game stable 數值微調 Game play 微調 對線上遊戲而言 (MMOG) 封閉測試 (Closed beta) Invited game players 開放測試 (Open beta) Free for public players 極限測試 (Critical testing) Only for MMOG Continuously implementing For servers 25 Bugs Bug 分級 (Bug Classification) A Bug B Bug C Bug S Bug Bug Bug Classification Principles Bug 分級從嚴 Tester vs Debugger Bug Dispatch Debug N ? Verify Y FAQ 26 Game Software System Game NPC System Virtual Agent Fighting System Terrain Trading System FX System Game AI Collision Character Dynamics 3D Scene Mngmt 3D Graphics API 2D Sprite Gamepad 2D API Hardware Story Script System Sound FX Audio Input Device UI Network OS API Game Play Layer Engine Layer System Layer 27 System Layer – APIs (1/2) 3D Graphics API 2D API DirectX 9.0 SDK - DirectMedia Win32 GDI Input device DirectX 9.0 SDK – Direct3D Newest update : DirectX 9.0c SDK Update (June, 2005) OpenGL 2.0 DirectX 9.0 SDK – DirectInput Audio DirectX 9.0 SDK – DirectSound / Direct3DSound / DirectMedia OpenAL 28 System Layer – APIs (2/2) OS API Win32 SDK MFC Network DirectX 9.0 SDK – DirectPlay Socket library 29 Engine Layer (1/2) 3D scene management system Scene graph Shaders 2D sprite system Audio system Gamepad Hotkeys Mouse Timers Network DDK interface 30 Engine Layer (2/2) Terrain system Advanced scene management system Character system Bone-skin Motion Blending Dynamics Space partition technique BSP Tree Octree Particle system Rigid-body dynamics Collision detection Sound FX User interface 31 Game Play Layer NPC (Non-playable characters) management Game AI Path finding Finite state machine (FSM) Steering behavior Avatar Combat system FX system Script system Trading system Number system … 32 Game Development Tools for Programming (1/2) System Tools Visual C/C++ .Net 2003 VC/C++ 7.1 Visual C/C++ 6.0 + SP5 NuMega BoundsChecker Finding memory leaking Intel vTune Finding computation performance bottlenecks for CPU PIX Finding graphics performance bottlenecks For GPU 33 Game Development Tools for Programming (2/2) SDKs System API Win32 SDK or MFC DirectX SDK or OpenGL Socket library Middleware (Game engine) Renderware Unreal … Physics ODE 34 Game Development Tools for Artists 3D tools 2D tools Discrete 3dsMax Maya Softimage XSI Photoshop Illustrator Motion tools Motion capture devices Motion Builder FiLMBOX 35 2nd Game System Analysis 36 What Will We Talk Here The idea about system analysis (SA) Mind mapping Case study - Term project 37 Why System Analysis (1/2) For 程式結構 analysis To identify 工作量 New game engine ? Re-used code ? Tools needed to be developed ? For 資源 management The main program Game development tools Total man month How many programmers ? How good the programmers ? For job dependency analysis Job A Job B Job D Job C 38 Why System Analysis (2/2) To do 技術可行性 Analysis Pre-processor for R&D ? Where is the technical bottleneck ? Technical design document Project management Bridge from game design to programming 39 Something about System Analysis No standard procedures or approaches It’s not a theory. Experience You can use your own method/tool UML Mind mapping (心智圖法) This is the one we will use in this course … 40 Wang’s System Analysis Steps Brainstorming Integration Dependency analysis Create the project Technical design document (TDD) writing 41 Brainstorming Based on the game design to put everything as many as you could Use mind mapping Including Game system Combat / Village / Puzzle / … Program modulus Camera / PC control / NPC AI / UI / FX /… Tools Level editor / Scene editor / … Entities in games Characters / vehicle / terrain / audio / … 42 Integration Confirm the resource limitation Technical implement possibility Put all related items together Man month analysis How many ? Who ? Jobs / System identification 43 Dependency Analysis Sort the Jobs By job dependency By programmers’ schedule Prototype for scheduling 44 System Analysis – Create the Project Scheduling Job assignment Resource allocation Check points Milestones Major check points Output Risk management Alternatives Risk management policy 45 Write the Technical Design Document Specification Resources Design in details Implement methods (工法) Algorithms “Project” Output in each milestone SOP (optional) TDD Template 46 Mind Map 心智圖法 A radiant thinking tool Applications 讀書心得 Proposal 上課筆記 遊記 System Analysis … Reference Programs Visio MindManager Books Tony Buzan, Barry Buzan “The Mind Map Book: How to Use Radiant Thinking to Maximize Your Brain's Untapped Potential” 47 48 49 Mind Map Demo Using MindManager Use MindManager X5 pro Developed by MindJet 50