SFML community forums

General => General discussions => Topic started by: cepro on August 09, 2014, 04:08:18 am

Title: An interesting reddit post about SFML : "why_do_so_few_games_use_sfml"
Post by: cepro on August 09, 2014, 04:08:18 am
http://www.reddit.com/r/gamedev/comments/2cywca/why_do_so_few_games_use_sfml/

Title: Re: An interesting reddit post about SFML : "why_do_so_few_games_use_sfml"
Post by: Gobbles on August 09, 2014, 05:48:53 am
I read over this, a large part of the general consensus was not enough cross platform support and issues with the internal opengl calls being outdated. I think someone also mentioned the lack of support for VBO's too.
Title: Re: An interesting reddit post about SFML : "why_do_so_few_games_use_sfml"
Post by: binary1248 on August 09, 2014, 05:56:46 am
Very interesting post.

Finally some feedback from people who have tried SFML as well as other libraries. Such discussions can unfortunately only be found on such "meta discussion platforms" and not on dedicated forums such as this one.

Most of the points mentioned there are probably already known here on this forum, but I'll try to sum them up anyway for those who don't want to read the whole discussion.

I'll try to comment on each of them now.

SFML still has a lot of room for improvement. Its development will probably pick up pace as well, since there are more helping hands available now than there were a year ago (Laurent can be attributed to almost all of the development besides OSX prior to the formation of the SFML team). SFML 3 will probably alleviate many of the "issues" that the people who posted in that discussion have with SFML, but it will never really "replace SDL". The only way SFML will ever take over is if people start to think out of the box and try new things, go against the "norms" and just stop comparing SFML directly to SDL. This last point can be made easier if SFML were to provide features that SDL is just unable to provide due to its nature, and that is an advantage that SFML has over SDL. It can adapt and be more liberal than SDL will ever be able to, because all the "old dogs" and "positive feedback people" are camping there and will probably start to cry if SDL were ever to "do something like SFML".
Title: Re: An interesting reddit post about SFML : "why_do_so_few_games_use_sfml"
Post by: Sub on August 09, 2014, 06:59:57 am
Higher level features (like sprite batching) that implicitly or explicitly improve performance were never part of the SFML API, since the API is about providing the necessary access points to lower level functionality. Such high level features can already be built on top of SFML, and people who complain about the lack of such features and thus the implied inefficiency of SFML are simply too lazy to roll their own code and probably just spoilt by other libraries that do go ahead and provide such features. SFML performance scales with the aptitude of the programmer, and that isn't a bad thing.

Maybe it's just me, but I think you guys would want SFML to perform as fast as possible, regardless of how skilled the programmer using the library is.

In regard to a feature such as sprite batching, is the concern not wanting to clutter the API, or is it more that it's not considered low level enough to implement? 
Title: Re: An interesting reddit post about SFML : "why_do_so_few_games_use_sfml"
Post by: wintertime on August 09, 2014, 04:11:59 pm
  • SFML was late to the party, compared to SDL.
  • Other libraries (SDL) have connections to the big players (e.g. Valve).
  • Some people just prefer a C API.
  • SFML doesn't support as many platforms as some would like.
  • SFML graphics' use of deprecated GL scares people.
  • SFML graphics' inefficient use of GL scares people.
  • SFML context management scares people.
  • SFML doesn't support core-only contexts.
  • SFML doesn't support raw input.
  • People want more frequent releases to convince them stuff is happening.
  • SFML doesn't support higher level features that some other libraries do.
Title: Re: An interesting reddit post about SFML : "why_do_so_few_games_use_sfml"
Post by: binary1248 on August 09, 2014, 06:22:43 pm
Maybe it's just me, but I think you guys would want SFML to perform as fast as possible, regardless of how skilled the programmer using the library is.
The library is already designed to operate as fast as it can without sacrificing any of its interface design. The fact that it currently limits itself to the legacy OpenGL API comes from its history and considering that ancient hardware might not be able to provide anything else is another factor to consider. What people tend to forget is that SFML currently only has a single rendering implementation, that it uses for all platforms. It was probably previously infeasible for Laurent to support multiple rendering implementations by himself which is why he restricted SFML to merely supporting what was necessary to get consistent results from SFML no matter what hardware was in use.

Like I said, this might and probably will change in the future because a) SFML now has more development resources at its disposal and b) more and more people (even beginners) are putting more value into using the modern OpenGL API and coupled with the fact that the hardware that doesn't support it is becoming less and less common, SFML will have to start making changes that target future hardware that might not even provide the legacy OpenGL API any more.

