Last Updated: February 25, 2016
·
1.239K
· kress95

SFML Game Development Review

Review: SFML Game Development

Review

With 296 pages very well written, "SFML Game Development", written by Arthur Moreira, Vogelius Henrik Hansson and Jan Haller is a new book published by Packt that teaches (and without intimidating) on the popular media library, SFML 2.

With several code examples, illustrations, flow charts and very explaining texts, it was an enjoyable read, and even for me, who's very familiar with SFML API and game development environment, was able to learn a little more after reading it.

For me, this book is a "must-have" if one has never played with SFML or got involved with game development, whith it you'll be able to catch up with it quickly, and also with a production-ready library. SFML was the first media library that I used with C++, so, it is important to review a book like this.

But in the ol'days this book still didn't exist, and even though I'm almost sure I would not have bought it ('cause I didn't had international card at the time). But it would be very handy and would save several hours of research, since it covers even the networking bit of SFML, and probally would help some of my friends to catch up to my "level" faster, either way, during te researchs I learned much more C++11 than this book teach anyways, not to mention that at that time I had much more time to research, but whatever.

Well, getting back to the book, it is very well structured, has a good presentation at the beginning, and after a little more it starts explaining the basics of how to build a empty game with SFML running, and as the course of book, the game evolves and becomes into a full fledged topdown shooter, and not only that, the book even teaches how to implement online multiplayer co-op. So... the book covers all SFML2 API fractions, oh, almost forgot, it also teaches a bit about some new features of C++11, but this wasn't the focus of the book, or of who bought it anyway.

tl;dr: It's a pretty hasty book to read, covers SFML2 entirelly, is very cheap and very well written. Recommended, buy here.

Book Summary

The book is well structured, in the beginning, it has a good introduction, some brief words of the original author of SFML, telling about the history of SFML and on some facts about the 2nd release of it, then, after that, the presentation of the authors and reviewers and then the game begins :D.

The book has 10 chapters, each one covering a fraction of the game development, noting that the book has a good support material, which you can download from Packt.

In the first chapter, it gives a good introduction on how to use SFML, including download, installation, warnings about the used version of C++ and the basics of the API, at the end of this chapter we get an empty game with constant FPS running.

Then, in the second chapter, the game receives a resource loader, the book teaches how to optimize the loading of textures and some other things, so the game will not waste time reloading what was loaded already, it also teaches to release resources from memory and also on how to handle a common situation: the lack of a resource in the game. Oh, almost forgot, it talks a little about shaders, and is very interesting to you to know that SFML already comes with built in support for GLSL shaders.

In the third chapter, the game starts to get more shape, then we began to create it's objects, graphics, game logic, organization and structuring. I have to say that for those who know C++, but never created any game, this is the most interesting part of the book, because that is what defines how enjoyable the game development will be, and how fast the game will run, the more you engage in doing this part well, the faster/"stabler" your game will get.

Moving on to the fourth chapter, the book teaches you to manage user input, detect the pressing of buttons and etc. Falls between us, is not the most complicated part of a game development, but certainly should be at least well made, if you make a mistake here, player commands can be ignored or given a weird delay.

Now, in chapter 5, the book explains about state/scene control. To understand this better, most games do not have only one "screen", a game typically has multiple "screens", now think that each stage of a game possesses at least one "screen" and something is programmed to manage which screen is running. That's what this chapter teaches you to do, and I messed a lot when I was doing this for the first time in C++, if you have this book in hand, will certainly be less painful than it was for me.

Chapter 6 teaches how to make GUIs, it is very shallow and the subject sucks, but it is necessary, and also, if the book were deeper here, it would need to be divided into two volumes, much larger than it currently is.

Now, in chapter 7, some important elements of gameplay are implemented, the text that appears on the screen, the HP character. Enemies and projectiles are also created in this chapter. The coolest part of this chapter is to make the homing missiles and collision detection.

Giving a little more beauty to the game, chapter 8 teaches about special effects, particle systems, animating sprites and some complicated things like texture atlas, shaders and OpenGL, one of the three most interesting parts of the book (the others being state/scene management and networking). From what I remeber, most programmers are not good at making things beautiful, and many people have a hard time to implement shaders and particle systems, so read this chapter, READ IT.

Getting a bit closer to the end of the book, in chapter 9 songs and sound effects begin to play, a litle about it's loading is taught, it is worth remembering that the book teaches how to use 3D sound effects, I never even had time to stop and read on the subject, which makes the chapter a little more interesting, after that the game is practically ready, just missing a little detail...

The online multiplayer, which is explained in the final chapter, so very complete. As I said, this was the part that interested me most in the book, because I had no idea how to prepare everything, down to the separate thread I have ever had in idea but did not know how to implement, and even not using more the SFML, the last chapter certainly gave me a good foundation for when I implement multiplayer to my game, and also taught me some new tricks.

Conclusion...

If you want to create games with C++, but do not know where to start, start with SFML, and get this book in hand :D. Moreover, even if not with SFML, having this book will help a lot because you can apply the same logic you'd learned in it in many other popular libraries (unless, of course, you already know everything).

This was my first public book review, also first multilingual review, so forgive me for writing any weird things.