Docsity

Introduction to Game Development, Lecture Slides - Assembly Programming, Slides of Assembly Language Programming

Partial preview of the text

Download Introduction to Game Development, Lecture Slides - Assembly Programming and more Slides Assembly Language Programming in PDF only on Docsity!

Mike Acton, Insomiac Games. 6.189 IAP 2007 MIT

6.189 IAP 2007

Lecture 16 Introduction to Game Development

Introduction to Game Development

(on the Playstation 3 / Cell )

โ— Mike Acton

  • (^) Engine Director, Insomniac Games
  • (^) < macton @ insomniacgames.com >
  • (^) Director, CellPerformance.com
  • (^) < macton @ cellperformance.com >

Console Development Priorities

โ— The code itself is not that important. โ— The design of the data affects performance more than the design of the code. โ— Ease of programming is either a minor or non- priority. โ— Portability is not a concern. โ— Performance is still king.

Development Team

โ— Artists

  • (^) Animation, Shader, Texture, Modeling
  • (^) Environment, Lighting, ... โ— Designers
  • (^) Systems, Level, ... โ— Writers โ— Producers โ— Programmers
  • (^) Gameplay, Engine, AI, Special Effects,
  • (^) Sound/Music, ...

What are the major game modules?

โ— Memory management โ— Math โ— Collision โ— Physics โ— Static graphics โ— Animation โ— Procedural graphics โ— Lighting โ— Loading, streaming โ— Scene graph โ— AI โ— Compression โ— Sound, Music โ— Special Effects โ— State machines โ— Scripting โ— Motion control โ— ...

Overview

โ— How does programming on the Playstation 3 affect the (macro) design of the major systems? โ— Overview of design process for a specific system (Animation).

Structure Design (2)

โ— Organize data carefully:

  • (^) Prefer fixed (known) size blocks
  • (^) Fundamental unit: 128 bytes (Cache line)
  • (^) Fundamental unit: 16 bytes (Quadword)
  • (^) Prefer uniform data โ— Minimum working sizes:
  • (^) 4 x 2 x 64 bits
  • (^) 4 x 4 x 32 bits
  • (^) 4 x 8 x 16 bits
  • (^) 4 x 16 x 8 bits
  • (^) 4 x 128 bits

Basic Math

โ— e.g. Vector Class

  • (^) Usually the first thing a programmer will make, but consider: โ— SIMD, Altivec vs. SPU instruction set โ— Floats vs. Double vs. Fixed-point โ— SPU floating-point format โ— Component access
  • (^) ... There's no value here.

Collision Detection

โ— Affects high-level design

  • (^) Deferred results
  • (^) Grouped results โ— SPU decomposition for:
  • (^) Static geometry in scene
  • (^) Dynamic geometry in scene

Procedural Graphics

โ— Patch size โ— Filter types โ— Sync of source reads โ— Sync with GPU โ— SPU vs. RSX โ— Particles โ— Cloth โ— Fonts โ— Textures โ— Parametric geometry โ— ...

Game Logic

โ— State machines

  • (^) Size affected by SPU
  • (^) Deferred results
  • (^) Logic lines can be deferred โ— Scripting
  • (^) Interpreter size
  • (^) Multiple streams to hide memory accesses โ— Motion control
  • (^) High-level sync (Animation, AI, Physics)

Animation (1)

โ— Starting with the basics:

  • (^) Simple playback, animation channels โ— Related data โ— e.g. Rotation + Translation + Scale = Joint
  • (^) Euler vs. quaternion โ— Euler: More compressible โ— Quaternion: Less messy โ— Gimbal lock is manageable in practice.
  • (^) Format, double vs. float vs. half vs. fixed-point
  • (^) Rotations: Degrees, radians or normalized?

Animation (3)

โ— Channel curve fitting

  • (^) Closer to root, tighter fit.
  • (^) e.g. Simple spline โ— Store time values โ— Problem: Looping scalars โ— Problem: Unlimited length

Animation (4)

โ— e.g. Spline segments

  • (^) Plus storage for time maps
  • (^) Plus segment lookup time
  • (^) Advantage: Can re-order blocks
  • (^) Advantage: Long lengths OK
  • (^) Disadvantage: Less compressable
  • (^) Advantage: Solves scalar loop problem โ— Summarize: DMA and transform.