A Brief Introduction to XNA Eric Feng ACRD Agenda Introduction - - PowerPoint PPT Presentation

a brief introduction to xna
SMART_READER_LITE
LIVE PREVIEW

A Brief Introduction to XNA Eric Feng ACRD Agenda Introduction - - PowerPoint PPT Presentation

A Brief Introduction to XNA Eric Feng ACRD Agenda Introduction Application Model History and Roadmap Games Powered By XNA XNAs Modules Working pipeline Performance Tips and Golden Rules XNAs Not Acronymed


slide-1
SLIDE 1

A Brief Introduction to XNA

Eric Feng ACRD

slide-2
SLIDE 2

Agenda

  • Introduction
  • Application Model
  • History and Roadmap
  • Games Powered By XNA
  • XNA’s Modules
  • Working pipeline
  • Performance
  • Tips and Golden Rules
slide-3
SLIDE 3

XNA’s Not Acronymed

  • What IS XNA?

– A managed framework for developing games on both PC and Xbox 360

  • Graphics device, input, and audio management along with

math helpers

  • Who is using XNA?

– Hobbyists – Students – Independent developers – And…., professionals

  • Torpex Games, Hidden Path Entertainment, GarageGames

Inc.

slide-4
SLIDE 4

XNA’s Not Acronymed (cont’d)

  • Why XNA?

– Unmanaged background

  • assembly, C, C++
  • XNA exposed us to a new language ----- C#

– XNA allows for RAD

  • Full games can be put together in obscenely short periods of time
  • Allows developers to focus on content, gameplay, balancing over

technical issues

– XNA does things more intuitively than DirectX

  • Render Targets
  • Device Management
slide-5
SLIDE 5

Game Technology Map

Realtime Rendering

RAD Games Tools Pixomatic ATI Radeon Nvidia GeForce Realtime Video Renderer Creative Soundblaster REALTEK AC’97 Nvidia NForce Realtime Audio Renderer

Simulation Technology

Criterion Renderware AI Biographic AI.implant Ikuni AI LUA Python Java UnrealScript Scripting Lang C#, VB, C++ Havok Criterion Renderware Phyiscs Novodex Novodex Physics Physics Engine Advanced Media OmiVoice Voice Recognition

Multiplayer Technology

Quazal Net-Z Terraplay Demonware BitDemon Butterfly Butterfly.NET Networking DirectPlay Winsock Zona TerraZona Bigworld Bigworld MMOG GameSpy GameSpy Sega SNAP Valve Steam Online Services Live

Audio Content

RAD Game Tools Miles Creative Labs Sensaura CRI ADX Firelight FMOD Sound System Audio XACT DirectSound

Mesh/Material Content

PixoLogic Z-Brush Interactive Fx Amazon Paint Right Hemisphere Deep Paint Right Hemisphere Deep UV 3D Image Editor Adobe Photoshop JASC Paintshop PRO Corel Painter Web Technology Optpix iMageStudio Image Editor Rt/zen RT/Shader Shader - Creation Nvidia FX Composer ATI RenderMonkey Shader - Composers

3D Editors Animation Content

Third Wish Software Magpie OC3 Impersonator Lip Sync Biovision Motion Analysis Vicon Motion Systems Motion Capture Kaydara MotionBuilder RAD Game Tools Granny 3D Natural Motion Endorphin Curious Labs Poser Animation Editor

Cinematic Content

Pixar PRMan Mental Images Mental Ray Splutterfish Brazil Nvidia Gelato Offline Renderer Adobe Premier AVID Xpress Adobe AfterEffects Discreet Combustion Newtek Digital Fusion Compositing Editor RAD Game Tools Bink CRI Sofdec Factor 5 DivX Video Playback

Process

Metroworks SN Systems Dev Tools Visual Studio Intel Vtune Sony Performance Analyzer Profilers PIX Xoreax IncrediBuild JetFrog JetBuild Build Tools MS Build

Alias Maya Discreet 3D Studio Max SoftImage XSI Newtek Lightwave 3D Editor

Game Engines

Criterion Renderware Graphics Epic Unreal NDL Gamebyro (NetImerrse) Touchdown Entertainment Jupiter Id Quake/Doom Valve Half Life 2 Crytek CryEngine Vicarious Visions Intrinsic Alchemy Spinor GmbH Shark 3D Trinigy GmbH Vision Virtools (Prototyping) Game Engines

Singular Inversions FaceGen Virtual Clones Face Generation

Criterion Renderware Studio Studio Game Asset Conversion

Game Asset Conversion

Converters

Right Hemisphere Deep Exploration Okino Polytrans Converters

UI Creation/Menus

Macromedia Flash Secret Level Flash Player Anark GameFace Criterion Maestro UI Creation/Menus Compuware SoftICE Debugger Visual Studio BugZilla Bug Tracking

Perforce CVS Subversion Source Management VS SourceSafe VS Team System

