Jump to content

  • Log In with Google      Sign In   
  • Create Account


Multi-purpose library vs Many Libraries


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
9 replies to this topic

#1 TheVirtualDragon   Members   -  Reputation: 237

Like
2Likes
Like

Posted 04 June 2012 - 12:55 PM

I have been using SFML - Simple and Fast Multimedia Library to make my games so far, but I am wondering if I should use many seperate libraries (i.e. ImageMagick for graphics, OpenAL for audio etc.) in my game. Will it give me more flexibility and some other unknown advantages?

Additional Details:

I am quite experienced in C++ and have made simple games, e.g. Pong and Tic-Tac-Toe.
I will be using Box2D for physics (hopefully).

Thanks in advance.
What's This?: basically, it's my blog. Click on it.

Sponsor:

#2 Servant of the Lord   Crossbones+   -  Reputation: 18466

Like
3Likes
Like

Posted 04 June 2012 - 01:07 PM

My answer would tend to be 'no'. Use the library best suited for the task (in this case, SFML), and add in extra libraries as needed.
I wouldn't use ImageMagick for graphics anyway, that's more suited for things like drawing programs (making your own small Photoshop/Ms Paint/PaintShopPro).

If your project is large, you'll probably end up using multiple libraries anyway, but you might as well start with a good high-quality one that covers the majority of your needs in a consistent way (SFML for audio, graphics, and input, and then other libraries as necessary). Then if you need something SFML doesn't provide, find a different library to use alongside SFML (An example for scripting would be AngelScript or Lua).

SFML is great, fast, and easy to learn. Why force yourself to learn three different libraries with different focuses and different interfaces and different quirks, instead of just using one that handles all three excellently with a common consistent interface, and a single documentation site, and single forum you can visit for help?

(iirc SFML uses OpenAL internally anyway).

Edited by Servant of the Lord, 04 June 2012 - 01:08 PM.

It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]


#3 TheVirtualDragon   Members   -  Reputation: 237

Like
0Likes
Like

Posted 04 June 2012 - 01:42 PM

Thanks for the reply, I think I will stick with SFML, but I know whnere to go if I am developing a graphics application (which doesn't seem unlikely).
What's This?: basically, it's my blog. Click on it.

#4 Inuyashakagome16   Members   -  Reputation: 835

Like
0Likes
Like

Posted 04 June 2012 - 01:44 PM

I have been using SFML - Simple and Fast Multimedia Library to make my games so far, but I am wondering if I should use many seperate libraries (i.e. ImageMagick for graphics, OpenAL for audio etc.) in my game. Will it give me more flexibility and some other unknown advantages?

Additional Details:

I am quite experienced in C++ and have made simple games, e.g. Pong and Tic-Tac-Toe.
I will be using Box2D for physics (hopefully).

Thanks in advance.

That's a really good question and Servant had a great answer to that. I was just curious about this recently. o.o

#5 larspensjo   Members   -  Reputation: 1526

Like
2Likes
Like

Posted 04 June 2012 - 02:53 PM

Generally, I prefer libraries that do only and exactly what I want, in a minimalistic way. They should do it with a minimal impact, with a minimal dependency on other libraries.

That is why I don't like Boost. And why glfw is better than freeglut. And the reason I don't like Devil.

I am currently using Assimp, but I will eventually change to a home made file format instead, optimized for my needs.

Of course, a big library may be doing just what you want, in which case it is probably right for you.
Current project: Ephenation.
Sharing OpenGL experiences: http://ephenationopengl.blogspot.com/

#6 Servant of the Lord   Crossbones+   -  Reputation: 18466

Like
0Likes
Like

Posted 04 June 2012 - 06:42 PM

Generally, I prefer libraries that do only and exactly what I want, in a minimalistic way. They should do it with a minimal impact, with a minimal dependency on other libraries.

This is actually one of the reasons why I like SFML. It's a very minimal and simple wrapper around several libraries that each do one thing, and provides the basic glue that many people normally rewrite and rewrite.

Super bloated libraries that try to do everything (Qt is like that* - though it's designed well, it tries to be everything) aren't to my preference either.
(IIRC, Boost is actually a collection of separate libraries that are not hyper-dependent on each other (though there are some dependencies), that mostly do one thing. Many of them are even header-file only. I might be mistaken about that though, I've used Boost very little)

*I like Qt and use it, because it's good with native GUIs and you can get things running quickly, but I don't enjoy how bloated it is.

Edited by Servant of the Lord, 04 June 2012 - 06:43 PM.

It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]


#7 ApochPiQ   Moderators   -  Reputation: 14890

Like
1Likes
Like

Posted 04 June 2012 - 06:51 PM

You are correct about Boost - it is not "a library" but rather a collection of many libraries. I cherry-pick pieces of it all the time with very little issue.

#8 larspensjo   Members   -  Reputation: 1526

Like
0Likes
Like

Posted 05 June 2012 - 12:20 AM

You are correct about Boost - it is not "a library" but rather a collection of many libraries. I cherry-pick pieces of it all the time with very little issue.


I tried to use the Options part of Boots, but didn't want to use all of Boost. As I want the source code to be versioned together with my main source code, I wanted to only copy the relevant parts into a sub folder of my project. It turned out not to be feasible, because Options included things that included things, etc. In the end, I wrote my own version as I didn't need all of the Options anyway.

The advantage with saving things like this in a sub folder is that you are ensured that you can recompile your application from older versions. The disadvantage is that it is harder to update when there are newer versions of the library, and you can usually not use the provided installers.

Most "mega libraries" cannot be versioned with the application source code, which is another disadvantage.
Current project: Ephenation.
Sharing OpenGL experiences: http://ephenationopengl.blogspot.com/

#9 Cygon   Crossbones+   -  Reputation: 1088

Like
1Likes
Like

Posted 05 June 2012 - 01:02 AM

But completely isolating the pieces of Boost you want from the rest is not an easy thing either.

Most of the time you need Boost.Config, Boost.MPL, Boost.Spirit right away plus a dozen random headers from different Boost libraries (and this is where the fun starts - can you only include those headers oder do you then include the whole library).

I remember writing a shell script that called the compiler, parsed its output for error messages about missing headers and then copied the headers in place -- all just to obtain a minimal Boost subset for my project.
Professional C++ and .NET developer trying to break into indie game development.
Follow my progress: http://blog.nuclex-games.com/ or Twitter - Topics: Ogre3D, Blender, game architecture tips & code snippets.

#10 TheVirtualDragon   Members   -  Reputation: 237

Like
0Likes
Like

Posted 05 June 2012 - 01:44 AM

Generally, I prefer libraries that do only and exactly what I want, in a minimalistic way. They should do it with a minimal impact, with a minimal dependency on other libraries.

That is why I don't like Boost. And why glfw is better than freeglut. And the reason I don't like Devil.

I am currently using Assimp, but I will eventually change to a home made file format instead, optimized for my needs.

Of course, a big library may be doing just what you want, in which case it is probably right for you.

That's exactly why I asked this question. Of course, SFML is a pretty lightweight library, but sometimes it is better to compile your own library (that's how SFML was made anyway - Laurent obviously felt that the existing libraries were too heavy or outdated and slow. Anyway, it's a good thing that it happened, or otherwise SFML would not have been made.
What's This?: basically, it's my blog. Click on it.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS