creating video games from scratch sky con

Post on 09-May-2015

3.708 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

Like video games? Learn how to create them from scratch using the XNA framework. Also learn how to make money from your games and why you should be writing them in the first place.

TRANSCRIPT

1 m TH3 L33t M45t3r. J00 H34R M3? J00 12 901n' d0wN. 1 W1ll 34t j00R n3w8 50ul PH0r 8R34kF45t.

(I am incredibly skilled. Do you understand that? Your attempts to defeat me will fail. I will gorge myself on your inexperienced soul this morning.)

Creating Video Games from Scratch

Martha Rotter

martharo@microsoft.com

Why Games? Why Now?

● Developing Games is Hot!

● Whether it’s casual games, XBox360 games, PC games, adver-

gaming, people are interacting with games more now than ever.

● Developing Games Makes Money!

● Just a few years ago, the games industry overtook the film

industry: now the games make more than the movies.

● Developing Games is Fun!

● Duh!

● Developing Games is Free!

● Tools for XNA are all free, the only thing you might need to pay for

is the Creators Club membership.

8

9

What About Games…?

11

What are Community Games?

XBox LIVE Community Games is a new gaming service

that is complementary to XBox LIVE Arcade.

Launching this holiday season for the UK!

Provides consumers with the best and broadest

selection of gaming content available on ANY

console.

Xbox 360 is the first platform to democratize game

development by allowing developers to distribute

their games to more than 12 million Xbox LIVE

members and offering them the opportunity to

benefit financially from their creations.

12

How does Community Games Work?

• The setup? Simple.

• The payments? Cash.

• As a Premium member of the XNA Creators Club, you

can submit any game you’ve created.

• Other Premium members can check your game to

make sure it’s safe to play.

• If it is, you’ll set a price point, between 200-800

points, for people to pay to download your game.

13

How you make money with Community Games

• Once the game is reviewed and the price is set,

you’re finished.

• The game is now available on the XBox LIVE

Marketplace.

• You get a cheque every quarter for up to 70% of the

game’s total depending on your own currency.

• Depending on your game’s success, you may even

have your game advertised on XBox360 and other

Microsoft online properties!

14

Want an Example?

• The latest example:

Jonathan Blow, developer of the game Braid, an XBox360 game that's somewhat similar to early 'Mario' games for Nintendo.

His game had only been on sale for a week, but he estimated it had already sold 55,000 copies for the Xbox360.

At $15 per game, that’s $825,000 in first week gross sales.

15

XNA Overview

Let’s learn some XNA basics:

● What is XNA?

• “XNA’s Not Acronymed”

• Unified platform for game development

• Runs on XP, Vista – Sits on DX

• Targets PC or Xbox 360 or Zune

• Most boilerplate engine code already included

• FREE!

16

XNA Overview

What can you make with XNA?

● Some ideas:

• 3D or 2D games

• First person shooters

• Real-time strategy games

• And more!

17

What Else Can You Do With XNA?

18

Create games

Game design

Multi-threaded / Multi-core

Physics simulations

Mathematics

Visualization

Networking

AI

Team projects

Secondary & Post-Secondary

Computer Science

Fine Arts

Computer Graphics

Inter/multi-discipline

Research

Senior projects / Capstone

Outreach programs

•Topics •Programs

Some Assumptions

Are there any prerequisite skills I need to have before I

get started with XNA?

● Math skills

• A basic understanding of 2D and 3D coordinate

systems

• Data structures, such as vectors and matrices

● Programming skills

• Familiarity with the .NET platform and the C#

language

19

XNA Game Studio

XNA

Framework

Networking

Graphics

Input

Audio Math

Gamer

Services

XNA

Game Studio

Visual Studio

2008

Platform Windows Xbox 360 Zune

Application Model Content Pipeline

Content

PipelineDevice

Management

Game Flow

Load

ContentStart

Update

Draw

EndUnload

Content

XNA Framework Overview

22

•Platform

•Core

•Framework

•Extended

•Framework

•Games

•XACT •XINPUT •XContent•Direct3D

•Graphics •Audio •Input •Math•Storage

•Application Model •Content Pipeline

•Starter Kits Code Content Components

• 3.2 GHz triple-core custom CPU

• 500 MHz custom GPU

• 512 MB unified memory

• 12X dual-layer DVD drive

• 20 GB removable hard drive

• USB 2.0 ports

• 10/100 Mbps Ethernet

• IR receiver

• Wireless peripheral support

• High definition video out

Custom Hardware

Core0 Core1 Core2

1MB L2

L1D

CPU

GPU

10MB

EDRAM

512 MB

DRAM

Memory

I/O

Chip

3D Core

DVD (SATA)

HDD port (SATA)

Rear Panel USB

Wireless controllers

MU ports (2 USB)

Front controllers (2 USB)

Ethernet

XM

A D

ecoder

IRAudio OutFLASH

SM

CSystem control

MC

0M

C1

BIU/IO Intf

Video

Out Video Out

L1IL1D L1IL1D L1I

