• 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
AaronWizardstar

How much of Boost do you use?

21 posts in this topic

I needed a certain kind of library and saw one of Boost's libraries recommended over and over, so I've began installing Boost.
 
Having Boost has led me to thinking about all the other libraries in Boost I could be using. Like replacing all my maps with unordered_maps and replacing all my iterator-based for lines with foreach. It's a bit overwhelming since Boost introduces so many attractive features, but I have to learn its libraries first and also figure out where they fit into my existing code.
 
"Boostifying" a project would probably be impractical if it has a deadline or is made by a team, so I'm asking more from the perspective of an individual hobbyist developer.
 
So to all of those whose projects depend on Boost, how much of its libraries do you actually use?
1

Share this post


Link to post
Share on other sites

I'm still using boost smart pointers, but it's on my todo to replace them with the C++11 ones.

Also, one part of my code uses boost::hash, but I plan to replace that with std::hash.

I've moved away from boost's assert as well, since I have my own assert code.

 

Other than that, I'm still using boost::filesystem, and recently needed to (unfortunately) add boost::any.

0

Share this post


Link to post
Share on other sites

Since a number of the common parts of boost hade it into TR1 and C++11, I use it a lot less.

 

Still, I'm using boost::filesystem a fair bit, and boost::spirit for a number of complex parsing tasks.

2

Share this post


Link to post
Share on other sites

Boost has some nice items which I have used in the past but many of them have been moved to C++11 as Simon mentions above.  For a game I generally try to avoid external dependencies as much as possible but things like:  Boost serialization, ASIO and filesystem are pretty tempting when you need something to get a job done.  Of course there are other standalone libraries which can be used instead, some of them are preferable in some ways also.  It is really all a case of what you need, what your environment is like etc.  Some examples:

 

ASIO- far beyond networking, I've used it to write daemonized multicore event driven data processing systems that were freaky scary but thanks to the ASIO framework it was just a matter of plugging in some custom event sources and then the processing code.

 

Serialization- well, I prefer a stand alone library I found but when you are in a hurry and can't sit down to write a custom serialization system it is a good enough stand in.

 

Filesystem- easy enough to replace, but time consuming.  I wish this had made it to C++11 but it didn't, so do it yourself of use Boost.

 

Most of the other libraries are more special case and in many ways not really that useful.  Exceptions such as context and others exist but are specialized to certain needs, signals(2) is something nice looking but for UI I use QT and would be unlikely to use signals in a game engine as I generally refer immediate mode UI's instead of retained.

 

Anyway, it is dependent on your needs at any given time if Boost is justified.

0

Share this post


Link to post
Share on other sites

Im not running C++11 so theres a few libraries Im using ontop of my head and loving:

 

Serialization: I use this for loading/saving my custom asset files. Extremely easy to serialize/deserialize nested structs of data, and amazingly supports all the stl containers. The only downside is that it is NOT a header-only lib sad.png

 

Foreach: simple and I love the syntax. Awesome.

 

Bind/function: I use this for registering user callbacks for my input module. 

 

Hash: I have scenes, nodes, meshes, etc reffered by name and I match them by the hashed names

Edited by KaiserJohan
0

Share this post


Link to post
Share on other sites

I guess C++11 would have the greatest impact on how much of Boost I'd use.

 

I'm not running C++11 myself. At least, I don't think I'm running C++11 (using Mac OS X 10.6.8, Xcode 3.2.6, gcc 4.2.1). Given that I want to eventually support Windows, Mac, and maybe iOS, is C++11 supported in enough compilers to be used for production code?

 

I'm specifically getting Boost for signals(2) which I'll need for my UI code and for certain other things that need to generate events. For example, I want to be able to attach events to specific frames of animation objects. I'll probably also start using unordered_map since I have a lot of things I keep in maps and refer to by string IDs, and I don't need the sorting.

0

Share this post


Link to post
Share on other sites

At least, I don't think I'm running C++11 (using Mac OS X 10.6.8, Xcode 3.2.6, gcc 4.2.1).

