British Computer Society May 2005 - PowerPoint PPT Presentation

1 / 43
About This Presentation
Title:

British Computer Society May 2005

Description:

British Computer Society May 2005 Video Game Programming Using The PlayStation2 Games Console Dr Henry S Fortuna School of Computing and Creative Technologies – PowerPoint PPT presentation

Number of Views:127
Avg rating:3.0/5.0
Slides: 44
Provided by: icsHeaca
Category:

less

Transcript and Presenter's Notes

Title: British Computer Society May 2005


1
British Computer SocietyMay 2005
  • Video Game Programming Using The PlayStation2
    Games Console
  • Dr Henry S Fortuna
  • School of Computing and Creative Technologies
  • University of Abertay Dundee
  • E-mail h.s.fortuna_at_abertay.ac.uk
  • Web www.hsfortuna.pwp.blueyonder.co.uk

2
My Background
  • First Degree in Electrical and Electronic
    Engineering
  • PhD in Semiconductor Physics
  • Taught Electronics/Microprocessors
  • Always interested in playing computer games
  • Always interested in computer programming/graphics
  • Joined Games Technology Course team at Abertay
  • Got involved with Sony Computers Entertainment
  • Now lead Games Technology course developments

3
Presentation Contents
  • Games programming why bother?
  • Short historical context
  • Components of a Video Game? (video)
  • Internal structure of PlayStation2
  • Development Environment
  • Programming techniques
  • What students do/think
  • Examples of student work

4
The UK Games Industry 2004
  • UK Software sales were 934m in 2000
  • 1.34 Billion in 2004 even though no new
    consoles
  • GTA San Andreas
  • fasting selling game of all time
  • 1 million units in 9 days 1.75M in the year
  • 5 titles sold more than 600,000 (double platinum)
  • Xbox greatest growth, PS2 greatest volume (640
    M)
  • Electronic Arts had 9 titles in top 20
  • Top 40 8 sports, 10 film and TV based

5
First Video Game (1961)
  • MIT student Steve Russell creates Spacewar
  • Digital PDP-1 Minicomputer

6
Nolan Bushnell Pong 1972
7
Space Invaders (1978)
8
Other Key Developments
  • Atari 400 (1978)
  • Commodore 64 (1983)
  • Nintendo Entertainment System (1985)
  • Sega Master System (1986)
  • Nintendo Gameboy (1989)
  • Sega 16-bit Genisis (1989)
  • Atari Lynx Handheld (1989)
  • Nintendo SNES (1991)
  • Sega CD (1992)
  • Sony Playstation (1995)
  • Nintendo N64 (1996)
  • Sony Net Yaroze (1997)
  • Sega Dreamcast (1999)
  • Sony PlayStation2 (2000)
  • Microsoft Xbox (2001)
  • Nintendo GameCube (2001)
  • Sony PlayStation2 Linux Kit (2002)

9
Next-Generation Consoles
  • Sony PlayStation 3
  • Cell Processor (8 Core?)
  • Xbox 360
  • 3xIBM PowerPC 3.2Ghz cores
  • ATI 500MHz graphics processor
  • Nintendo Revolution
  • Lots of handheld devices

10
Components of a Video Game
  • (show video)

11
Components of a Video Game
  • 3D graphics
  • User interaction
  • Sound effects and music
  • 3D models
  • 2D textures
  • Animation
  • Game and level design
  • Immersion, excitement, alternate reality

12
PlayStation Net Yaroze (1997)(Official
hobbyist Game Development)
  • Host-target Development
  • Net Yaroze games dev libraries
  • No access to hardware
  • Sub-optimal Performance

13
PlayStation2 Games Console
European Launch November 2000
14
(No Transcript)
15
Professional Development EnvironmentThe TOOL
  • Use the Linux-based tools that come with the TOOL
  • Use third party dev tools such as CodeWarrior or
    SN systems

16
PlayStation2 Linux Kit May 2002
  • USB keyboard mouse
  • 10/100 Ethernet Adapter
  • 40GB Hard Disk
  • DVDs
  • Linux operating system
  • Hardware Manuals
  • Development Tools
  • Example Applications

17
Development Configuration(Several Options)
  • Host/Target
  • Native

18
(No Transcript)
19
(No Transcript)
20
Development Tools
  • GNU gcc and g compilers
  • GNU gdb debugger!
  • Vector Command Line Pre-processor
  • Vector Unit assembler
  • Visual Vector Unit Debugger
  • Development can be done offline with Visual
    Studio

21
Development Environment
22
Graphics Transformation Pipeline
  • Transforms vertices from model or local space to
    2D screen space for rasterisation

