xBox 360 and Windows Development
From what I understand the whole point of XNA is to provide an environment for developers to develop games that can run on both the xbox 360 and Microsofts Windows XP. However, when I create a new project I notice that both the xbox and Windows platforms have two different starter projects. If I create a windows project will it still be able to run on an xbox? Or should I create an xbox project and a windows project and just use the same source files?
Another quick question, please correct me if I am wrong, but xbox 360 support is not supported or implemented in XNA yet correct? So even if I create an xbox 360 project, I can't use it till the final release of XNA? That is why I posted this, because I want to develop it on Windows till the final XNA comes out with 360 support. I want to be able to test the project while developing it instead of spending 2 months working on it and not being able to test it.
Thanks in advance!
Scionwest
In the first version of XNA Game Studio Express, you will need to develop your Xbox 360 and Windows games in separate projects. However, in most cases, you can use exactly the same code in both projects.
Since you cannot actually debug your game on the Xbox 360 until after we launch and you can get an XNA Creators Club subscription, you should begin by creating a Windows Game project. This will allow you to get started right away developing and debugging your game. When you are ready, you can begin porting your code to the Xbox 360 by following these steps:
- Create a new Xbox 360 Game project (if your Windows project is called "FantasticGame", then you might consider calling the new one "FantasticGame360").
- Right-click the project node in the Solution Explorer, and select Add | Existing Item...
- Select the code files from your Windows Game project, click the little arrow on the "Add" button, and select "Add As Link".
- Repeat for all files in the original project (including content).
- After adding content files, ensure that their properties are correctly set as XNA Content, etc.
By using the "Add as link" feature, you are including the Windows Game project source files in the Xbox 360 Game project (not making copies). This means that although you have two projects, the source files are shared between them.
What you'll want to do for now is create an Xbox 360 version of your game project, and occasionally try compiling that other project. That way, you'll be able to detect any code that you've written that is not portable. Almost all of the XNA Framework API is exactly the same on both platforms, but you still need to compile two different projects. If you run into something that needs to be different between the platforms, you can use conditional compilation.
eg,
#if XBOX360
Debug.WriteLine("This is Xbox 360 code.");
#else
Debug.WriteLine("This is Windows code.");
#endif
The XBOX360 symbol is already defined by default in Xbox 360 game projects.
Before you (or anyone else) complains that two projects with the same source code is dumb, and why can't you have just one project, and this should be easier.... Well, I agree with you. Unfortunately, it's a more complicated a problem to solve than you probably would expect, and we didn't have enough time to work through all the little details for the first version. It's pretty easy to get the same project to compile for both platforms, but there are a bunch of other features that just won't work right when you have a project like that. Trust me when I say that it's really important to us that we find a way to make it happen -- and soon! For now, though, you'll have to live with super-portable source code. That's still not too shabby!
To give you an example, the Spacewar starter kit uses exactly the same source code for both Xbox 360 and Windows. After launch, we'll show you a few more starter kits that are the same way.
Creating an Xbox 360 game using the beta is a very good representation of what you'll have after launch. You can compile your project with Beta 2 to see what is included and what isn't. The main differences are in the .NET Compact Framework for Xbox 360. It is a subset of the .NET Framework, so you may run into portability issues if you add references to your project outside of the XNA Framework.
I hope this helps clarify some things. Sorry if it's not quite the best solution right away, but we are working on making it better/easier in a future version.
--Stephen
Personally I think the idea of a windows only and x-box only project is a good idea, but it would be great to have a dual format project as well. I can't wait for the full product launch. Just a couple of questions:
1. is xbox live the only way to distribute your project?
2. will the ability to deploy to your xbox be available in the uk at the same time as in america?
Anyway keep up the good work!
1. I believe Live is only used for verifying Creator Club membership and downloading the XNA game launcher/.NET Framework when developing XNA games. You have to distribute the project via email or uploading it somewhere and having people download it. Also, you have to distribute the code and all assets, not the exe (that'll come soon hopefully (along with XNA Live Arcade - hint, hint
)) Live is not involved in distributing games at this time (we're holding our breath though)
2. That'll have to come from an MS person.