When I released my first Xbox game (Arcadian Tactics), I was suggested to create a Beginner Guide to start developing Xbox games. Well, I am not the most experienced Xbox developer, in fact I think that I am one of the LEAST experienced Xbox developers today
But anyways I am going to make a mini-guide explaining what I learnt in this time. My goal is to make things easier to anybody who wants to start developing games for the Xbox, explaining my own experience. Also, this thread could be used to ask beginner questions about how to start Xbox development.
First of all, I will say that if you want to make Xbox games, the best option is using the C or C++ programming language, so I am going to focus in this. Anyways, if you don't know anything about C or C++ don't be discouraged, you have other methods to create games. For example, you can use OpenBOR to make a Beat'm-up game, and play it with the marvelous "Beats of Rage" port for Xbox (it can play any BOR game, not only "Beats of Rage"). I saw a game based in the Asterix characters made with this technique, which was pretty good!!. The same can be applied to Mugen (you can create a Mugen game and play it in Xbox with Xmugen) or even create a Python game and play it in XBMC. But let's focus in the main thing: creating native Xbox games (with C or C++).
The first thing that you must decide is which kind of development kit are you going to use. As far as I know (please, if you know more options, write an answer to this post!!) there are two main options: XDK and OpenXDK. Let's analyze them:
- OpenXDK: it is a free development kit for Xbox. Its best point is that it is free. Its worst point, as far as I have seen, is that its state is not as mature as the official XDK, and the code generated with OpenXDK is not as optimal. What does this mean? Well, this basically means that a game made with OpenXDK will run slower, with less frames-per-seconds, than a game made with the official XDK. So, if you are planning to make a game that does not need to update and refresh the whole screen many times per second, you can use OpenXDK. But if your game NEEDS to update and refresh the whole screen many times per second, maybe OpenXDK is not enough for you.
Examples: if you are planning to create a game like my Arcadian Tactics, or a chess game or something like that (the screen does not change a lot) you can use OpenXDK. But if you are planning to create a game like "Sonic" (the whole screen scrolls very fast all the time), be warned that OpenXDK will force you to use all your skills to optimize the game and make it fast.
I will let you know an advice, if you finally use OpenXDK. There is a marvelous trick named "dirty rectangle", which can boost your frames-pre-seconds. The trick is, updating only the area of the screen that has changed since the last time that you drew it. You don't need to refresh the whole screen! For example, if you have an static background, and a 32x32-pixel character that moves, you only have to refresh each frame the old position and the new position of your character (you don't need to refresh the whole screen every frame). This will boost your game. This trick is very good, and you can use it both with OpenXDK and XDK, but if you use OpenXDK you sure must use it, or your game will be slow.
If you are going to use OpenXDK, what kind of environment will you need? In my opinion, if you have a Windows machine, the easy solution is installing Cygwin (it is a very powerfull pseudo-Linux environment). Here are a couple of usefull links:
Following these instructions you will have a Cygwin system with a C/C++ compiler and the OpenXDK libraries, so you will be ready to create games.
- The other option is using the official Microsoft XDK. The bad thing of this option is that XDK is not free. The good thing is that the code generated by XDK is better (faster) than the code generated by OpenXDK. What do you need to install if you want to use XDK? Well, of course you will be forced to use Windows. As far as the environment, you can use Microsoft Visual Studio .NET 2003. I am not sure if you can use other versions of Visual Studio, so if someone knows it, please tell us). I guess that later versions of Visual Studio .NET (2008 for example) can work too, but I am not sure. Furthermore, I don't know if there are older versions of XDK which can work with older versions of Visual Studio. The only thing that I can say is that people I know, have used allways this combo: Windows + Visual Studio .NET 2003 + XDK. This is enough to create your games.
Once you have selected your programming language (we are focusing in C/C++) and your IDE (Cygwin+OpenXDK or VisualStudio.NET+XDK) you need to decide which kind of technology are you going to use. In other words: are you going to make a 2D game, or a 3D game? You will need different libraries in each case. Again, I am going to analyze these two options:
- If you are going to create a 2D game, I recommend that you use the fantastic SDL library, which has been ported to Xbox!! Of course this is not the only one option, but in my opinion it is the easier one. The good thing of the SDL library is that it has been ported to lots of systems (Windows, Linux, Xbox, Sony PSP, Nintendo Wii, Android for mobiles...). So, if you create a game in SDL, you can port the game very easily to any other of these systems, and 90% of the code will be valid! This has several advantages: one the one hand, you can create your game in Xbox and Windows at a time (I did this with Arcadian Tactics). It is very easy to debug the game in Windows, and later you can port it to Xbox easily (if you try to make generic code, almost everything in your code will be reusable).
On the other hand, SDL makes easy to create games... and to port games!! If you don't want to create a game from scratch, maybe you can try to PORT a game that someone made using SDL. Simply be sure that the game does not use any other strange dependency. For example, if someone made a game which used "SDL and Qt.4", you will not be able to port it easily, because SDL is ported but Qt.4 is not ported for Xbox. But if you find an opensource game made only with C/C++ and SDL, you can port it to Xbox easily.
By the way, if you use SDL to port a game (or if you compile it for Windows and Xbox as I did) be warned that the PATHS in Xbox are different than in other systems. In Xbox, you must write "D:" at the begining of every path, and it will be the relative path of your executable (not an absolute path). If you have made a port and it doesn't work, the most common mistake is this
What do I need to install, if I want to use SDL to make a 2D game? Well, you need the SDL libraries ported to Xbox. Maybe you will find them as "SDLx". Besides the SDL library, install also the SDL_image and the SDL_ttf (if you want to write in the screen) which also have been ported for Xbox. The port is diferent for XDK and OpenXDK, so whenever you search for the SDL libraries, search for the ones that have been compiled for the environment that you are going to use, and simply put them in the path that your compiler is going to use.
With SDL, you will be able to create awesome 2D games!
- On the other hand, if you are planning to create a 3D game, SDL will not be enough. It's true that SDL supports 3D graphics by using OpenGL, but this 3D support with OpenGL has not been ported to Xbox (yes, it's a shame). So if you want to create a 3D game you will need to use a different approach: Direct3D. Direct3D is a part of the famous DirectX library for Windows, so again you can develop a game in Windows using Direct3D, and it would not be very difficult to port it to Xbox (again, if you don't have a debug Xbox, this is one of the best methods in my honest opinion). The bad thing is that this games may only be ported to Windows/Xbox. The other systems that I mentioned (Wii, PSP, Android...) are more OpenGL-based, so the port of your game to these other systems will not be so immediate.
My advice, if you don't own a debug Xbox and you are going to create a Xbox game (2D or 3D) is to develop the game simmultaneously for Windows and Xbox, trying to use the same source code for both two systems. This makes debugging very easy.
For example, in Arcadian Tactics I created a "common" class that includes all the routines which I will use in all of my games (initialization of the screen, filling the arrays with ths status of every button of the controllers...). This "common" class is different for Windows and for Xbox. Once made this... all the rest of the source code is THE SAME for Windows and Xbox. So, I simply developed the game for Windows, debugged it in Windows, played it in Windows, and finally... compile it for Xbox in your Visual Studio.NET with XDK or in your CygWin with OpenXDK. That's all, you have your Xbox game!!
So, my advice if you don't have a debug Xbox (I don't own one) is to install in your PC two programming environments: your XDK/OpenXDK environment (with Cygwin or VS.NET as we said) to compile the game "for Xbox", and another environment "to compile the game for Windows" (I used the free compiler Dev-Cpp for doing this). This way, you can debug in Windows, and play in Xbox.
Come on, creating a game is not as difficult as you can think, and there is people here that can help you in these forums if you face any problem!!