In regard to a feature such as sprite batching, is the concern not wanting to clutter the API, or is it more that it's not considered low level enough to implement?
Both. For me, you can separate API levels into 3 categories. Low, middle and high. A low level API would be just 1 step above the operating system, common examples include OpenGL, OS socket APIs and OpenAL (although this is debatable). Mid level APIs are normally focused on taking the low level APIs and providing some benefit over them. In the case of SFML and SDL, it is the portability that such libraries guarantee. They abstract away the differences between the low level APIs that operating systems bring along with them, easing the development of cross-platform applications. This does not mean that they are limited to providing a thin wrapper on top of said low level APIs. They can also provide helpful functionality that encompasses the wide majority of use cases developers would have when usually resorting to the lower level APIs.

SFML tries to satisfy the perceived needs of its target audience which in turn means that almost all of their legitimate use cases will be covered by the library in one way or the other. This is where things get a bit more complicated. Until recently, its target audience consisted of people who were merely interested in simple 2D graphics, simple audio and rudimentary network access. It had been this way for years, which is why the API ended up being like it is now. I can't speak for Laurent, but I can imagine he simply didn't know that there were many people like those who posted in that reddit discussion that found SFML lacking the features that they would need to consider using SFML seriously. I have been a proponent for expanding SFML's perceived target audience for years, but I haven't gotten much backing, since people who shrug SFML off often don't even mention why they do it. That reddit discussion contains more information from such people than you will find on this forum in the last 3 years.

I think SFML succeeds at doing what it was originally designed to do, provide simple access to multimedia and networking for beginners to have a bit of fun with. Going forward, I hope Laurent recognizes that SFML has much more potential if it were to open up to a bigger audience, which would mean it has to provide features that the new audience also seeks without sacrificing any of the values or ideas that make it the library it is today. It is going to be tricky, but I'm pretty sure it isn't impossible.

As for the question at hand, taking into consideration what I just said, sprite batching simply wasn't a feature that would benefit SFML's target audience enough for it to become a core feature of SFML. It could always be built on top of SFML, which is why it never really had a high priority, and that would also keep the core API clean for those who didn't need it. One might argue that having API documentation pages that are hundreds of pages long because of all the auxiliary features isn't a bad thing, but considering that we urge beginners to browse the documentation to learn more about how to use SFML, it isn't that friendly either. Just like the C++ standard library, we like to keep the API concise. It has just enough for you to build arbitrarily complex things on top of it, no more and no less. This way, we can also keep an overview of the feature set that SFML is meant to support. A mid level API really isn't destined to become too huge, and is often smaller than the lower level API which it is built upon. If we expanded SFML to encompass higher level features as well, it would just explode. People might start asking "but you included feature X so why not include feature Y too?" which would lead to a chain reaction and ultimately API bloat.

Since there isn't anything else higher than "high level" it can and often does include everything all the way to very domain specific features which really shouldn't have a place in a general purpose multimedia library. This can be seen in many other libraries out there. People might adore them for exactly this reason, but they tend to forget that if they look around at the others who also use said libraries, they all tend to come from the same domain for exactly the same reason as well. I don't know about you, but I can hardly call such libraries general purpose any more.
Title: Re: An interesting reddit post about SFML : "why_do_so_few_games_use_sfml"
Post by: Sub on August 10, 2014, 05:46:42 pm
Fair enough.  Thanks for the response.
Title: Re: An interesting reddit post about SFML : "why_do_so_few_games_use_sfml"
Post by: Hapax on August 12, 2014, 08:26:04 pm
people who shrug SFML off often don't even mention why they do it. That reddit discussion contains more information from such people than you will find on this forum in the last 3 years
You ask someone to give their honest opinion, even (and especially) if it includes the negative points, and they'll refuse to answer, knowing that they're helping; people don't like to help.
You have one person make an insult towards something - or even just create an opening for such - and it'll snowball with everyone firing what they can, feeling more confident in their insults by the fact that others have already said them.

EDIT: added the word "create".
Title: Re: An interesting reddit post about SFML : "why_do_so_few_games_use_sfml"
Post by: paupav on August 12, 2014, 08:35:26 pm
Reviews are much better for the SFML than for the SDL, that's why I've choose it. It is enough to convince me.
Title: Re: An interesting reddit post about SFML : "why_do_so_few_games_use_sfml"
Post by: Jesper Juhl on August 12, 2014, 09:12:08 pm
@Hapax : I think you may want to rethink that comment and try again. At least to me, what you said seemed a bit incoherent and inconclusive.

I personally think there's a lot of positive feedback to take away from that reddit discussion. There's also a lot of criticism of SFML and some of it is justified.

