Skip to content

Instantly share code, notes, and snippets.

@mateusfccp
Last active December 27, 2015 07:49
Show Gist options
  • Save mateusfccp/7291831 to your computer and use it in GitHub Desktop.
Save mateusfccp/7291831 to your computer and use it in GitHub Desktop.
Revision 1.

Review: SFML Game Development

Review

With 296 very well written pages, "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 samples, 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. With this 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 didn't exist yet, and even though I'm almost sure I would not have bought it ('cause I didn't had international card at the time), it would be very handy and would save several hours of research, since it covers even the networking part of SFML, and probably would help some of my friends to catch up to my "level" faster. Either way, during my researchs I learned much more C++11 than this book teach, not to mention that at that time I had much more time to research, but it doesn't matter.

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 an 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, neither 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. We begin to create its 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 it 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 be.

Moving on to the fourth chapter, the book teaches you to manage user input, detect the pressing of buttons and etc. Between us, it 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, like 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, and 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 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment