15. XNA Game Studio or Silverlight: Which Product is Right for Me? (Updated for Mango)

       The first question many developers will face after deciding to develop a game for Windows Phone is which of the two game development models to choose. Developers targeting Windows Phone OS 7.0 can choose to develop their games by using either the XNA Framework or Silverlight. Developers targeting Windows Phone OS 7.1 may also use the graphics functionality of the XNA Framework within Silverlight applications. This article will help developers make an informed decision about which technologies to use.

       Choosing between Silverlight and the XNA Game Studio isn’t quite as straightforward as looking at a feature list or performance metrics. Each framework was designed with different goals and customers in mind. There are, as a consequence, very few hard and fast rules about which framework you must use. Instead, we offer guidance on which framework would make your work more successful or productive. Ultimately, the framework to choose depends on which version of the Windows Phone operating system your game is targeting, and what works best for you and your game.

who should consider using silverlight on windows phone

       If the application you're building for Windows Phone is a companion to an existing game for Xbox 360 or Windows, and you plan to show primarily shared statistics and other information, then Silverlight is a great choice for your game. Silverlight enables developers to leverage the built-in UI controls on the phone. Those controls can be used right out of the box, and they match the look and feel of Windows Phone with no customization. In contrast, developers using XNA Game Studio who want to have controls that match the look and feel of Windows Phone need to build and maintain those controls for themselves.

       If video is a key element of your game, and you want the ability to show video in a portion of your screen (as opposed to full screen), then Silverlight is required. Silverlight enables you to use the media control to composite your video directly into a portion of your application. Games made with XNA Game Studio, on the other hand, must show video in full screen and can't composite that video.
Similarly, Silverlight is required if your game will display web pages via the built-in Internet Explorer control. Silverlight applications have the ability to host the Internet Explorer control, and composite that control into their UI. Games made with XNA Game Studio can use http (and https), but they can't use the Internet Explorer control.

       If your application requires keyboard support, then you should consider Silverlight. Silverlight applications get access to the software keyboard by default, but for games made with XNA Game Studio, developers need to build their own software keyboard control to enable keyboard input. Hardware keyboards, when present are available to both Silverlight and XNA Game Studio. Windows Phone offers hardware keyboards as an option, but not all devices will have a hardware keyboard.

       If your development background includes experience working with other web technologies, then Silverlight requires less ramp-up time. If you're porting an existing game, for instance, the porting process will most likely take less time if you target Silverlight instead of XNA Game Studio.

who should consider using xna game studio on windows phone

       If you're more comfortable with the standard Update/Render loop for developing your games, then XNA Game Studio is the choice for you. If you've developed games for Xbox 360 or Windows, then XNA Game Studio’s application model will feel comfortable. XNA Game Studio was built by game developers for game development. As such, all of the constructs in the framework are designed specifically to produce games.

       If you're building a true 3D game, then XNA Game Studio is required. Silverlight on Windows Phone can simulate 3D by rendering to 2D sprites ahead of time and by displaying recorded animations. XNA Game Studio has full 3D support, including support for skinned animations.

       Games made with XNA Game Studio have access to XNA Content Pipeline projects, which allow build-time processing of assets, while Silverlight doesn’t have an analogous technology. Silverlight developers need to write their own pipeline from scratch to have the same functionality.

       XNA Game Studio games have access to a library of hardware-accelerated vertex and pixel shaders on Windows Phone OS 7.0, but Silverlight games can't access shaders on Windows Phone. XNA Game Studio games have control over the video card’s state, allowing developers to set render states to their liking. This includes states such as alpha blending, wireframe, solid, and so on. The video driver for Windows Phone 7 is an implementation of Direct3D, and is similar in functionality to the desktop version of Direct3D.

       If your games make heavy use of sprites, or if it animates more than a handful of sprites on the screen, your title will likely be more efficient with XNA Game Studio. Silverlight performs most of its rasterization and composition on the CPU, while XNA Game Studio makes heavy use of the graphics hardware. Expressed another way, if parts of your scene change every frame, then XNA Game Studio is for you.

       Windows Phone devices have a screen that is 800×480 pixels. That's a lot of pixels! Many games will run into problems with fill rate if they have any overdraw at all. XNA Game Studio games can access a high-quality hardware scaler that allows rendering to a much smaller target, and that rendering is scaled via dedicated hardware to the device’s native resolution. If you want to enable post-processing, or if you expect that you might have some overdraw, then XNA Game Studio is likely better for you.

using silverlight and the xna framework together in windows phone os 7.1

       Starting with Windows Phone OS 7.1, developers can use the graphics functionality of XNA Framework within Silverlight applications. This allows game developers to get the best of both frameworks in a single application.

       If you are targeting Windows Phone OS 7.1, you can leverage Silverlight for tasks that are more time-consuming when using the XNA Framework, such as authoring a UI that is consistent with the Windows Phone design and creating high-score tables that are data-bound to web services.

       Some entirely new scenarios are also made possible by having access to both Silverlight and XNA Graphics. Your game can embed video content and play it back directly, instead of relying on the separate MediaPlayerLauncher task, to which XNA Framework apps are restricted to today. You may also use a WebBrowser control directly to integrate your game with social media services that require web authentication.

       Note that if you’re making a game for all three screens (console, desktop, and phone), using Silverlight and XNA Framework together on Windows Phone may make it harder to share your code across platforms. For the easiest cross-platform development experience, you may want to consider using XNA Game Studio with the cross-platform Game class.


More information
       For additional information on developing a game using Silverlight and XNA together, see How to: Combine Silverlight and the XNA Framework in a Windows Phone Application or the Paddle Battle sample in the Education Catalog.

       For additional information on developing a game for XNA Game Studio, see Game Development on Xbox LIVE Indie Games.


       Educational content for Silverlight and XNA Game Studio development for Windows Phone can be found in the Content Catalog on Xbox LIVE Indie Games.


Downloads 




No comments:

Post a Comment