To make SFML better, both the good and bad needs to be heard.
Title: Re: An interesting reddit post about SFML : "why_do_so_few_games_use_sfml"
Post by: Hapax on August 12, 2014, 10:24:07 pm
Added the word that was missing from my sentence. Thanks, Jesper.
Title: Re: An interesting reddit post about SFML : "why_do_so_few_games_use_sfml"
Post by: Ruckamongus on August 13, 2014, 02:06:47 am
I thought this was funny: "SFML is slow, very slow, and the API isn't really that clean. It's so heavily OOP it doesn't feel natural to use and is more suited to a Java application."

While some of the points are valid, I think a simple explanation of why SFML isn't more utilized is marketing. SDL and many of these other libraries have had time and usage. People see the SDL logo or "Made with SDL" so over time it's developed rapport. Unfortunately SFML hasn't had this publicity yet so dismissal is easy. We all know SFML>SDL any day :P.
Title: Re: An interesting reddit post about SFML : "why_do_so_few_games_use_sfml"
Post by: georger on August 13, 2014, 05:03:03 pm
I thought this was funny: "SFML is slow, very slow, and the API isn't really that clean. It's so heavily OOP it doesn't feel natural to use and is more suited to a Java application."
I don't find it funny at all.
Did the person who wrote that post refer to benchmarks to support his statement that SFML is slow? Or is it just his opinion? To me it looks like an assumption.
As for SFML's API, my opinion is that the API is clean, and I quite *like* the OOP approach; it *feels* natural. But I know that many seasoned game programmers prefer to use C++ as "C with classes" and eschew most OOP paradigms; such programmers may well prefer SDL, since it's a C library and as such is well suited for programmers that prefer to limit OOP usage to the bare minimum. Maybe they should try and use SFML's C binding.

While some of the points are valid, I think a simple explanation of why SFML isn't more utilized is marketing. SDL and many of these other libraries have had time and usage. People see the SDL logo or "Made with SDL" so over time it's developed rapport. Unfortunately SFML hasn't had this publicity yet so dismissal is easy. We all know SFML>SDL any day :P.
If we use the criterion of the number of released games built with each library, that is debatable; since I don't have numbers nor know for any recently released title why either library was decided for or against, I won't spout an assumption. Like @binary1248 said, it's like comparing apples to oranges. What I *can* state is, I've used both libraries and I can honestly say that I prefer SFML, because I find it more suited to the way I work.
Title: Re: An interesting reddit post about SFML : "why_do_so_few_games_use_sfml"
Post by: Ruckamongus on August 14, 2014, 05:36:49 am
I thought this was funny: "SFML is slow, very slow, and the API isn't really that clean. It's so heavily OOP it doesn't feel natural to use and is more suited to a Java application."
I don't find it funny at all.
Did the person who wrote that post refer to benchmarks to support his statement that SFML is slow? Or is it just his opinion? To me it looks like an assumption.
As for SFML's API, my opinion is that the API is clean, and I quite *like* the OOP approach; it *feels* natural. But I know that many seasoned game programmers prefer to use C++ as "C with classes" and eschew most OOP paradigms; such programmers may well prefer SDL, since it's a C library and as such is well suited for programmers that prefer to limit OOP usage to the bare minimum. Maybe they should try and use SFML's C binding.
I think you missed my point: it was funny because of how ridiculous of a statement it was. I completely agree, the OOP approach feels very intuitive and I don't see how much cleaner the API can really be. Calling SFML slow and unclean is probably coming from one who dislikes C++. Odds are he's one of the guys that don't like C++ and share the Linus philosophy.

While some of the points are valid, I think a simple explanation of why SFML isn't more utilized is marketing. SDL and many of these other libraries have had time and usage. People see the SDL logo or "Made with SDL" so over time it's developed rapport. Unfortunately SFML hasn't had this publicity yet so dismissal is easy. We all know SFML>SDL any day :P.
If we use the criterion of the number of released games built with each library, that is debatable; since I don't have numbers nor know for any recently released title why either library was decided for or against, I won't spout an assumption. Like @binary1248 said, it's like comparing apples to oranges. What I *can* state is, I've used both libraries and I can honestly say that I prefer SFML, because I find it more suited to the way I work.
I too have used SDL and made the switch to SFML. I found it more straightforward and intuitive. The "modern" (don't kick me) feeling and approach to things as well as focusing on C++ over C made me switch. Also, hardware accelerated graphics and the ability to rotate an image without using another library was attractive to me. I have zero thoughts of ever going back; SFML may not have the same time and mass of released product but it's clearly the better choice for my needs.