OSS Docbook Doxygen ndoc Document Generation HTML Help Cakewalk Cakewalk Pro Sonic Foundry Sound Forge Adobe Audition Digidesign ProTools OSS Audacity Audio Editors

Alienbrain Asset Management

World/Level Editors

World/Level Editors Test Tools GamePlay Analysis
slide-6
SLIDE 6

XNA Pillars

Design/Content Creation Game Technology Process

Process/Build Asset Management Test Tools Developer Tools Game Technology Design/Content Creation

Hybrid Holdings dPVS Misc

Realtime Rendering

RAD Games Tools Pixomatic ATI Radeon Nvidia GeForce Realtime Video Renderer Creative Soundblaster REALTEK AC’97 Nvidia NForce Realtime Audio Renderer

Simulation Technology

Criterion Renderware AI Biographic AI.implant Ikuni AI LUA Python Java UnrealScript Scripting Lang C#, VB, C++ Havok Criterion Renderware Phyiscs Novodex Novodex Physics Physics Engine Advanced Media OmiVoice [Xb] Voice Recognition

Multiplayer Technology

Quazal Net-Z Terraplay Demonware BitDemon Butterfly Butterfly.NET Networking DirectPlay Winsock Zona TerraZona Bigworld Bigworld MMOG GameSpy GameSpy Sega SNAP Valve Steam Online Services Live

Audio Content

Metroworks SN Systems Dev Tools Visual Studio

Game Engines

Micro Forte BigWorld Criterion Renderware Graphics Epic Unreal NDL Gamebyro (NetImerrse) Touchdown Entertainment Jupiter Id Quake/Doom Valve Half Life 2 Crytek CryEngine Vicarious Visions Intrinsic Alchemy Spinor GmbH Shark 3D Trinigy GmbH Vision Virtools (Prototyping) Game Engines Criterion Renderware Studio Studio

Mesh/Material Content

PixoLogic Z-Brush Interactive Fx Amazon Paint Right Hemisphere Deep Paint Right Hemisphere Deep UV 3D Image Editor Adobe Photoshop JASC Paintshop PRO Corel Painter Web Technology Optpix iMageStudio Image Editor Rt/zen RT/Shader Shader - Creation Nvidia FX Composer ATI RenderMonkey Shader - Composers Singular Inversions FaceGen Virtual Clones Face Generation

3D Editors

Alias Maya Discreet 3D Studio Max SoftImage XSI Newtek Lightwave 3D Editor

Animation Content

Third Wish Software Magpie OC3 Impersonator Lip Sync Biovision Motion Analysis Vicon Motion Systems Motion Capture Kaydara MotionBuilder RAD Game Tools Granny 3D Natural Motion Endorphin Curious Labs Poser Animation Editor

Cinematic Content

Compositing Editor RAD Game Tools Bink CRI Sofdec Factor 5 DivX Video Playback Pixar PRMan Mental Images Mental Ray Splutterfish Brazil Nvidia Gelato Offline Renderer RAD Game Tools Miles Creative Labs Sensaura CRI ADX Firelight FMOD Sound System Audio XACT DirectSound

Design Tool Format Converters Game Asset Conversion

Game Asset Conversion Compuware SoftICE Debugger Visual Studio BugZilla Bug Tracking Intel Vtune Sony Performance Analyzer Profilers PIX

Perforce CVS Subversion Source Management VS SourceSafe VS Team System Alienbrain Asset Management

Cakewalk Cakewalk Pro Sonic Foundry Sound Forge Adobe Audition Digidesign ProTools OSS Audacity Audio Editors Right Hemisphere Deep Exploration Okino Polytrans Converters

UI Creation/Menus

Macromedia Flash Secret Level Flash Player Anark GameFace Criterion Maestro UI Creation/Menus

World/Level Editors

World/Level Editors Test Tools GamePlay Analysis Xoreax IncrediBuild JetFrog JetBuild Build Tools MS Build OSS Docbook Doxygen ndoc Document Generation HTML Help Adobe Premier AVID Xpress Adobe AfterEffects Discreet Combustion Newtek Digital Fusion
slide-7
SLIDE 7

Application Model

  • The XNA Framework is divided into three

essential parts

– XNA Graphic Engine in the Microsoft.Xna.Framework.dll – XNA Game Application Model in the Microsoft.Xna.Framework.Game.dll – XNA Content Pipeline in the Microsoft.Xna.Framework.Content.Pipeline.dlls

XNA Content Pipeline

Microsoft.Xna.Framework.Content.Pipeline.dll

Game Application Model

Microsoft.Xna.Framework.Game.dll

Graphic Engine

Microsoft.Xna.Framework.dll

slide-8
SLIDE 8

History and Roadmap

  • XNA 1.0 – Aug. 2006