23
PS2 Graphics Architecture
24
PS2 Specific Pipeline
  • Transformation Matrices built by CPU
  • Matrices and untransformed vertex data sent to
    VU1
  • VU1 performs vertex transformation, clipping,
    lighting, view port scaling.
  • Transformed data sent to GS.
  • GS performs texturing and rasterisation.
  • All above (3 processes) can run in parallel !!

25
Organisation of Memory
  • Dynamic buffer contains data that changes from
    frame to frame, e.g. transformed data,
    transformation matrices.
  • Two dynamic buffers needed to exploit parallelism
    of PS2
  • One buffer is being compiled by the CPU whilst
    the other is being sent for rendering.
  • Utilises Parallelism of PS2

Swap Every Frame
Written by CPU
Read by DMAC
26
The Game Loop
  • while(Game_Running)
  • Fire() // Start data transfer
  • GetUserInput() //
  • DoGameLogic() // AI, Physics, Logic.
  • // Following code ONLY puts render data into
    memory
  • BeginScene() // Clear frame buffer
  • SetStaticData() // textures, 3d models etc
  • SetDynamicData() // Matrices, TL, etc.
  • EndScene() // Wait for previous frame to
    render

27
VU Overview
28
Architecture of VU1
  • 16k data memory, address in qwords (128-bit)
  • 16k program memory, address in dwords (64-bit)
  • 32 x 128-bit floating point registers
  • 16 x 16-bit integer registers (newbie killer!)
  • Two execution units (upper and lower)
  • Special registers (ACC, I, Q, R, P)
  • Dual stream assembly language (.vsm file)
  • VU assembler provided by Sony (ee-dvp-as)
  • Latency, scheduling, pairing, issues.

29
Typical vsm assembly (dual stream)
  • NOP
    lq VF06,7(VI02)
  • mulax ACC,VF02,VF06x
    iaddiu VI01,VI01,0x00000001
  • madday ACC,VF03,VF06y
    iaddiu VI02,VI02,0x00000002
  • maddaz ACC,VF04,VF06z
    NOP
  • maddw VF06,VF05,VF06w
    NOP
  • NOP
    NOP
  • NOP
    NOP
  • NOP
    NOP
  • mulaw.xyz ACC,VF01,VF00w
    div Q,VF00w,VF06w
  • NOP
    NOP
  • NOP
    NOP
  • NOP
    NOP
  • NOP
    NOP
  • NOP
    NOP
  • NOP
    NOP
  • mulq.xyz VF06,VF06,Q
    waitq
  • NOP
    NOP
  • NOP
    NOP
  • NOP
    NOP

30
Typical VCL(Single Stream)
  • loop
  • lq Vert, StartVert(iVertPtr)
  • MatrixMultiplyVertex Vert, fTransform, Vert
  • div q, vf00w, Vertw
  • mul.xyz Vert, Vert, q
  • mula.xyz acc, fScales, vf00w
  • madd.xyz Vert, Vert, fScales
  • ftoi4.xyz Vert, Vert

31
(No Transcript)
32
What is the PS2 used for?
  • Introduced in year 2
  • Introduce console development topics
  • 2D graphics, frame buffers, graphics packets,
    graphics processors, memory management, console
    architecture.
  • Further Develop programming skills
  • C concepts in a games context, Sprite classes
    etc., structure of a games program, creating a 2D
    game.

33
What is the PS2 used for?
  • Continued in Year 3
  • Introduce 3D console development topics
  • 3D graphics, 3D console architecture, Vector
    Units, Parallel processing, vertex
    transformation, clipping, lighting.
  • Further develop programming skills
  • Further C concepts in a games context, High
    level 3D graphics engine design, Low level vertex
    processing.

34
What is the kit used for?
  • Students choose to use the kit for
  • Group project work
  • Honours project work
  • Other initiatives such as Dare To Be Digital

35
Evaluation
  • Games Employers Value Console Skills
  • Steep learning curve for students
  • In-house development framework needed
  • Similarities to Pro-development
  • Motivational for students
  • Introduces Linux Linux development tool chain

36
Student View of the Kit
  • Some Hate it
  • Some are indifferent
  • But most LOVE it

37
Example Applications
38
Example Applications
39
Example Applications
40
Example Applications
41
Student Work
  • (Video)
  • (Example Applications)

42
Questions?
  • Development framework and tutorials at
  • http//www.hsfortuna.pwp.blueyonder.co.uk/
  • (Dr Henry S Fortuna)

43
Development Environment
  • Libps2dev (May 2002)
  • Bundled with kit on DVDs
  • Examples and some documentation
  • Some hardware features emulated
  • Sub optimal performance
  • SPS2 project (November 2002)
  • Available on playstation2-linux.com
  • Full access to graphics hardware
  • Similar experience to Pro-Development
  • Comparable performance to Pro-Development
Write a Comment
User Comments (0)
About PowerShow.com