quiz #1 discussion - northeastern its · models: typically done in 3dstudio max or maya !...

36
Ch 1: What is Game Programming Really Like? Ch 2: What’s in a Game? Quiz #1 Discussion

Upload: others

Post on 12-Mar-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Ch 1: What is Game Programming Really Like? Ch 2: What’s in a Game?

Quiz #1 Discussion

Page 2: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Developing a Game Game Architecture

Resources: Chapter 2 (Game Coding Complete)

Page 3: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

What was your last game architecture like?

ò  Probably didn’t worry about

ò  efficiency

ò  Graphics optimization

ò  Memory optimization

ò  Why are these important?

ò  How about modularity of the code?

Lesson: many of the engines you work with will optimize for certain scenarios but if you are working on a AAA title that doesn’t fit the

norm, you will need to override the standard way engines do things.

Page 4: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Example Game Architecture

Game Application Layer

Game Logic Game View

Based on Figure 2.1 from Mike McShaffry Game Coding Complete

Operating System/Hardware

Input/Output

Game State Player AI Player over network actions

Page 5: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Example Game Architecture

Game Application Layer

Game Logic Game View

Based on Figure 2.1 from Mike McShaffry Game Coding Complete

Operating System/Hardware

Input/Output

Game State Player AI Player over network

actions

Page 6: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Game Application Layer (usually handled by an Engine)

Game Application Layer

Based on Figure 2.2 from Mike McShaffry Game Coding Complete

DEVICES •  Input •  Files •  RAM •  Time

OS •  Language •  DLL •  Threads •  Network

GAME LIFETIME

•  Core Lib •  Main Loop •  Init & Shutdown

Page 7: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Game Application Layer (usually handled by an Engine)

Game Application Layer

Based on Figure 2.2 from Mike McShaffry Game Coding Complete

DEVICES •  Input •  Files •  RAM •  Time

•  input devices •  Did you ever look at a device

driver code? •  Abstraction of input to actions: •  device driver input -> game

actions •  send game actions to game

logic subsystem

Page 8: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Game Application Layer (usually handled by an Engine)

Game Application Layer

Based on Figure 2.2 from Mike McShaffry Game Coding Complete

•  loading/saving game state •  assets loading •  resource caching •  memory management •  Virtual memory use

Is memory still an issue?

DEVICES •  Input •  Files •  RAM •  Time

Page 9: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Game Application Layer (usually handled by an Engine)

Game Application Layer

Based on Figure 2.2 from Mike McShaffry Game Coding Complete

DEVICES •  Input •  Files •  RAM •  Time

OS •  Language •  DLL •  Threads •  Network

GAME LIFETIME

•  Core Lib •  Main Loop •  Init & Shutdown

Page 10: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Game Application Layer (usually handled by an Engine)

Game Application Layer

Based on Figure 2.2 from Mike McShaffry Game Coding Complete

DEVICES •  Input •  Files •  RAM •  Time

OS •  Language •  DLL •  Threads •  Network

GAME LIFETIME

•  Core Lib •  Main Loop •  Init & Shutdown

Page 11: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Game Application Layer (usually handled by an Engine)

Game Application Layer

Based on Figure 2.2 from Mike McShaffry Game Coding Complete

DEVICES •  Input •  Files •  RAM •  Time

OS •  Language •  DLL •  Threads •  Network

GAME LIFETIME

•  Core Lib •  Main Loop •  Init & Shutdown

Page 12: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Game Application Layer (usually handled by an Engine)

Game Application Layer

Based on Figure 2.2 from Mike McShaffry Game Coding Complete

•  Queuing input •  Tick game logic •  Keep simulation time •  Events/Triggers

GAME LIFETIME

•  Core Lib •  Main Loop •  Init & Shutdown

Page 13: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Game Application Layer (usually handled by an Engine)

Game Application Layer

Based on Figure 2.2 from Mike McShaffry Game Coding Complete

•  Init: •  Initialize game logic •  Initialize game views •  Reset simulation time •  Handshake network,

input devices •  Shutdown: •  Memory de-allocation •  Close files, network,

etc.

GAME LIFETIME

•  Core Lib •  Main Loop •  Init & Shutdown

Page 14: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Example Game Architecture

Game Application Layer

Game Logic Game View

Based on Figure 2.1 from Mike McShaffry Game Coding Complete

Operating System/Hardware

Input/Output

Game State Player AI Player over network

actions

Page 15: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Game Logic

Game Logic

Based on Figure 2.2 from Mike McShaffry Game Coding Complete

Game State &

Data Structures

Physics

Events Process

Manager Command Interpreter

Page 16: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Game Logic

Game Logic

Based on Figure 2.2 from Mike McShaffry Game Coding Complete

Game State &

Data Structures

Physics

Events Process

Manager Command Interpreter

•  What are Data Structures? •  Common to Game Design •  Arrays •  Linked Lists •  Hash Tables •  Trees, B-Trees •  Graphs •  Stacks and Queues

Page 17: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Game Logic

Game Logic

Based on Figure 2.2 from Mike McShaffry Game Coding Complete

Physics

Events Process

Manager Command Interpreter

•  Basic physics •  What does that include?

•  Collision •  Why is that important?