Analog

Chip

Hardware Overview

Assets

● Graphics

• Models

• Textures

• Animations

• Audio

• Ambient sound

• Music

• Event sounds (explosions, speech, game over…)

25

Creating Assets

● Graphics

• DCC (Digital Content Creation) tools

• Maya, 3DS Max, Lightwave, Photoshop etc.

• XNA provides importers for .x, .fbx and other file

formats that can be produced by most DCC tools

• Audio

• MP3 & WAV sounds produced in traditional ways

• Foley is the process of creating sound effects

26

The Content Pipeline

● Allows separation of artist and developer work

● Reduces engine / DCC format interdependencies

• Many standard importers and processers are

available for your content

• Importers put your DCC content into the

game, processors deal with it in the game

• Extensibility: You can write your own importer

for a custom file format

● Simple interaction from game to pipeline

• ContentManager.Load(…)

27

The Content Pipeline

Lifetime of an example asset:

1. Artist creates an oak tree in Maya

2. (Optionally) Animator adds an animation of the

oak tree exploding violently

3. Developer receives this file in Maya format and

imports it into the content pipeline

4. Compiler packs asset into a binary format tightly

coupled with XNA (not designed for use elsewhere)

5. At runtime: The content pipeline processes the exploding tree

28

Let’s Get Started!

Prepare your development environment.

● Not much is required to get started!

• Windows XP or Vista

• Visual C# Express

• Install XNA game studio!

29

Which Version Should I Install?

• Game Studio 2:

• Works with Visual Studio 2005 & Visual C# 2005 Express

Edition

• Can deploy to Windows XP, Vista or XBox360 now

• Game Studio 3:

• Works with Visual Studio 2008 & Visual C# 2008 Express

Edition

• Can deploy to XP, Vista, Xbox 360 or Zune

30

What’s New in GS 3?

• Xbox 360

• Xbox 360 project templates (You will not be able to

develop on the Xbox 360 until our final release. We

felt this was important to include so that you could

get projects converted over and look at the system,

even if you are not able to run the games, yet).

• Support for the Big Button Pad.

31

What’s New in GS 3 (cont.)?

• Framework & Visual Studio Features

• Enumerate and play back media on your Windows computer or

Xbox 360.

• Simple sound effect support on Windows computers and Xbox

360.

• Support for Rich Presence (lets friends know what’s going on in

your game).

• Support for Invites (ask your friends to join you in a multiplayer

game) and Join Session In Progress (after you see what your

friends are doing, you can join their current session with just a

couple of button presses, even if that’s a different game to the

one you are currently playing)

32

What’s New in GS 3 (cont.)?

• More Framework & Visual Studio Features

• Compress your content and save space with the new content

compression features!

• ClickOnce packaging support for distributing your XNA Framework

games on Windows.

• Upgrade your project from XNA Game Studio 2.0 using the Project

Upgrade Wizard!

• Take screen captures of your game running on Zune through the XNA

Game Studio Device Center.

• Support for .NET language features like Linq

• Create multiple content projects and leverage cross project

synchronization in Visual Studio.

• FBX importer improvements: read materials containing multiple

textures, and export custom shader materials directly out of Max or

Maya. 33

34

Full mini-game Starter Kits

Can be final destination or starting point

Growing library of genres over time

Focus on several key educational topics per

Starter Kit

The Structure of an XNA Game

How does the game run?

● Initialization

• Load assets and set initial values

● Game Loop

• Fixed number of frames per second

• Frame: an individual stage of the game’s

animation

• In each frame, look for KB input, update world,

run AI, etc.

• Disposal of objects / Cleanup35

Important Methods

In your Game’s class file:

● LoadGraphicsContent

• Pushes assets into the content pipeline

● Update

• Realtime processing happens here

• Updates to world data

• In each frame, look for KB input, update world,

run AI, etc.

• Draw

• Redraw scene 36

Accepting Keyboard Input

Polling the keyboard is easy.

● Poll the keyboard as part of the Update process

● XNA exposes a list of pressed keys

● Check those key presses and handle them

accordingly

37

Collision Detection

Collision detection is easier than before.

● Like other processing, happens in the Update

method

● Use a BoundingBox object.

• Normally used for 3D meshes, just set Z to 0

• Create a BoundingBox for every object you want

to detect collisions between

• Use the BoundingBox.Intersects method to

determine if 2 objects collide.

38

Summary

● About XNA – what it is, and architecture

● Assets & the content pipeline

● Anatomy of a game

● Creating and moving 2D sprites

● The game loop

● Simple collision detection

40

Q&A and Resources

Some XNA Resources

● http://msdn.microsoft.com/directx/XNA

Official XNA Website

● http://creators.xna.com/Education/Tutorials.aspx

Official Creators Club tutorials

● http://www.xnadevelopment.com

Third-party XNA tutorials

● http://www.learnxna.com

Third party XNA video tutorials

● http://blogs.msdn.com/martharotter

My Blog

41

Divider Slide

top related