– Application Model, GameComponenents – GraphicDevice, Graphics – Audio, Input, Storage, Math

  • XNA 2.0 – Dec. 2007

– Expanded Support for all version of VS2005 – MRT, device lost auto restore, occlusion query, etc. – Networking support!

  • XNA 3.0 – Christmas. 2008??

– Add Zune support – Support for C# 3.0 for all platform(I can use LINQ! Oh, My…) – Content compression, Better FBX support

slide-9
SLIDE 9

Games Powered By XNA

  • XNA Car Racing Game

– The Racing Game Starter Kit is a complete XNA Game Studio game. This highly-anticipated project,

  • riginally created for Microsoft by Benjamin

Nitschke of exDream Entertainment. – XNA car Racing Game is a 3D auto racing game that features advanced graphics, audio, and input

  • processing. Race around the track and try to beat

the ghost car to achieve the best time.

slide-10
SLIDE 10

Games Powered By XNA

  • The Robot Game

– Robot Game was developed by Zepetto, a South Korean game development company. Previously released titles include Vulcanus and several games for mobile platforms. – Robot Game is a three-dimensional robot combat game that demonstrates the following components:

  • Advanced graphics using shaders and post-processing effects
  • Advanced particle system
  • Collision detection, 3D positional sound, input, and screens

management

  • Single-player mode and split-screen two-player versus mode
  • Customizable game elements, such as robots, weapons, and items
slide-11
SLIDE 11

Games Powered By XNA

  • Singularis

– Developed with XNA 2.0 Sprite with Torque Builder, Singularious is a game about a single cell creature. – Story: The protozoa Proto has a ambitious goal - he want's to become the

most powerful entity of the universe! To reach his target, Proto invades into animals, travels through their bodies and settles down on their central nerve cord, where he gains control over them. When he has control over them, he uses his victims to get to the next, more powerful animal - until he gains control over the most powerful entity within the universe ... a floating, black cat!

slide-12
SLIDE 12

Games Powered By XNA

  • Other Games

– HurricanX – Action Game – RPG Starter Kit by XNA Creater Club – The Zune game

slide-13
SLIDE 13

XNA’s Modules

  • Let’s dig down

– Content Pipeline – Graphics

  • Programable pipeline
  • Effect system
  • 2D Sprite

– Framework – Networking – Audio, etc.

slide-14
SLIDE 14

Content Pipeline

slide-15
SLIDE 15

Content Pipeline

  • In action!

– To intrude the exist pipeline – Simple sample from my engine – Create a terrain from a heightmap

slide-16
SLIDE 16

Add “Visibility” tag Add “AABB” tag Add “Effect” tag Material converter

slide-17
SLIDE 17

Attach correct shader to meshes

slide-18
SLIDE 18

Read the image Construct vertices Create a new material C r e a t e t o p o l o g y

slide-19
SLIDE 19

What’s the cons of XNA’s Graphics

  • GraphicsDeviceManager
  • Render States
  • Vertex and Index Buffers
  • Shaders and Effects
slide-20
SLIDE 20

XNA Framework

  • GameServices container

– Loose coupling between modules

  • Math Helper

– Vector, Color, Matrix, Quaternion,

  • MeshBuilder

– Generate normal, texture coordinate, binormal, tangent in content pipeline

slide-21
SLIDE 21

Working pipeline

  • Let’s get our hands dirty!

3Ds Max Modeling Export to FBX Generate shader code files Generate XNB using content pipeline Display the models on screen

slide-22
SLIDE 22

Performance

  • Graphics

– Offload to the GPU – Choose an appropriate SpriteSortMode – Avoid StateBlock

  • Optimize math where necessary
  • Take advantage of multiple threads
  • Profile on both Xbox and Windows
slide-23
SLIDE 23

Performance

  • Offload tasks from CPU to GPU

– Mesh Instancing – Particle 3D samples – Occlusion Query

slide-24
SLIDE 24

Performance

  • XNA Architecture on XBox360
slide-25
SLIDE 25

Performance

  • GraphicsDevice is somewhat thread-safe

– Cannot render from more than one thread at a time – Can create resources and SetData while another thread renders

  • ContentManager is not thread-safe

– Ok to have multiple instances, but only one per thread

  • Input is not threadable

– Windows games must read input on the main game thread

  • Audio and networking are thread-safe
slide-26
SLIDE 26

Golden Rules And Tips

  • Tips

– Write the tests first and do not think about the implementation. – Try to make sure you test as much as possible. – Start the test constantly from this point on, even when you think it does not make sense.

slide-27
SLIDE 27

Golden Rules And Tips

  • Golden Rules

– Don’t use any external dlls if not required – Don’t wait with the testing – Don’t load content directly – Save games and loading other content – Test resolutions – Allow controlling everything with a gamepad – Debug and unit test on the Xbox 360

slide-28
SLIDE 28
  • Thank you.
  • Demo Time
  • Q & A

http://www.xna.com