•  Mostly handled by the engine

Page 18: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Game Logic

Game Logic

Based on Figure 2.2 from Mike McShaffry Game Coding Complete

Game State &

Data Structures

Physics

Events Process

Manager Command Interpreter

Page 19: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Game Logic

Game Logic

Based on Figure 2.2 from Mike McShaffry Game Coding Complete

Game State &

Data Structures

Physics

Events Process

Manager Command Interpreter

Page 20: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Game Logic

Game Logic

Based on Figure 2.2 from Mike McShaffry Game Coding Complete

Game State &

Data Structures

Physics

Events Process

Manager Command Interpreter

Page 21: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Example Game Architecture

Game Application Layer

Game Logic Game View

Based on Figure 2.1 from Mike McShaffry Game Coding Complete

Operating System/Hardware

Input/Output

Game State Player AI Player over network

actions

Page 22: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Game View: Human

Game View: Human

Based on Figure 2.3 from Mike McShaffry Game Coding Complete

Display •  3D •  UI •  Video

Audio •  SFX •  Music •  Speech

Options Process

Manager Input

Interpreter

Page 23: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Game View: Human

Game View: Human

Based on Figure 2.3 from Mike McShaffry Game Coding Complete

Display •  3D •  UI •  Video

Audio •  SFX •  Music •  Speech

Options Process

Manager Input

Interpreter

Page 24: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Game View: Human

Game View: Human

Based on Figure 2.3 from Mike McShaffry Game Coding Complete

Display •  3D •  UI •  Video

Audio •  SFX •  Music •  Speech

Options Process

Manager Input

Interpreter

Page 25: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Game View: Human

Game View: Human

Based on Figure 2.3 from Mike McShaffry Game Coding Complete

Display •  3D •  UI •  Video

Audio •  SFX •  Music •  Speech

Options Process

Manager Input

Interpreter

Page 26: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Game View: AI

Game View: AI

Based on Figure 2.6 from Mike McShaffry Game Coding Complete

Decision Making

Options Process

Manager Stimulus

Interpreter

Page 27: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Flexibility

Game Application Layer

Game Logic Game View

Based on Figure 2.1 from Mike McShaffry Game Coding Complete

Operating System/Hardware

Input/Output

Game State Player AI Player over network

actions

Page 28: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Game Engines

What engines have you worked with?

Page 29: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Components (coding and scripting)

ò Libraries, e.g. XNA

ò API that you can use

ò Need to create the art assets

ò Engines, e.g. Unreal Tournament

ò Scripting language

ò Can create modifications by extending their classes & telling the engine to use your modification instead

ò Attach scripts to objects or entities

Page 30: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Assets (Art and Design)

ò  Models and Animation

ò  Level Design: done in a tool they give you

ò  Models: typically done in 3Dstudio max or Maya

ò  Animation: typically done in 3Dstudio max or Maya

ò  Frames mapped to an animation cycle

ò  Exported to a game engine format

ò  Textures

ò  Music & Audio

ò  Composed in MIDI or WAV files

ò  3D audio

ò  Interactive audio patterns

Page 31: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Architecture of Game Engines

Rendering Engine

Character Controller Physics Engine Camera Controller

Game State

3D Audio Engine Game Rules

Inventory Scene Graph

Weapons/Objects

Action Handlers

Systems:

Database/Resources:

Page 32: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Architecture of Game Engines

Rendering Engine

Character Controller Physics Engine Camera Controller

Game State

3D Audio Engine Game Rules

Inventory Scene Graph

Weapons/Objects

Action Handlers

Processes and Methods:

Database/Resources:

•  joints and inverse Kinematics •  Lighting Calculation •  Project to 2D

Page 33: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Architecture of Game Engines

Rendering Engine

Character Controller Physics Engine Camera Controller

Game State

3D Audio Engine Game Rules

Inventory Scene Graph

Weapons/Objects

Action Handlers

Processes and Methods:

Database/Resources:

For Controlling bots (AI), navigation For Controlling Camera For specifying keyboard directions for user control of player In UT3K: •  Contoller

•  PlayerController •  Camera •  xPlayer

•  AIController •  Scripted Controller

•  Bot •  xBot

Page 34: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Architecture of Game Engines

Rendering Engine

Character Controller Physics Engine Camera Controller

Game State

3D Audio Engine Game Rules

Inventory Scene Graph

Weapons/Objects

Action Handlers

Processes and Methods:

Database/Resources: For in game physics For Controlling effects In UT3K: •  Karma Physics

•  Bone rotation •  collisions

Page 35: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Architecture of Game Engines

Rendering Engine

Character Controller Physics Engine Camera Controller

Game State

3D Audio Engine Game Rules

Inventory Scene Graph

Weapons/Objects

Action Handlers

Processes and Methods:

Database/Resources:

For controlling triggered actions For handling actions, e.g. Pickup, firing, etc. In UT3K: •  Triggers •  WeaponFire •  xEmitter •  Pickup

Page 36: Quiz #1 Discussion - Northeastern ITS · Models: typically done in 3Dstudio max or Maya ! Animation: typically done in 3Dstudio max or Maya ! Frames mapped to an animation cycle !

Assignment #1 Building a simple 2D Game