Export (0) Print
Expand All

Cross-Platform Game Project Converter

XNA Game Studio 2.0 assists the process of converting a Windows game to an Xbox 360 game, or an Xbox 360 game to a Windows game.

The conversion process creates a new game project of the appropriate type. The new game project will be created in the same folder as the source project, and will share content and settings from the original game project.

Limitations of Game Conversion

The conversion utility is not meant to be an end-to-end conversion, but greatly simplifies the process of converting a game to the corresponding platform. Specific code changes will still be required. For example, if a Windows game is controlled by the keyboard and mouse, the converted game will not be changed to respond to a Xbox 360 game controller. You can use the #if directive with the symbol XBOX or XBOX360 to create sections of code that will only run on the Xbox 360. Step 7 of How To: Draw a Sprite contains an example of this syntax.

To Convert a Windows Game to an Xbox 360 Console Game

  1. Load the Windows game into a supported version of Visual Studio tools.
  2. From the Project menu, choose Add Copy of [project name] for Xbox 360, where the [project name] will be the name of the Windows game project.

    The following dialog box will display:

    Bb976061.UsingXNA_CrossPlatformConvert_Xbox_2(en-US,XNAGameStudio.20).png
  3. Click OK to begin the conversion process.

    When complete, an Xbox 360 version of your Windows game project will be added to your solution. The new Xbox 360 game project will be selected.

  4. Press F2 to if you wish to rename the project from the name given by the conversion utility.

To Convert an Xbox 360 Console Game to a Windows Game

  1. Load the Xbox 360 console game into Visual Studio.
  2. From the Project menu, choose Add Copy of [project name] for Windows, where the [project name] will be the name of the Xbox 360 game project.

    The following dialog box will be displayed:

    Bb976061.UsingXNA_CrossPlatformConvert_Windows_2(en-US,XNAGameStudio.20).png
  3. Click OK to begin the conversion process.

    When complete, a Windows version of your Xbox 360 console game project will added to your solution. The new Windows game project will be selected.

  4. Press F2 to if you wish to rename the project from the defalt name given by the conversion utility.

Changes Made to a Project During Conversion

  • The content project will be shared between the Windows and Xbox 360 projects. Expanding the content project in one node in Solution Explorer will collapse the content project in other nodes.
  • All references to XNA Framework assemblies will be replaced with their equivalents for the other platform.
  • All original configurations will be replaced with default configurations for the new platform.
  • The XnaPlatform project property will change to that of the new platform.
  • The ProjectGuid property will be replaced. This is not the same as the GUID assembly attribute (usually found in AssemblyInfo.cs), which will not be changed.
  • The default Platform property and project output type settings will be replaced with values for the appropriate target platform.

References the Conversion Utility Cannot Replace

  • HintPath metadata (added using browse-to-file) and strong name references will be changed into simple-named references.
  • Project references to non-XNA Framework projects will be deleted.

    Bb976061.note(en-US,XNAGameStudio.20).gifNote

    Unlike references to non-XNA Framework projects, all referenced XNA Framework game or game library projects are recursively converted. This means that if an XNA Framework project references another in the solution (with a project-to-project reference), conversion of the referencing project automatically converts the referenced project. The result is the converted copy of the first project referencing the converted copy of the second project.

    For example, if you are converting a Windows game that references a Windows game library in the same solution, conversion also occurs for the Windows game library. After a completed conversion, the result is an Xbox 360 game (a converted copy of the Windows game) that references an Xbox 360 game library (a converted copy of the Windows game library).

  • COM references will be deleted.
  • Web references are removed, possibly resulting in compile time errors for the converted project. For example, any code that instantiates a Web reference-related class or invokes its methods will cause compile-time errors.

    Bb976061.caution(en-US,XNAGameStudio.20).gifCaution
    If you need to remove a file from only one project, use the Exclude from Project command rather than the Delete command. The Delete command removes the file from disk, making it inaccessible to the other project.

Changes that May Be Necessary after Conversion

  • In some cases, a converted reference (for example, a strong name reference) may fail to resolve. If this happens, either delete the reference or replace it with a reference to an assembly version for the correct platform.

    For example, if a reference to System.Data (often added automatically to Windows projects) was converted, you must remove it because System.Data are not supported on Xbox 360. However, if the converted reference was to something like a third-party game engine, you might be able to change the reference to an Xbox 360 version of the engine instead.

    If a converted reference is deleted, ensure that any platform-specific code does not depend on that reference.

  • Any code specific to one target platform, for example, mouse-based user input in a Windows game, will not be converted for the other platform. You must manually change this code to use an Xbox 360-compatible input device.

    Other common examples include any .settings files (due to missing types), code generated from any Windows Forms in the project, and certain types of resources. For example, string or binary resources are fine but bitmap resources will fail.

  • Changes to code files that exist in both projects will automatically be reflected when each project is built. Any code files that are added to a project after conversion will only build in that project. Use Add Existing Item to add new code files to the other project.

Community Additions

ADD
Show:
© 2014 Microsoft