You have C++11 available. I don't believe it is enabled by default, though.

 

 

Given that I want to eventually support Windows, Mac, and maybe iOS, is C++11 supported in enough compilers to be used for production code?

Large parts of it, yes.

 

Mac, Linux and iOS have pretty solid support. Microsoft is a little more shaky, but gradually getting there (and you can use a recent version of GCC via MinGW instead).

Edited by swiftcoder
1

Share this post


Link to post
Share on other sites

At least, I don't think I'm running C++11 (using Mac OS X 10.6.8, Xcode 3.2.6, gcc 4.2.1).

You have C++11 available. I don't believe it is enabled by default, though.

 

I spent a while in the CMake articles making sure it is enabled, by default it is not.  As a note though, I'd be curious why you have not updated to the newer Xcode?  The transition to Clang is quite worth it, faster compiles usually and usually considerably better code generation.

0

Share this post


Link to post
Share on other sites


At least, I don't think I'm running C++11 (using Mac OS X 10.6.8, Xcode 3.2.6, gcc 4.2.1).

You have C++11 available. I don't believe it is enabled by default, though.


GCC 4.2.1 is pretty old, isn't it? It seems most C++11 features began in gcc 4.3, and only really started getting the cool features around 4.5.
 
No, it's not enabled by default. You'd have to pass -std=c++0x to the compiler. Once you get to version 4.6 or so, you pass -std=c++11 instead.
 

Given that I want to eventually support Windows, Mac, and maybe iOS, is C++11 supported in enough compilers to be used for production code

Yep. GCC (and MinGW on Windows) implements the vast majority of the C++11 features, and most of the new standard library as well. I've only ran into one part of the C++11 standard library that wasn't available yet (the regex library) but even that might've been added in recent versions.

It's stable and supported well in Max, Linux, and Windows. I don't know about iOS.
0

Share this post


Link to post
Share on other sites

GCC 4.2.1 is pretty old, isn't it? It seems most C++11 features began in gcc 4.3, and only really started getting the cool features around 4.5.

Right you are - I didn't look at the version. If you upgrade XCode (and/or OS X itself) you should have C++11.
0

Share this post


Link to post
Share on other sites

I was under the impression that the latest version of Xcode (4?) only worked on Lion. I'm still on Snow Leopard and I'm not in a position to upgrade right now. I'll see if I can upgrade Xcode itself (I just grab it off App Store, right?).

 

[b]Update[/b]

Upgrading Xcode on my current machine is no go. I get "Xcode can't be installed on Macintosh HD because Mac OS X version 10.7.4 or later is required" when I click the "Free" button on Xcode's App Store page.

Edited by AaronWizardstar
0

Share this post


Link to post
Share on other sites

I was under the impression that the latest version of Xcode (4?) only worked on Lion. I'm still on Snow Leopard and I'm not in a position to upgrade right now. I'll see if I can upgrade Xcode itself (I just grab it off App Store, right?).

 

Update

Upgrading Xcode on my current machine is no go. I get "Xcode can't be installed on Macintosh HD because Mac OS X version 10.7.4 or later is required" when I click the "Free" button on Xcode's App Store page.

Yup, that rather stinks. The upgraded compiler is quite worth it but if you can't use it, nothing to do for that.  That old of a GCC, you probably don't have much C++11 available so Boost may be your best bet.

0

Share this post


Link to post
Share on other sites

Upgrading Xcode on my current machine is no go. I get "Xcode can't be installed on Macintosh HD because Mac OS X version 10.7.4 or later is required" when I click the "Free" button on Xcode's App Store page.

While that is correct, it isn't the entire story.

Apple did produce XCode 4.2 for Snow Leopard, and if you can find a late-edition 10.6.8 install disk, it contains a valid Snow Leopard installer for XCode 4.2. Unfortunately, in an effort to force Snow Leopard users to upgrade, they only offer the download for Lion and Mountain Lion.

(though, in all fairness, the OS upgrade is only $30)

0

Share this post


Link to post
Share on other sites

(though, in all fairness, the OS upgrade is only $30)

Unless of course your machine doesn't include a 64bit capable BIOS, or whatever OsX calls it.  This pissed me off a lot unfortunately, my older mac pro desktop and a laptop can not run ML due to being "too old".  Even though the CPU's are fully 64bit compatible, a small bit is 32bit only and as such ML is off limits. :(  The laptop wasn't a big issue as the space bar doesn't work so well and I love the air as my replacement, the desktop pissed me off a lot though as it was a big expensive dual box with reasonably new CPU's, just because of one piece though, no ML allowed.

0

Share this post


Link to post
Share on other sites

(though, in all fairness, the OS upgrade is only $30)

Unless of course your machine doesn't include a 64bit capable BIOS, or whatever OsX calls it.  This pissed me off a lot unfortunately, my older mac pro desktop and a laptop can not run ML due to being "too old".  Even though the CPU's are fully 64bit compatible, a small bit is 32bit only and as such ML is off limits. sad.png  The laptop wasn't a big issue as the space bar doesn't work so well and I love the air as my replacement, the desktop pissed me off a lot though as it was a big expensive dual box with reasonably new CPU's, just because of one piece though, no ML allowed.

I don't know what exactly you have or what this guide covers (I haven't read all of it), but maybe this guide/forum topic will help you: http://forums.macrumors.com/showthread.php?t=1325709

0

Share this post


Link to post
Share on other sites

At the moment I only use FileSystem, just because it is so easy to use on multiple platforms. Other parts of Boost I did not yet look at. (neither to the new c++11 features...)

0

Share this post


Link to post
Share on other sites

shared_ptr, foreach, filesystem... when I arrived here at $WORKPLACE and discovered bind and function are banned because they make C++ 'too functional', I couldn't write compileable code for weeks... how do people do anything without bind??

 

 

Looked at spirit. Very quickly looked away...

0

Share this post


Link to post
Share on other sites

I don't use boost at all actually. It's not that I'm avoiding it, I have the entire library downloaded and compiled, and I regularily look at what boost can do for me when I have a problem, but so far I simply haven't found a use for it. I also already have a large code base that does not use it; for a new project I'd probably use it more.

 

A few reason I'm not using it:

 

I was interested in boost's testing framework for a while, but there is one that's fully integrated into Visual Studio 2012 and Microsoft is at work to improve support for tests as much as possible, so I passed on boost::test.

 

I wanted to use boost::format because I thought it had better support for thousand separators (in the std library it's absurdly complicated, you have to swap locales for this to work) but later, the documentation says that %' support is not guaranteed. The design is kind of cool though, I might change my mind on that one.

 

I rarely use smart pointers, and when I do, the ones of the standard library are enough for me.

 

Boost uses a lot of templates. I love templates as much as they do, but right now I'm writing a DLL library, and templated types in exported class declarations can cause some issues when linked to code compiled with different compilers (exceptions have the same problem although). I want my library to support multiple compilers, so it's going to be a problem for me if I start using boost types as class attributes or in structs.

0

Share this post


Link to post
Share on other sites

My Boost usage list is:

 

filesystem, bind, signals2, format, any, lexical_cast. 

 

Especially boost::signals2 is worth praising in my opinion. It's great to use signals to make decoupled systems talk to each other on occasion. You surely don't want to connect/disconnect thousands of times per frame, but calling through it is pretty fast.

 

Previously on boost, now deprecated due to C++11:

 

scoped_ptr, shared_ptr, unordered_map, random

 

I'm going to remove [i]any[/i] at some point in the future, though, because I want an implementation of [i]any[/i] that does not allocate for small types.

0

Share this post


Link to post
Share on other sites

I don't use any boost, both at home and at work. At home I used to use it, but I don't anymore because there isn't anything useful enough for me to want to have a dependency on it. At work it's banned.

Edited by MJP
0

Share this post


Link to post
Share on other sites

Don't use it, never seen a need to, clicked on the Boost website, didn't really have anything that would have benefitted me

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