View Full Version : Cross Platform Gaming
mrl14
05-21-2004, 07:57 AM
Has anyone attempted to create a cross platform game?
If so what kind of hurdles have you encountered? Also, which platform do you prefer to develop for (PC, Mac, Linux)
Thanks
ggambett
05-21-2004, 08:30 AM
Our games are developed in Linux, compiled to Linux and Windows from Linux, and from Mac to Mac.
Use the same compiler (even the same version if you can) in all the platforms. Use portable libraries. Encapsulate non-portable stuff and make several implementations (ie it's much better to have lots of #ifdefs in ONE class than spread throughout all your code). Beware of endianness differences. Beware of type size differences. Use a portable build system (ie make or custom scripts in a portable language such as Python).
Do not, I repeat, do not, develop on Windows. Linux (or Mac OS X) is far, far, far, far better as a development environment (in a broad sense, not as in IDE).
That's it :)
serg3d
05-21-2004, 09:37 AM
Originally posted by ggambett
Do not, I repeat, do not, develop on Windows. Linux (or Mac OS X) is far, far, far, far better as a development environment (in a broad sense, not as in IDE).
That may be true, but the problem is the cost (in time spent) of switching paltform. Also I'm developing for Symbian now, and to run EPOC emulator under Linux you would need Wine anyway...
Diragor
05-21-2004, 10:03 AM
ggambett - I haven't looked too far into it yet, so do you have some personal suggestions or pointers to information on cross-platform dev tools on Linux that can create both Linux and Windows executables? My primary target platform for just about anything will continue to be Windows but I'm really enjoying working in Linux, so that kind of setup would be cool.
ggambett
05-21-2004, 10:19 AM
Diragor : MinGW32. Get it here http://bitwalk.hp.infoseek.co.jp/download.html - the page is in japanese but just grab the RPMs. Then, just link with the usual .lib files you use on Windows (you need a separate tree for include/ and lib/ to put Windows libraries there, I use /usr/local/i386-mingw32 which I believe it's the default). I have even made stuff with Direct3D this way!
princec
05-21-2004, 11:25 AM
I use Java with LWJGL. Get working code to market faster. Covers the 3 main platforms. It would be difficult to argue that compiling and deploying Java is more difficult than C++, but I bet ggambett's going to try :)
My IDE is written in Java (like most Java IDEs) so it's available on all the 3 platforms too. And switching between one platform and another with a Java IDE is trivial, in the literal sense of the word.
Cas :)
ggambett
05-21-2004, 11:46 AM
Originally posted by princec
I use Java with LWJGL. Get working code to market faster. Covers the 3 main platforms. It would be difficult to argue that compiling and deploying Java is more difficult than C++, but I bet ggambett's going to try :)
No, I'm not. I know I can't convince you otherwise. Guys smarter than I tried to convince you about certain controls in certain game and failed, so why bother :)
mrl14 and diragor : bear in mind that Cas himself has stated that 25% of the people who download his game (whose name shall not be mentioned) can't run it. Of course, this huge rate of failure isn't as important as getting non-working code to the market faster! ;)
princec
05-21-2004, 11:49 AM
The 25% of people that can't run it don't have 3D cards... it has otherwise worked flawlessy. As I know from my logs :)
Cas :)
Coyote
05-21-2004, 12:21 PM
I've done some cross-platform game development from the Playstation to Windows, and I've done non-game cross-platform development from Windows to various flavors of Unix (mainly Linux & Solaris), in C and C++.
I disagree with ggambet's contention about not starting on Windows. Maybe it's just my comfort level, but it seems the development tools are much more mature and easy to use. This makes development much easier.
The trick is knowing what platforms you may be porting to in the future, and coding defensively to prepare for it. This is true on ANY platform... you may find yourself taking shortcuts based upon the current platform that will bite you in the butt later. Like using some built-in Windows functionality or types. Socket coding is an example that springs to my mind --- Winsock programming is extremely similar to socket code on most Unix platforms. But you need to be aware of the differences going in so you can code around them, using custom macros and definitions that compile to different targets where needed.
It really comes down to having done it once or twice. After you've been through that pain a couple of times, you'll have a pretty good feel for what subset of your language to stick with, and where to build your API layer.