Skip to main content
GameDev.net gamedev.net
🔒 Locked

C++ Compiler For Pc, Xbox And Ps3

Started by vellamatic Jan 9, 2011 at 7:00 PM 12 replies 10.5k views
Original Post
vellamatic
vellamatic
Hi all,

I'm currently writing a game engine component for music. I'm writing this in C++ on PC. The IDE I'm using is Code::blocks while the compiler is gcc (on minGW). Everything's working fine and dandy on PC. Now I'm thinking of porting my program for use in Xbox and PS3. However I have no experience in this.

Is there a particular compiler that I should use which would make it easy for me to have a program that is compatible with all 3 platforms (i.e. PC, Xbox & PS3)? If not, which compiler should I use for which platform?

Any other non-compiler-related information about this issue would also be very much appreciated.

Cheers.

Alan.
The Communist Duck
The Communist Duck
The only real way to get a game onto Xbox is to:
a) Use XNA and Xbox Live Community Games or whatever it is. This requires C#.
b)Become a licensed developer.

PS3 development will now be possible with the key cracking and whats happened, but I have no idea if compilers have support for it yet. It would probably be a specialist one, however.
If you want official PS3 development, again you'd need to be licensed.
KulSeran
KulSeran
For PS3 homebrew (either with the new hacks, or if you just didn't upgrade your firmware and can still run linux) you can just use GCC.
For the actual PS3 development, you'd have to get a devkit from sony, and use their compilers (based off GCC if I recall).
For the XBOX, you'd have to use C# and XNA game studio to develop without a devkit.
With a devkit, the C++ code would be run through the regular Visual Studio CL compiler.

But that shouldn't be your concern. The bigger issue is that libraries that are "cross platform" between linux and windows, aren't always cross platform to the consoles. You'll have to change all your system calls (timers, threads, file io, sound, graphics, etc.) to use the APIs provided by each console's SDK. If you are using any middleware, make sure it runs on all those platforms.
MJP
MJP
If you ever do end up porting your library to consoles, you'll have a LOT bigger problems than compiler compatibility. But if for some reason you really want to prepare for that, then I would recommend making sure your code is compatible with VC++.
Hodgman
Hodgman
As has been posted, the console compilers are private, but the Xbox one will be "MSVC-like" and the PS3 one will be "GCC-like", so getting your code working in those two is a good start
vellamatic
vellamatic
Thank you all for your replies. You've been very helpful.


If you ever do end up porting your library to consoles, you'll have a LOT bigger problems than compiler compatibility.


Could you elaborate on this? What would be the biggest hurdles I could encounter when porting to consoles? KulSeran already mentioned system calls which would need to be tailored according to the particular system I'm working on. Is there anything else?

Alan.
phresnel
phresnel

Thank you all for your replies. You've been very helpful.



Could you elaborate on this? What would be the biggest hurdles I could encounter when porting to consoles? KulSeran already mentioned system calls which would need to be tailored according to the particular system I'm working on. Is there anything else?

Alan.


E.g., look at console specs. Wikipedia mentions "256 MB system and 256 MB video" for the PS3. Compared to that, my commodity PC is a monster (4096 MiB sytem and 1024 MiB video).
MJP
MJP

Thank you all for your replies. You've been very helpful.



Could you elaborate on this? What would be the biggest hurdles I could encounter when porting to consoles? KulSeran already mentioned system calls which would need to be tailored according to the particular system I'm working on. Is there anything else?

Alan.


Performance and memory footprint would likely be your largest concerns. Having a small memory footprint is obvious...memory is extremely tight on consoles and every MB counts. CPU performance is trickier...your code might be blazing fast on a beefy PC CPU with 4MB of L2, but grind to a halt on a weaker console CPU. On Xbox 360 it means using the vector units for any heavy-duty math, and making sure it can run well not on the main thread. On the PS3 you pretty have to run it on the SPU's no matter what you're doing so that you don't hog the single PPU.
vellamatic
vellamatic
Thanks guys. It looks like porting for consoles is no walk in the park.

My last query is about iPhone. I have no experience with Apple products but I realize that there is a big market for mobile casual games running on iOS. Does anybody have any idea how to start porting C++ code to this environment? I realize that there might be many steps to this but what are the key hurdles and where would one start? Anybody had to go through this?

Cheers all.

Alan.
Brain
Brain

Thanks guys. It looks like porting for consoles is no walk in the park.

My last query is about iPhone. I have no experience with Apple products but I realize that there is a big market for mobile casual games running on iOS. Does anybody have any idea how to start porting C++ code to this environment? I realize that there might be many steps to this but what are the key hurdles and where would one start? Anybody had to go through this?

Cheers all.

Alan.


You could take a look at this: http://www.airplaysdk.com/

It is not free however but offers portability between lots of platforms in C++, and they claim it is easy to manage too.

I have been tempted to take a look myself but iPhone development doesn't really interest me at the minute. Let me know what you think!
vellamatic
vellamatic
That looks very interesting ... and not prohibitively expensive. I'll investigate it further. Thanks!
Rattenhirn
Rattenhirn



Hi all,

I'm currently writing a game engine component for music. I'm writing this in C++ on PC. The IDE I'm using is Code::blocks while the compiler is gcc (on minGW). Everything's working fine and dandy on PC. Now I'm thinking of porting my program for use in Xbox and PS3. However I have no experience in this.

Is there a particular compiler that I should use which would make it easy for me to have a program that is compatible with all 3 platforms (i.e. PC, Xbox & PS3)? If not, which compiler should I use for which platform?

Any other non-compiler-related information about this issue would also be very much appreciated.

Cheers.

Alan.


Stick with GCC, turn the warning level all the way up and fix all warnings correctly (if possible at all). Avoid anything that is not inherently portable (low level data operations, reliance on type sizes, super fancy template/macro tricks, pragmas and intrinsics,...).

Abstract everything that's platform specific (file access, memory allocation,...) using callbacks or interfaces.

Then you're code should compile fine on consoles as well.

vellamatic
vellamatic

Stick with GCC, turn the warning level all the way up and fix all warnings correctly (if possible at all). Avoid anything that is not inherently portable (low level data operations, reliance on type sizes, super fancy template/macro tricks, pragmas and intrinsics,...).

Abstract everything that's platform specific (file access, memory allocation,...) using callbacks or interfaces.

Then you're code should compile fine on consoles as well.



Rattenhirn,

I don't use overly fancy templates and macros in my code. However I do use a number of boost libraries that implement such things. For example, I'm using the boost proto and fusion libraries that make heavy use of complicated templatization. I'm also using boost MPL that makes heavy use of macros. I'm quite sure that these libraries will also compile under MSVC (which seems to be the closest thing to the industry-standard for console gaming) ... if so they probably won't cause much problems on Xbox and PS3 ... right?

Alan.
Rattenhirn
Rattenhirn

Rattenhirn,

I don't use overly fancy templates and macros in my code. However I do use a number of boost libraries that implement such things. For example, I'm using the boost proto and fusion libraries that make heavy use of complicated templatization. I'm also using boost MPL that makes heavy use of macros. I'm quite sure that these libraries will also compile under MSVC (which seems to be the closest thing to the industry-standard for console gaming) ... if so they probably won't cause much problems on Xbox and PS3 ... right?

Alan.

Boost code is usually prepared to work with pretty much all compilers out there, so that should be ok.


Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.