Introduction to the XNA framework

Preview:

DESCRIPTION

 

Citation preview

framework

passionate about low-level 3D

coding

embedded devices

enthusiast

graphics programmer

@victorporof

What about you?

How many of you… Play video games? Would like to build a game? Have built a game?

“building a gameis hard”

Painting by Brock Davis

First videogame ever?

First videogame ever?

No.

1947: Cathode Ray Tube Amusement Device 1951: NIM

1952: Tic-Tac-Toe 1958: Tennis for Two 1962: Space War

Long time ago…

Cathode Ray Tube Amusement

Device

The earliest known interactive electronic game was by Thomas T. Goldsmith Jr. and Estle Ray Mann: a missile simulator using radar displays from World War II.

…they couldn’t really find a snazzy name for it

NIMROD

Using a panel of lights for its display, this was the first instance of a digital computer only designed specifically to play a game.

Nim is a mathematical game of strategy in which two players take turns removing objects from distinct heaps. The player to take the last object loses.

Tic-Tac-Toe

In 1952, Alexander S. Douglas made the first computer game to use a digital graphical display, created for his Ph.D. thesis on human-computer interaction.

Photo by Loomis Dean, taken in April, 1952

In 1958, William Higinbotham made an interactive computer game named Tennis for Two for the Brookhaven National Laboratory's annual visitor's day.

Tennis for Two

Spacewar!

In 1961, MIT students Martin Graetz, Steve Russell, and Wayne Wiitanen created the game Spacewar! which also used a vector display system.

“No one will blame you for giving up. In fact, quitting at this point is a perfectly reasonable response”

Making a game is no easy business!

“No one will blame you for giving up. In fact, quitting at this point is a perfectly reasonable response”

“Quit now, and cake will be served immediately.”

Making a game is no easy business!

“No one will blame you for giving up. In fact, quitting at this point is a perfectly reasonable response”

“Quit now, and cake will be served immediately.”

-- GLaDOS (Portal)

Making a game is no easy business!

good games are designed in layers

Painting by Brock Davis

good programmers think in layers

Painting by Brock Davis

Managed runtime

environment

Built-in “boilerplate”

code

Game development

framework

C#

.NET

CLR 2.0

Core Framework Platform

Graphics

Audio

Input

Math

Application model

Content pipeline

Direct3DXACT

XINPUTXCONTENT

Extended framework

Games

Code

Content

Components

• Starter Kits

Games

Code

Content

Components

• Starter Kits

Application model

Content pipeline

Extended framework

Games

Code

Content

Components

• Starter Kits

Core Framework

Graphics

Audio

Input

Math

Application model

Content pipeline

Extended framework

Games

Code

Content

Components

• Starter Kits

Core Framework Platform

Graphics

Audio

Input

Math

Application model

Content pipeline

Direct3DXACT

XINPUTXCONTENT

Extended framework

Games

Code

Content

Components

• Starter Kits

= =

Yay! Cross-platform game development!

!= !=

Yay! Cross-platform game development!Experience says no.

!= !=

Yay! Cross-platform game development!Experience says no.

!=and definitely

Purple screen of death

NIMROD

!= !=

Yay! Cross-platform game development!No.

!=and definitely

things aren’t as cross-platform

as they seem

Painting by Brock Davis

!= !=

Yay! Cross-platform game development!No.

!=and definitely

cross-platform means:

“same framework, but take care of the

hardware differences yourself”

Painting by Brock Davis

Games

Code

Content

Components

• Starter Kits

Core Framework Platform

Graphics

Audio

Input

Math

Application model

Content pipeline

Direct3DXACT

XINPUTXCONTENT

Extended framework

New project -> Build and run Documentation and tutorials

available for download

http://create.msdn.com/education

Starter kits

“Take our games and make them

your own”

New project -> Build and run Documentation and tutorials

available for download

http://create.msdn.com/education

Starter kits

“Take our games and make them

your own”

Awesome! Let’s see a demo!

Well, that’s easy!

Well, that’s easy!but…

Perfect for learning Not a very good long-term idea for

game development Does not make you a

knowledgeable game programmer Too much “drag’n’drop” coding will

make your graphics rendering inefficient

Low framerate = bad gameplay

Starter kits

“Take our games and make them

your own”

Shamelessly copy-pasting code is evil!

Games are complex and

expensive!

Halo 3$55 million

Gran Turismo$80 million

GTA IV$100 million

XNA is perfect for hobby games

XNA is perfect for hobby games

Let’s see what goodies it has to offer

Games

• Starter Kits

Code

Content

Components

Core Framework Platform

Graphics

Audio

Input

MathApplication modelContent pipeline

Direct3DXACT

XINPUTXCONTENT

Extended framework

Game classesProcedures

Initialize LoadContent Update Draw UnloadContent

Application Model

Games

• Starter Kits

Code

Content

Components

Core Framework Platform

Graphics

Audio

Input

MathApplication modelContent pipeline

Direct3DXACT

XINPUTXCONTENT

Extended framework

Content processing2D file formats

.BMP, .JPG, .PNG, .TGA2D file formats

.FBX, .X .FX .XAP

Content pipeline

Games

• Starter Kits

Code

Content

Components

Core Framework Platform

Graphics

Audio

Input

MathApplication modelContent pipeline

Direct3DXACT

XINPUTXCONTENT

Extended framework

Graphics SpriteBatch Effect, BasicEffect Texture2D GraphicsDevice Model VertexBuffer

Audio SoundBank, WaveBank AudioEngine

Input GamePad Keyboard Mouse

Core framework

Math MathHelper Matrix Vector

Storage Title Storage

(Shaders, Meshes, Textures, Sounds) User Storage

(Save games, Scores)

Network NetworkSession PacketReader NetworkGamer

Core framework

Project from scratch demo

?

Recommended