A Brief Introduction to XNA Eric Feng ACRD Agenda Introduction - - PowerPoint PPT Presentation
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
Agenda
- Introduction
- Application Model
- History and Roadmap
- Games Powered By XNA
- XNA’s Modules
- Working pipeline
- Performance
- Tips and Golden Rules
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.
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
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 RendererSimulation 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 RecognitionMultiplayer 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 LiveAudio Content
RAD Game Tools Miles Creative Labs Sensaura CRI ADX Firelight FMOD Sound System Audio XACT DirectSoundMesh/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 - Composers3D 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 EditorCinematic 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 PlaybackProcess
Metroworks SN Systems Dev Tools Visual Studio Intel Vtune Sony Performance Analyzer Profilers PIX Xoreax IncrediBuild JetFrog JetBuild Build Tools MS BuildAlias 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 GenerationCriterion Renderware Studio Studio Game Asset Conversion
Game Asset ConversionConverters
Right Hemisphere Deep Exploration Okino Polytrans ConvertersUI Creation/Menus
Macromedia Flash Secret Level Flash Player Anark GameFace Criterion Maestro UI Creation/Menus Compuware SoftICE Debugger Visual Studio BugZilla Bug TrackingPerforce 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 EditorsAlienbrain Asset Management
World/Level Editors
World/Level Editors Test Tools GamePlay AnalysisXNA Pillars
Design/Content Creation Game Technology Process
Process/Build Asset Management Test Tools Developer Tools Game Technology Design/Content Creation
Hybrid Holdings dPVS MiscRealtime Rendering
RAD Games Tools Pixomatic ATI Radeon Nvidia GeForce Realtime Video Renderer Creative Soundblaster REALTEK AC’97 Nvidia NForce Realtime Audio RendererSimulation 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 RecognitionMultiplayer 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 LiveAudio Content
Metroworks SN Systems Dev Tools Visual StudioGame 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 Generation3D 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 EditorCinematic 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 DirectSoundDesign Tool Format Converters Game Asset Conversion
Game Asset Conversion Compuware SoftICE Debugger Visual Studio BugZilla Bug Tracking Intel Vtune Sony Performance Analyzer Profilers PIXPerforce 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 ConvertersUI Creation/Menus
Macromedia Flash Secret Level Flash Player Anark GameFace Criterion Maestro UI Creation/MenusWorld/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 FusionApplication 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
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
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.
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
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!
Games Powered By XNA
- Other Games
– HurricanX – Action Game – RPG Starter Kit by XNA Creater Club – The Zune game
XNA’s Modules
- Let’s dig down
– Content Pipeline – Graphics
- Programable pipeline
- Effect system
- 2D Sprite
– Framework – Networking – Audio, etc.
Content Pipeline
Content Pipeline
- In action!
– To intrude the exist pipeline – Simple sample from my engine – Create a terrain from a heightmap
Add “Visibility” tag Add “AABB” tag Add “Effect” tag Material converter
Attach correct shader to meshes
Read the image Construct vertices Create a new material C r e a t e t o p o l o g y
What’s the cons of XNA’s Graphics
- GraphicsDeviceManager
- Render States
- Vertex and Index Buffers
- Shaders and Effects
XNA Framework
- GameServices container
– Loose coupling between modules
- Math Helper
– Vector, Color, Matrix, Quaternion,
- MeshBuilder
– Generate normal, texture coordinate, binormal, tangent in content pipeline
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
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
Performance
- Offload tasks from CPU to GPU
– Mesh Instancing – Particle 3D samples – Occlusion Query
Performance
- XNA Architecture on XBox360
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
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.
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
- Thank you.
- Demo Time
- Q & A
http://www.xna.com