Deploying an Xbox 360 Game
Describes how XNA Game Studio can copy executable and media files to the Xbox 360 retail console once you are ready to deploy them. As you develop your Xbox 360 game, it is convenient to be able to deploy your game executable to your console quite frequently for testing purposes.
Before deploying, though, you will first have to establish a connection between the console and your computer, using the XNA Game Studio Device Center dialog box. For a detailed explanation of this process, see Connecting to Your Xbox 360 Console with XNA Game Studio 3.0.
|For more information about troubleshooting deployment to your console, see Troubleshooting Xbox 360 Game Deployment.|
Deploying Your Game
This procedure describes the steps needed to deploy your Xbox 360 game from XNA Game Studio to a console, assuming that you have successfully established a connection between that console and your computer.
|An XNA Framework game deployed to the Xbox 360 console cannot exceed a maximum size of 2 GB, which also means that any single file you deploy must be smaller than 2 GB.|
To deploy your Xbox 360 game
- Load an Xbox 360 Game project into XNA Game Studio.
- Make sure the Output window is visible so you can follow the progress of your deployment in detail, and so you can tell where a problem occurred, if one does. To display the Output window, from the View menu, click Output, or press CTRL+W and then press the letter O key.
- From the Games page of the Xbox 360 Dashboard, select Games Library and press the A controller button.
- From the Games Library page, select My Games and press the A controller button.
- Select XNA Game Studio Connect and press the A controller button.
Select Launch and press the A controller button. This displays the Waiting for computer connection page.
In XNA Game Studio, deploy the game by right-clicking the solution name and selecting Deploy Solution or selecting Deploy Solution from the Build menu.
During this process, both the Output window of XNA Game Studio and the Connect to Computer screen display the deployment progress by displaying a list of the deployed files and additional information.
Press B to return to the Games Library. From there, select My Games and press the A controller button. This displays a list of available games.
- Select the game you just deployed from this menu and press the A controller button, then choose Play Game and press the A controller button again to start the game.
Incremental deployment is automatically enabled for XNA Game Studio projects. This means that the IDE tracks which files have already been deployed to your Xbox 360 console, and subsequently only deploys files that have been updated. Also, if a file that was part of the previous deployment is no longer in the game, it is deleted from the console during deployment. (This only applies to files that were previously deployed, not to files that were generated on the console.) The Output window reflects exactly what actions were taken during deployment.
A full deployment, which deletes any previous game files and copies the entire game to the console, is triggered by the following conditions:
- This is the first time the project has been deployed.
- A different configuration is being used than in the last deployment to this device.
- The game was deleted from the Xbox 360 console since the last deployment.
- The solution has been cleaned since the last deployment. (For more information about cleaning the solution, see the "Cleaning the Solution Before You Build" section below.)
- The last deployment to the device was from a different source than the currently loaded solution, such as a copy on another Windows-based computer or a .ccgame package.
If you cancel during a deployment, some files may not have transferred which will leave the game in an indeterminate state. The next incremental deployment will behave as if the last deployment never occurred and update the correct files on the Xbox 360 console.
Cleaning the Solution Before You Build
Cleaning your game solution before you build removes all intermediate and output files generated by the build, which forces the next build to regenerate everything.
If you select Rebuild on the Build menu, the build automatically regenerates everything, but you may also want to clean your solution before doing a build. This is particularly true if you are experiencing unexpected build errors.
In Microsoft Visual C# Express Edition, the Clean Solution option is not included in the Build menu by default, but you can easily add it if you want to make cleaning your solution convenient. Here is how to do it:
- In XNA Game Studio, right-click the menu or toolbar at the top of the window and click Customize.
- In the Customize dialog box, click on the Build menu (or on any other menu where you want to add the command). This opens the menu and leaves it open.
- From the Customize dialog box, click the Commands tab and select Build from the Categories pane on the left. Then, from the Commands pane on the right, drag the Clean Solution command into the open Build menu and drop it where you want it.
- Close the dialog box.
Now, whenever you want to clean the solution, you can click Clean Solution from the menu where you added it.
Managing Several Xbox 360 Consoles with XNA Game Studio Device Center
Using the XNA Game Studio Device Center dialog box, XNA Game Studio supports deployment and debugging on multiple Xbox 360s.
The XNA Game Studio Device Center does the following:
- Creates connections between your Windows-based computer and each of your Xbox 360 console devices. If you have more than one Xbox 360, you can use XNA Game Studio Device Center to create connections between your Windows-based computer and each of your Xbox 360 console devices. Each connection allows you to deploy and debug XNA Framework 3.0 games to a specific Xbox 360 console device.
- Manages the list of available Xbox 360 console devices, allowing you to add and delete devices from the list of devices available for deployment.
- Allows you to set the default Xbox 360 console device to use for deployment. Similar to the default printer in Microsoft Windows, the default Xbox 360 console device is the device XNA Game Studio will deploy to, unless you specifically choose a different Xbox 360 console device to deploy to. If there is only one Xbox 360 console device, it will be set as the default device.
- Stores the list of Xbox 360 console devices on a per-user basis. Each user has a different list of Xbox 360 console devices they can deploy to, and a different default device to use for deployment.
XNA Game Studio installs the XNA Game Studio 3.0 Device Management Toolbar into Visual Studio. The XNA Game Studio 3.0 Device Management Toolbar does the following:
- Gives easy access to the XNA Game Studio Device Center dialog box from within Visual Studio by clicking the Launch XNA Game Studio Device Center button.
- Allows you to choose a specific Xbox 360 console device to deploy to using the XNA Game Studio Deployment Device drop-down list. This is used if you wish to deploy to a different Xbox 360 console device than your default device.
The XNA Game Studio 3.0 Device Management Toolbar automatically appears within Visual Studio when an Xbox 360 Game project or Xbox 360 Library project is loaded in supported versions of Visual Studio tools.
|If your startup project is not an Xbox 360 or Zune project, most of the toolbar buttons will be unavailable. To make these buttons available, change your startup project to an Xbox 360 Game or Library project.|
For more information about how to add Xbox 360 console devices to the XNA Game Studio Device Center dialog box, see Connecting to Your Xbox 360 Console with XNA Game Studio 3.0. For more information about using the features of XNA Game Studio Device Center, see Using XNA Game Studio Device Center.
Managing Multiple Xbox 360 Deployments
As noted above, XNA Game Studio Device Center offers the facility to choose a specific Xbox 360 console device for deployment. This also enables you to deploy your game to multiple Xbox 360s. This supports testing and debug of networked games.
If you wish to execute the same game instance on all Xbox 360 consoles, you can deploy the same build to all consoles.
However, if you wish to debug and modify one instance of the game while the game continues to execute on all other consoles, you can accomplish this by using a unique configuration to build and deploy the instance you wish to modify. This is an advanced scenario, but one that is common for debugging networked games.
If you are unable to deploy your Xbox 360 game successfully, see Troubleshooting Xbox 360 Game Deployment.