Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Cross-Platform Game Project Converter

The conversion process creates a new game project of the appropriate type. The new game project is created in the same folder as the source project and shares 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 it greatly simplifies the process of converting a game to the corresponding platform. Specific code changes, however, are still required. For example, if a Windows game is controlled by the keyboard and mouse, the converted game is not changed to respond to an Xbox 360 game controller. You can use the cross-platform conditional compilation symbols to create sections of code that execute only on the appropriate platform.

Cross-Platform Game Conversion

To convert a game for another platform

  1. Load the game into a supported version of Visual Studio tools.
  2. On the Project menu, select the Create Copy of [project name] item (where the [project name] is the name of the game project).

    The presented items in the Project menu vary according to the designated platform of the currently selected project:

    WindowsXbox 360Windows Phone

    Create Copy of [Project Name] for Xbox 360

    Create Copy of [Project Name] for Windows Phone

    Create Copy of [Project Name] for Windows

    Create Copy of [Project Name] for Windows Phone

    Create Copy of [Project Name] for Windows

    Create Copy of [Project Name] for Xbox 360

    When complete, a new version of the game project is added to your solution. It is named for the platform (for example, Xbox 360 Copy of [Project Name] or Windows Copy of [Project Name]). The new game project is selected.

  3. Press F2 if you want to rename the project from the name given by the conversion utility.
Bb976061.note(en-us,XNAGameStudio.40).gifNote

The solution may only contain one copy of a project for each platform. Nonconforming solutions are unable to correctly synchronize projects and produce an error message during conversion.

Changes Made to a Project During Conversion

  • All references to XNA Framework assemblies are replaced by their equivalents for the other platform.
  • All original configurations are replaced by default configurations for the new platform.
  • The XnaPlatform project property changes to that of the new platform.
  • The Content Build Compression properties are set to the default values for the new platform.
  • The ProjectGuid property is replaced. This is not the same as the GUID assembly attribute (usually found in AssemblyInfo.cs), which is not changed.
  • The default Platform property and project output type settings are replaced with values for the appropriate target platform.
  • Establishes the Game Profile and C# version settings for each game project according to the platform defaults.

Linked Projects After Conversion

The new project created by the conversion wizard shares code, content, and settings from the original game project through links.

Projects copied through the conversion wizard are linked so that:

  • An item or folder added to any project is also added to the other projects.
  • An item or folder renamed in any project is also renamed in the other projects.
  • An item or folder deleted from any project is also deleted from the other projects.

All other actions not specifically cited above are not synchronized between projects. Of particular note, this includes the following actions:

  • Excluding an item from a project has no effect on other projects. This is useful for items that are inappropriate for one or more platforms, yet needed for another platform (or platforms). For an example, see How to: Create a Cross-Platform Game Solution.

  • Changing properties in a project or folder has no effect on other projects.
  • Adding or deleting references to content projects in the Content References folder has no effect on other projects.
    Bb976061.note(en-us,XNAGameStudio.40).gifTip

    Folders that are empty (as when they are first created) are not synchronized between projects. Once items are placed into a folder (so that it is no longer empty), the folder is synchronized across all other projects.

References the Conversion Utility Cannot Replace

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

    Bb976061.note(en-us,XNAGameStudio.40).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 to the Xbox 360 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 are deleted. The conversion wizard sends a warning to the output window when this occurs.
  • COM file references are deleted. The conversion wizard sends a warning to the output window when this occurs.
  • 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 causes compile-time errors. The conversion wizard sends a warning to the output window when this occurs.

    Bb976061.caution(en-us,XNAGameStudio.40).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 for the Xbox 360, 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 fail.

  • Usage of APIs that may be incompatible with the Game Profile capabilities of the new platform. For example, a Windows game that calls graphics APIs that function for the HiDef profile will not work after being converted for the platform, which only supports the Reach profile. In this case, further conversion of the code design is needed to use APIs compatible with the lower-capability Reach profile.

  • References to content projects in the Content References folder of the project, if they contain content that is incompatible with the project's platform. For example, an Xbox 360 project may reference content that is too complex for use on Windows Phone. You may wish to create a new content project that contains lower-resolution versions of the same assets for Windows Phone. After copying the Xbox 360 project to a Windows Phone project, change the items in the Content References so that the project uses the content project containing the lower-resolution assets.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.