Frequently Asked Questions and Known Issues
How do I file bugs or make suggestions?
Is Visual Studio supported with XNA Game Studio 2.0?
Yes. XNA Game Studio 2.0 is designed to install custom extensions to supported versions of Microsoft Visual Studio tools, such as Microsoft Visual Studio 2005 Professional Edition, Microsoft Visual Studio 2005 Standard Edition, and Microsoft Visual C# 2005 Express Edition.
Can I use an existing XNA Game Studio Express game project with XNA Game Studio 2.0?
You will need to upgrade the project to the format used by XNA Game Studio 2.0, and update your game code to be compatible with changes in the XNA Framework. See Upgrade Guide: XNA Game Studio Express to XNA Game Studio 2.0.
Can I target both Windows and Xbox 360 platforms with the same solution?
Yes. See Cross-Platform Game Project Converter for details on how to convert a Windows game project into an Xbox 360 console game project, or an Xbox 360 console game project to a Windows game project, keeping both projects in the same solution.
Do I need a connection to Xbox LIVE to play my XNA Framework game? If I have written a multiplayer game, must the player with the XNA Creators Club membership sign in first?
XNA Game Studio Connect requires a connection to Xbox LIVE at all times.
If I have written a multiplayer game, must the player with the XNA Creators Club membership sign in first?
In the event that multiple people wish to play a local multiplayer XNA Framework game, it is essential that the player with a valid XNA Creators Club membership sign in first before launching XNA Game Studio Connect. After launch, additional profiles can then sign in to play.
If multiple profiles on a single Xbox 360 console have a valid XNA Creators Club membership, the connection settings that are used by XNA Game Studio Connect will always default to player one.
How do I distribute my game?
My computer cannot connect to my Xbox 360 console. What should I do?
This may indicate issues with your network settings, connection key, file names, or file system. Please see Troubleshooting Xbox 360 Game Deployment for detailed descriptions of these issues.
What do I do to fix the error message "NoSuitableGraphicsDeviceException was unhandled"?
Check the inner exception for more detail on why the graphics device could not be created. XNA Game Studio thoroughly checks why the graphics device could not be created and reports these checks in the inner exception.
If NoSuitableGraphicsDeviceException does not have an inner exception, it is likely that your graphics card does not have a DirectX 9 driver, that it does not support Shader Model 1.1, or that the hardware acceleration slider is not set to Full in your settings.
To determine the version of DirectX installed on the computer
- Click Start, and then click Run.
In the Open box, type dxdiag, and then click OK.
The System tab will display information about the version of DirectX that is installed on the computer.
To set hardware acceleration to Full on Windows XP
- Right-click the desktop, and then click Properties on the menu.
- Click the Settings tab, and then click Advanced.
- Click the Troubleshoot tab.
- Move the Hardware Acceleration slider until it is set to Full.
- Click OK, and then click Close.
To set hardware acceleration to Full on Windows Vista
- Right-click the desktop, and then click Personalize on the displayed context menu.
- Click Display Settings
- Click Advanced Settings...
- Click the Troubleshoot tab.
- Click the Change Settings button, then move the Hardware Acceleration slider until it is set to Full. Note that for display adapters that do not allow hardware acceleration to be changed, the Change Settings button may be disabled.
- Click OK on the three open dialog boxes.
To determine which shader models are supported
Please see How To: Check for Shader Model 2.0 Support for information about how to programmatically query the shader capabilities of the graphics card.
How do I do video playback with XNA Game Studio?
The XNA Framework does not contain functions for video playback. We are investigating this for future releases.
Why does my application work from my local computer, but throw SecurityException when I move it to a shared network folder?
This is a security feature of the Common Language Runtime (CLR). Applications that are run from locations other than the local system have greater security restrictions than applications run locally. Running XNA Game Studio titles from a shared network folder is not supported.
What shader models does XNA Game Studio support?
XNA Game Studio supports all the DirectX 9 shader models (versions 1.x, 2.x, and 3.0) on Windows, along with some variants. For a full list of supported shaders, see the ShaderProfile enumeration.
On Xbox 360, XNA Game Studio supports Shader Model 2.0 and an extended variant of 3.0 customized for the Xbox 360.
Some starter kits may have more restrictive requirements. For example, the Spacewar Starter Kit requires Shader Model 2.0 or higher.
Can I use the Delay Sign feature for my Xbox 360 game?
Use of delay signing can prevent the game from running on the Xbox 360, because the console uses strong name verification. Under strong name verification, the assemblies will not load until the signing process is complete.
When debugging, sometimes my full-screen game crashes and I am unable to return to Visual Studio. What can I do besides rebooting my computer?
When a program takes over the graphics device, sometimes it is unable to properly return the graphics device to Windows after a crash. Some things you can try:
- Press the Windows button or CTRL+ESC to bring up the Start menu. Sometimes this will restore the task bar, allowing you to bring up Visual Studio.
- Press ALT+TAB to return focus to Visual Studio, then SHIFT+F5 to stop the program you are debugging. Sometimes you may have to press ALT+TAB a few times to return the focus to Visual Studio before pressing SHIFT+F5
- Press CTRL+ALT+DELETE to attempt to bring up the Windows Security window. If the Windows Security window comes up, you can use Task Manager to end the task running your game and return to Visual Studio.
If those steps are unsuccessful, the only option might be to reboot the computer.
After upgrading my game from XNA Game Studio Express to XNA Game Studio 2.0, the game runs slower. Why?
The answer may lie with render targets. XNA Game Studio 2.0 introduces the ability to control whether render targets are kept or discarded from frame to frame. In XNA Game Studio Express, render targets were discarded on Xbox 360 but kept on Windows. XNA Game Studio 2.0 now keeps render targets from frame to frame on both Xbox 360 and Windows by default. This may result in decreased performance on Xbox 360.
To recover performance, change your game so that the render targets behave as they did in XNA Game Studio Express; pass RenderTargetUsage.PlatformContents when preparing your PresentationParameters class.
How do I create lighting and material effects in XNA Game Studio?
Lights and materials are implemented in XNA Game Studio with effects. To implement lighting or material effects, create an effect that contains the desired vertex or pixel color transformation. The actions of a simple effect are encapsulated in the BasicEffect class, which provides functionality for applying lights and materials, and setting world, view, and projection transformations. You may choose to use BasicEffect for simple functionality or create your own effects using the Effect class.
How do I create my own effects?
What is an effect file?
An effect is a combination of vertex and pixel shader code grouped together to encapsulate a particular rendering technique. Effects can be written in either high-level shader language (HLSL) or assembly code.
An effect file contains effect code. You may see effect files with an .fx extension that contain HLSL code. Effects in HLSL or assembly code must be compiled to a binary format before they can be used in an application.
For overviews of HLSL and the effect file format, see the HLSL Shaders and Effects DirectX Programming Guides on MSDN. Complete reference documentation for HLSL, shader ASM, and the effect file format is available in the Direct3D API Reference.
After drawing using Graphics.SpriteBatch, why do my 3D objects draw incorrectly?
By default, SpriteBatch.Begin does not save your current render state, and will change certain render state properties that may make 3D objects render incorrectly. You can choose to either reset the render state yourself after the call to SpriteBatch.End, or call SpriteBatch.Begin and pass in SaveStateMode.SaveState, which will restore the render state after sprites are drawn.
Can I map the Xbox Guide button on the Xbox 360 Controller to an action?
No. The Xbox Guide button is reserved.
My mouse cursor is not visible. How can I make it visible?
The Xbox 360 Controller does not work properly in Windows. How can I correct this?
For the Xbox 360 Controller to work correctly in Windows, you need to install the latest Xbox 360 Controller driver. You can download this driver from Microsoft Hardware Download Gaming Software.
Can I load and play a wave file from the Audio API without using the XACT tool?
No. All wave files that you wish to play must be compiled into an XACT project before you can play them.
How can I get more information on using XACT?
For an easy guide to adding sound files to an XACT project and playing them, see How To: Add a Sound File to Your Game Using XACT and How To: Play a Sound. For detailed information on how to author audio in the XACT tool, including information on categories, variables, and other advanced features, see XACT Audio Authoring.
Why does calling GetCue from SoundBank never return a cue?
In your XACT project, you may have set a sound bank property called IncludeCueNames to false. For each sound bank in your project, this property must be set to true. Open XACT, load your project, and click each of your sound banks in the project tree view. Check the value of IncludeCueNames in the property pane as you click each sound bank. If any of these values are set to false, set them to true and rebuild your project.
What coordinate system does the XNA Framework use?
The XNA Framework uses a right-handed coordinate system.
Why do I get an exception when I try to use Storage classes?
One possible reason is that one of your operating system folders — especially %_NTDrive%\Documents and Settings\ — is mapped to a network drive. Storing player data or running titles from a network location is not supported in this release.
|For answers to more questions about XNA Game Studio and the XNA Framework, see XNA Creators Club Online.|