Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

The answers to this cross-platform related question are useful, however I want my (C++) game to run on Windows and Linux (and be packaged for Ubuntu) only. I'm not interested in platforms like mobile or consoles.

Are there any specific tips or suggestions for this case?

Also, if I get the game to work on linux, is it difficult to add support for OSX?

Updating with more information:

It will be a 3D game simulating the motion of spacecraft in the solar system. We will use Ogre3D for the graphics. We're still in the design phase, so there's no code written yet.

share|improve this question
1  
You should me more specific. –  iamcreasy Sep 6 '11 at 11:16
1  
From my experience, use solid C++ practices avoiding implementation defined behaviour, and build it just for one O/S. Once your ready, you can port it. Obviously using libraries that are cross-platform (GLFW for example) from the start will decrease the amount of work later; but don't let it hinder getting everything else done first. –  Daniel Sep 6 '11 at 11:17
    
Ogre should take care of your cross-platform woes.. or most of them, anyway. Just don't use windows APIs for anything and you should be ok. =) –  Jari Komppa Sep 6 '11 at 12:37
    
Oh well this renders my answer useless, there aren't any competent 3D implementations for JavaScript yet, I think. –  akled Sep 6 '11 at 12:40
    
Is there any reason the general cross-platform guidelines don't answer your question? –  user744 Sep 6 '11 at 17:30
show 3 more comments

3 Answers

up vote 1 down vote accepted

One thing you might want to keep in mind from the start is that if your game relies on floating points physics calculations the behavior on one OS could be different than on the other without some careful considerations. This is not dramatic if your game doesn't rely on perfect synchronization across different platforms such as multiplayer RTS games and will only be apparent in some edge cases but it's still something I consider important to keep in mind ahead of time.

Other than that, using C++, cross-platform specifications (OpenGL if you ever need it, I don't know Ogre3D) and cross-platform librairies (and of course the STL where possible) should pretty much help you make your game platform-agnostic. Just make sure to abstract implementation details (Window management, threading, networking, etc.) during your conception and all you'll need is some solid testing on all platforms.

share|improve this answer
    
Actually there will be lots of floating point physics calculations, and we want them to be very precise. However we are not planning to include multiplayer. If there is a site or resource that details the differences you talk about, could you please direct me to it? –  Marco Giancotti Sep 7 '11 at 10:18
1  
This article: gafferongames.com/networking-for-game-programmers/… explains the problems in this situation for multiplayer synchronized lockstep games. Both the article and the comments are very insightful. In your case howerever, synchronization is a non-issue so floating point physics calculations across platforms isn't THAT dramatic. –  pwny Sep 7 '11 at 20:44
    
I'll just write the relevant code and do some tests to see if it's acceptable, then. Thank you for the link and the advice! –  Marco Giancotti Sep 7 '11 at 21:04
    
Good luck, I'd love to hear about the results! –  pwny Sep 7 '11 at 21:09
    
Does this happen between different OSes under the same architecture? I thought FP results are consistent under the same platform. –  kaoD Sep 8 '11 at 2:14
add comment

I guess you could use panda3D or irrlicht

share|improve this answer
    
Hum is there a good reason to suggest to use panda3D or irrlicht instead of Ogre3D ? I'm currently working on my own game with Ogre3D and I compile each version on Windows, Linux and OSX without problem. (I had some difficulties to configure it on OSX but this is because I don't want to use Xcode and because I needed C++0x). –  Valkea Sep 6 '11 at 15:16
    
@valkea I didn't try neither of those engines, I was just suggesting there are other possibilities. –  Ali.S Sep 6 '11 at 15:50
    
This answer should really be a comment. –  thedaian Sep 6 '11 at 16:08
2  
No, this is an answer, just a bad one. Bad answers should be voted down or fixed, not made into comments. –  user744 Sep 6 '11 at 17:28
add comment

I currently work in the GIS industry, and so many of our software libraries (e.g. GDAL) are designed to be cross platform. They cause nothing but headaches

The best way to write applications intended for multiple platforms is to architect them such that platform dependencies are abstracted away completely. Write code that is easy to port, rather than cross-platform. You'll save yourself a lot of headaches and wasted time trying to figure out why you umpteen millionth#ifdef WIN32 doesn't work properly.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.