XNA - an introduction to XNA and GSE by xkl11315

VIEWS: 106 PAGES: 31

									XNA
- an introduction to XNA and GSE

Henrik Westergaard Hansen
Academic Developer Evangelist
Microsoft




                        henrikwh@microsoft.com
                        http://blogs.msdn.com/henrikwh
Agenda
 XNA Game Studio
   Starter Kit
 XNA Framework
   Application Model
   Content Pipeline
   Graphics
   Audio
   Input
   Storage
   Math
 Deployment on Xbox 360
                     XNA Game Studio Professional
                        Integration into VS professional tools
                        Commercial games support on Xbox 360 with
                        Publishing Agreement
                        Available during 2007



XNA Game Studio Express
   New easier to use tools for Hobbyists, Academics
   and Small, Indie game developers
   No additional hardware necessary – works with retail
   Xbox 360 consoles
   For personal, non-commercial game development on
   Xbox 360 and Windows
Installation
 .NET 2.0
 Visual Studio 2005 C# Express
 XNA Framework
 XNA Game Studio

 On Vista
   Visual Studio 2005 SP1
   Visual Studio 2005 SP1 for Vista (Beta)
XNA Framework
   The XNA Framework is a .NET game
   development platform that you use to
  create games for Xbox 360 and Windows
 Supports Microsoft game platforms
 Focus on your game, not the platform
 Consistent, easy-to-use APIs
A first look:
XNA Game Studio Express 1.0
Spacewar
                                                Games
                                                            Starter Kits            Code           Content            Comps




Starter Kits
                                                Extended
                                                Framework         Application Model                     Content Pipeline




                                                Core
                                                Framework   Graphics        Audio          Input         Math          Storage




                                                Platform
                                                             Direct3D               XACT           XINPUT            XContent




 Take our games and make them your own

 Complete working game
   Use as a starting point for your own games
   Accessed via “New Project…”
   Hit F5 and you’re up and running
   Documentation and tutorials

 Availability
   2 included with XNA Game Studio Express
   New kits released regularly after launch
XNA Framework Layers
   Games              Starter Kits           Code               Content     Components




   Extended
   Framework                Application Model                      Content Pipeline




   Core
                      Graphics         Audio          Input          Math       Storage
   Framework




   Platform               Direct3D           XACT               XINPUT        XContent




Legend     XNA Provides        You Provide          Community
Extended Framework
                                                Games
                                                            Starter Kits            Code           Content            Comps




Application Model
                                                Extended
                                                Framework         Application Model                     Content Pipeline




                                                Core
                                                Framework   Graphics        Audio          Input         Math          Storage




                                                Platform
                                                             Direct3D               XACT           XINPUT            XContent




Lets you focus on making your game and not worry
          about the platform it’s running on
  Get up and running quickly
    First lines of code you write are for your game
  Platform abstraction
    What’s the best way to design the game loop?
    How do I create and manage my Window?
    How do I follow platform best practices?
  Game
    This is the main type for your game
    Load, Update and Draw events
                                               Games
                                                           Starter Kits            Code           Content            Comps




Application Model
                                               Extended
                                               Framework         Application Model                     Content Pipeline




                                               Core
                                               Framework   Graphics        Audio          Input         Math          Storage




                                               Platform
                                                            Direct3D               XACT           XINPUT            XContent




 Create reusable components that can
   be easily integrated into your game
 GameComponent, DrawableGameComponent
   Base type for all XNA components
   Author writes Load, Update, and Draw
   Can discover and interact with other components
 Game.Components
   Managed at runtime by the game
   Full design time experience inside of IDE
                                        Games
                                                    Starter Kits            Code           Content            Comps




XNA Framework Content Pipeline          Extended
                                        Framework         Application Model                     Content Pipeline




Design Principles
                                        Core
                                        Framework   Graphics        Audio          Input         Math          Storage




                                        Platform
                                                     Direct3D               XACT           XINPUT            XContent




   Freedom of choice
      Content creation tools
      Game engines
   Less work on content plumbing
      More game development time
   Stronger integration for code and content
      Unified code and content builds
      Reduce code churn from content changes
XNA Framework Content Pipeline
  Importers
     Game content added to Visual Studio
                      3D File   2D File     Material File   Audio File
                      Formats   Formats       Formats        Formats
                       .FBX     .DDS .BMP       .FX         .XAP (XACT)
                        .X      .JPG .PNG
                                   .TGA
  Processors
     Strongly typed conversions
     Managed code extensions
 ContentManager xnaLoader = new ContentManager();
 myAsset = xnaLoader.Load<Mesh>("MyAssetName");
Application Model
Content Pipeline
Core Framework
                                        Games
                                                    Starter Kits            Code           Content            Comps




Graphics
                                        Extended
                                        Framework         Application Model                     Content Pipeline




                                        Core
                                        Framework   Graphics        Audio          Input         Math          Storage




                                        Platform
                                                     Direct3D               XACT           XINPUT            XContent




  Provides low level render capabilities
 Built on top of Direct3D 9
 Updated APIs that follow .NET Design Guidelines
   Effects
   Resources
   Lock/Unlock
   Vertex streams
 Provided resources
   Model, Mesh, Bones
   Texture
   Effects and shaders
XNA Framework Effects
XNA Framework Effects
                                               Games
                                                           Starter Kits            Code           Content            Comps




Graphics
                                               Extended
                                               Framework         Application Model                     Content Pipeline




                                               Core
                                               Framework   Graphics        Audio          Input         Math          Storage




Managed DirectX Differences                    Platform
                                                            Direct3D               XACT           XINPUT            XContent




  Programmable pipeline
    No fixed-function support (BasicEffect)
    No lights, materials, transforms, FVF
  No D3DX mesh support
    Content pipeline supports X file importing
    Content pipeline provides asset conditioning
  A migration guide is available
    MDX 1.1 to XNA
    Fixed function to programmable pipeline
                                         Games
                                                     Starter Kits            Code           Content            Comps




Audio
                                         Extended
                                         Framework         Application Model                     Content Pipeline




                                         Core
                                         Framework   Graphics        Audio          Input         Math          Storage




                                         Platform
                                                      Direct3D               XACT           XINPUT            XContent




       Easier to play your sounds
 Build up sound assets using XACT Tool
   Add sounds
   Adjust properties
   Build “banks” of sounds
 Easier integration for developers
   Access them via logical names
   Looping, streaming, and memory management
   No low-level buffer management
                                    Games
                                                Starter Kits            Code           Content            Comps




Input
                                    Extended
                                    Framework         Application Model                     Content Pipeline




                                    Core
                                    Framework   Graphics        Audio          Input         Math          Storage




                                    Platform
                                                 Direct3D               XACT           XINPUT            XContent




 Makes getting user input extremely easy
 Immediate mode programming model
   No initialization
   No state management
 Provides
   Xbox 360 controller
   Keyboard
   Mouse (Windows only)
Input:
Using the Xbox 360 gamepad
                                               Games
                                                           Starter Kits            Code           Content            Comps




Storage
                                               Extended
                                               Framework         Application Model                     Content Pipeline




                                               Core
                                               Framework   Graphics        Audio          Input         Math          Storage




                                               Platform
                                                            Direct3D               XACT           XINPUT            XContent




 Provides an easy way to read and write
          game data and saves
 StorageContainer acts as a virtual file system
   Files stored in the correct location on each platform
   Supports multiple storage devices and profiles on
   Xbox 360
 Stream based easily integrates with System.IO
                                        Games
                                                    Starter Kits            Code           Content            Comps




Math
                                        Extended
                                        Framework         Application Model                     Content Pipeline




                                        Core
                                        Framework   Graphics        Audio          Input         Math          Storage




                                        Platform
                                                     Direct3D               XACT           XINPUT            XContent




          Math library for games

 Vector, Matrix, Quaternion, Plane, AABB,
 Sphere, Ray, Frustum, Curve
 Right-handed by default
 Easy integration
 Intersection tests
 Movement helpers
Creating Games for Xbox 360
Prerequisites and installation
 Xbox live subscription
 XNA Creaters Club (650 kr for a year)
 Install XNA Game launcher from Xbox
 marketplace

 Install XNA Creaters Club from Xbox
 marketplace
 To get your connection code, run XNA
 Game launcer from: GamesDemos and
 More
                                        Games
                                                    Starter Kits            Code           Content            Comps




Xbox 360 Development
                                        Extended
                                        Framework         Application Model                     Content Pipeline




                                        Core
                                        Framework   Graphics        Audio          Input         Math          Storage




                                        Platform
                                                     Direct3D               XACT           XINPUT            XContent




      Seamless Development Experience

 Project templates for Xbox 360 games
 F5 deploy to the console
 Remote debugging
   Breakpoints
   Watches
   Debug and Trace to PC
 No
   Edit and Continue
   Debug Visualizers
Starter Kits
Wrap Up
 Resources
   Forums
      http://forums.microsoft.com/msdn
   XNA Developer Center
      http://msdn.com/xna
   XNA team blog
      http://blogs.msdn.com/xna
   My blog
      http://blogs.msdn.com/henrikwh
 MSDN guide to XNA:
   http://www.microsoft.com/danmark/msdn/guide/default.mspx
   Please mail all input to me!

								
To top