- Get input from the players: polling and real-time; and when to use each.
- Manage the various resources a typical game requires (textures, audio, and font files to name a few).
- Manage different scenes e.g. main menu, game, and pause states.
- Animate our characters.
- Create a simple physics engine.
- Create and import tile maps.
- Efficiently managing collisions with the map and with other objects in the level.
- Create an entity component system.
- Create an audio engine.
- Manage inter-system communication.
- Create and handle events.
- Serialise and de-serialise objects.
Why use SFML?
SFML is well documented online so I won’t go into details about what exactly it is; other than that it will help us with various functions such as drawing to the screen, and playing audio. I recommend starting at SFML’s website for more information: https://www.sfml-dev.org.
I will however mention the reasons why I am using it for this tutorial series:
- I have used it before so I can focus on the actual implementation without learning a new library.
- It has a number of bindings for different languages, including: java, python, and ruby. I’ll be using the C++ bindings but you are free to use any of the other available languages.
- It has a decent install base; which means finding support should not be too difficult.
- It is multi-platform, you can follow along on Windows, MacOS, or Linux. It is also being ported to Android and iOS, but that was not available when I started this series.
Why not use Unity/Unreal Engine?
Is Using SFML Cheating?
How do you Setup SFML?
This is also well documented online and I will not go into detail here, rather I will link to the main source for each platform.
The links are for SFML version 2.4.2 and all tutorials will use that version unless otherwise stated. If a new version comes out with some cool new feature that we just have to try, I will talk you through upgrading SFML.
I create and test the projects in Visual c++ 14 (2015) 32bit for Windows and Clang 64bit for MacOS. You can download them from the SFML site but again you are free to use whichever implementation you would like. I will host the source files for each tutorial, once you have a project setup you can drag and drop these files into your project.
You can download the source code for each chapter from the Git repo as they become available (link will be at the top of each page). I will include the source files for each chapter in the separate folders and a current build for Xcode (which I am using for this series. The Xcode build can be considered the Dev build, it may not always run and will include code that has not yet been spoken about in a tutorial.
So this is the first and most likely last post of the series that does not include any code. From now on, we’ll be getting stuck in and creating new features for our engine. If you have any issues with setup or have suggestions on anything you would like to see included then please let me know in the comments.
Thank you for reading 🙂