• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
evanvlane

How are games compiled for multiple operating systems at once?

7 posts in this topic

Hey everyone,
I'm new to programming-- I've taken an intro to programming course this semester and I'm taking one focused on C++ next semester.
I want to begin working on small games, and I'm interested in how the games that are shared on Humble Bundle are made for most major operating systems. I figure they're not rewritten for every framework. What's a common &/or easy-to-use toolchain to develop for multiple operating systems at once?

Thanks!
0

Share this post


Link to post
Share on other sites
Thanks L & Servant!
I think I needed both the long and short of it. Thanks for the summary and a really good primer. :)
1

Share this post


Link to post
Share on other sites
Just to add to the above posts...while you can certainly author platform-specific code using the pre-processor, in practice that's really messy. It's not hard to imagine how convoluted a real window-creation function would look if you just put the code for multiple platforms all in the same places with #if's and #ifdef's thrown in everywhere. So it's generally better (IMO) to avoid that whenever possible by using other means to selectively compile code. For instance at my current company, we tag platform-specific cpp files with a suffix that tells our build system what platform it should be compiled for. That way each file can contain a whole bunch of implementation-specific code for a single class or a group of related functions. Edited by MJP
2

Share this post


Link to post
Share on other sites
In practice, you will also have to be careful when using new features of your language of choice (like C++11), because even the same compiler may have different parts implemented. Current example: C++11 threading features are present in GCC on Linux, but not yet on MinGW, same goes for a triviality like std::to_string. So if you want to create multi-platform code, it's a good practice to compile and test often on all your target platforms. This will show you were to implement workarounds for differences in your dependencies.
1

Share this post


Link to post
Share on other sites
Just what Servant of the Lord said, code is written so that it will work across multiple platforms - which for the most part isn't too difficult as both the PS3 and 360 supply SDKs written in C++. You do have to be aware of various platform idiosyncrasies though, endian systems for example.


On the last project I worked on we used different solution and project files dependent on the platform. We had a script that automatically generated the project files from the main PC solution.
0

Share this post


Link to post
Share on other sites
[quote name='MJP' timestamp='1355288428' post='5009703']
Just to add to the above posts...while you can certainly author platform-specific code using the pre-processor, in practice that's really messy. It's not hard to imagine how convoluted a real window-creation function would look if you just put the code for multiple platforms all in the same places with #if's and #ifdef's thrown in everywhere. So it's generally better (IMO) to avoid that whenever possible by using other means to selectively compile code. For instance at my current company, we tag platform-specific cpp files with a suffix that tells our build system what platform it should be compiled for. That way each file can contain a whole bunch of implementation-specific code for a single class or a group of related functions.
[/quote]
Another way of doing this is by telling the make/solution/project/build script mechanisme which platform it's target is and then include platform specific code files. No need to specially tag cpps or h files, if they are in the target make/solution/project/build script as long as they are in there it will be compiled in for that platform. However you would still want to use the preprocessor in certain cases where implementation is only slightly different depending on which platform you compile for, and we are getting to the int changing values stuff for particular platforms here. You don't have to rely on the pre processor commands build in to the compiler with this matter either as you can specify per make/solution/project/build script what defines it should set.

You will also want to invest in some interface design as well so that the code that is platform specific presents the same interface to the rest of the code so that the system is easy to interact with. Edited by NightCreature83
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0