Planet Gamedev

Gamasutra Feature Articles

Anti-scam Steam Curator group seeks to police game devs

October 09, 2015 09:07 PM

At least one Steam Curator has formed explicitly to place warning messages on the Steam pages of games from developers they believe to be guilty of scamming or otherwise mistreating customers. ...

Get a job: Boss Key seeks a Senior Network Engineer

October 09, 2015 07:42 PM

Cliff Bleszinski & Arjan Brussee's new Raleigh-based studio is hiring an experienced network engineer to work on its upcoming sci-fi shooter Lawbreakers alongside the team at Boss Key headquarters. ...

Firewatch designer calls on devs to speak up to their governments

October 09, 2015 07:12 PM

Campo Santo's Nels Anderson wants to see the game industry's concerns better represented in government, and he's gone so far as to launch his own local "voter mobilization and information initiative." ...

The unlikely creative relationship behind Minecraft: Story Mode

October 09, 2015 06:44 PM

How did Telltale and Mojang turn the ultimate sandbox game into a narrative adventure? By taking inspiration from stories that Minecraftplayers create...and from the movie Goonies. ...

Video: How video games can better handle feints and misdirection

October 09, 2015 06:22 PM

At GDC Europe 2015, TinyBuild's Mike Rose speaks to what video game designers can learn (and potentially steal) about bluffing and misdirection mechanics from the most devious board and card games. ...

David Perry Blog

Cool Robot – You know you want one!

by David Perry at October 09, 2015 06:16 PM

Tell me you don’t want one!

Filed under: Robot Tagged: camera, phone, robohon, robot

Gamasutra Feature Articles

Don't Miss: The neuroscience driving survival horror game design

October 09, 2015 05:56 PM

How do survival horror games work on our brains? Neuroscientist M. Tajerian unpacks the mechanisms behind the scares in Amnesia, Dead Space and Silent Hill in this classic 2012 feature. ...

Jessica Curry takes a break from being joint chief of The Chinese Room

October 09, 2015 05:40 PM

Composer Jessica Curry has announced plans to (sort of) leave UK indie studio The Chinese Room by stepping away from her long-held role as director at the studio to focus on her own musical career. ...

Game From Scratch

SFML with C++ Tutorial Series–Windows, Game loops and Timers

by at October 09, 2015 05:10 PM


In this part of the SFML we will look at creating our first basic SFML application.  At the heart of every SFML application is the RenderWindow which provides both a way to draw things on screen and receive input events from the user.


As always, there is an HD video of this tutorial here.


At the heart of every non-trivial game is the game loop.  In some game engines it’s hidden away from you inside the engine, but it is always there somewhere.  In SFML it is your responsibility to implement, which is what we will do today.  A game loop is a pretty simple concept… it’s a loop that runs over and over until your game is completed.  Each pass through the loop the screen is cleared and new graphics are drawn (this is referred to as a frame, so when you hear Frames Per Second, this is what is being referred to).  There are several other tasks a game is responsible for handling… input and physics to name just two.


Let’s start off with a very simple application:

#include "SFML/Graphics.hpp"

int main(int argc, char ** argv) {
  sf::RenderWindow renderWindow(sf::VideoMode(640, 480), "SFML Demo");

  while (true) {


This represents about the simplest meaningful SFML application you can create.  We create a new RenderWindow, passing in both its dimensions and title.  Then we simply loop forever and each pass through the loop we clear the window then draw it again with a call to display().


When you run this code you will get a black 640x480 window on screen, however if you attempt to move or close this window you will quickly notice something is wrong.  It doesn’t respond to any of your actions.  In fact, if you lose focus (click on a different window) you can’t even get it to focus again!  This is because we aren’t responding to any events.  Let’s switch things up a bit so that are window is a tad more responsive.  Instead of simply looping forever, we will create a slightly more intelligent game loop.

  sf::Event event;
    // Check for all the events that occured since the last frame.
    while (renderWindow.pollEvent(event)){
      //Handle events here
      if (event.type == sf::Event::EventType::Closed)

Now your window properly responds to events, it can be moved around and most importantly, it can be closed.  Let’s take a quick look at what we’ve done here.


First off, instead of looping forever, we instead loop until our RenderWindow is closed.  Next inside this loop we’ve implemented another while loop that calls pollEvent.  pollEvent checks for all of the events that occurred since the last time pollEvent was called.  It is called inside a while loop because it is possible that multiple events occurred since the last pass through the outer loop.  pollEvent() will return false when no more events exist.  Events exist for things such as mouse and keyboard actions or the window being resized.  In this particular case we are checking to see if the EventType is Closed, which means a close request has occured.  In the event that one does we call renderWindow.close() which will result in the next check of isOpen() to return false, thus ending our game.


We will cover events in more detail later, but for an idea of what EventTypes exist, click here.  There are two very important things to realize in this game loop.  Notice that the sf::Event is declared outside of the loop?  This code is going to be called ALOT.  Never put variable allocations, even stack based ones like this, inside a high frequency loop if it can be helped.  Second, notice how the clear() and display() calls are outside of the inner pollEvent() loop?  This is also important, as otherwise your screen with only update when an event occurs!


There is one final important concept to cover before we move on to the next tutorial… time.  It is quite common for a game engine to provide the elapsed time since the last frame.  This value is very useful to your entire game as we will see shortly.  In SFML however you are rolling your own game loop, so you are also rolling your own time tracking system.  Don’t worry though, the process is extremely simple.  That’s see one final complete sample that also keeps track of the elapsed time per frame.

#include "SFML/Graphics.hpp"
#include <iostream>

int main(int argc, char ** argv) {
  sf::RenderWindow renderWindow(sf::VideoMode(640, 480), "SFML Demo");

  sf::Event event;

  // A Clock starts counting as soon as it's created
  sf::Clock clock;
    // Check for all the events that occured since the last frame.
    while (renderWindow.pollEvent(event)){
      //Handle events here
      if (event.type == sf::Event::EventType::Closed)
    // A microsecond is 1/1,000,000th of a second, 1000 microseconds == 1 millisecond
    std::cout << "Elapsed time since previous frame(microseconds): " << clock.getElapsedTime().asMicroseconds() << std::endl;
    // Start the countdown over.  Think of laps on a stop watch.



You will notice the addition of an sf::Clock to our game.  The Clock provides the most accurate time that the underlying OS is capable of giving (different timers have different resolutions, and this timer needs to be very precise!).  As soon as it is declared, it starts counting.  Think of sf::Clock like a stopwatch that starts automatically.  Each “lap” you can read the elapsed time using getElapsedTime() and you can start a new lap by calling restart().   In this example we get the elapsed time in microseconds.  There are 1000 microseconds in a millisecond, and 1000 milliseconds in a second, so a microsecond is one millionth of a second.  Like I said, we need precision!


So that is the process of creating a very simple SFML application, clearing and displaying the window, tracking how much time elapsed and handling events.  In the next tutorial we will look at events a bit closer and see how best to handle keyboard input.


The Video


Gamasutra Feature Articles

Creating scalable backends for games using the open source Orleans framework

October 09, 2015 05:04 PM

"Orleans can be used to develop anything from complete game servers to scalable backend services. Two Halo titles used it to implement all of their backend services. You can do so as well." ...

Blog: The secret to designing the perfect level?

October 09, 2015 04:19 PM

A journey through one game's design: "What you ultimately want to give to players is an ideal environment in which they can enjoy whatever you'd like them to experiment at its finest." ...

Effective game coding principles: 'Ya ain't gonna need it'

October 09, 2015 03:57 PM

"This principle comes into play when you're programming something that you're guessing you might need at some point in the future. The basic premise is that generally speaking, you aren't going to need it." ...

G2A slams Riot's League of Legends sponsorship ban

October 09, 2015 02:12 PM

Recently banned League of Legends sponsor G2A has branded Riot's sanctions "unfair" and "aggressive." ...

Battling BitDefender

October 09, 2015 02:01 PM

"Steam has a page all about false positives in antivirus software so obviously I'm not the first developer to encounter this. Still it feels like a problem I just shouldn't have to deal with." ...


Cinder releases Version 0.9

October 09, 2015 11:59 AM

The open source C++ creative coding toolkit Cinder has recently released version 0.9. This release adds support for OpenGL ES 2 and ES 3, in addition to the latest desktop versions of OpenGL. Cinder supports targeting Windows, OS X, iOS and WinRT, with Linux and Android support under active development. In addition, this release adds support for Google’s ANGLE project, allowing deployment of OpenGL ES 3 applications on Windows and WinRT through a DirectX emulation layer. Cinder is released under the BSD License and is used by professionals in the creative and technology industries for everything from interactive installations to user interface prototyping to live concert visuals.

Gamasutra Feature Articles

30 day PlayStation Now subscription model arrives in the UK

October 09, 2015 11:10 AM

Sony has introduced a new 30 day subscription model to its PlayStation Now streaming service in the UK. ...

'Line the pipes!', or Testing your mechanics for flow

October 09, 2015 11:03 AM

"You need two things. The first is the game mechanics your trying to evaluate. The other thing you need is to get yourself annoyed. Really." ...

Vertical layering in game music: LittleBigPlanet and beyond

October 09, 2015 08:00 AM

With this piece, "we've completed our exploration of arrangement techniques for countermelodies that are effective within a Vertical Layering structure." ...

A former mentor recalls the early career of Satoru Iwata

October 09, 2015 08:00 AM

'Iwata was a so-called otaku,' recalls Yash Terakura, who mentored Satoru Iwata when he was a college kid eager to learn more about computers. 'Of course, we did not have that term at that time.' ...

Game From Scratch

Why Does Adobe Keep Buying Everything I Like

by at October 08, 2015 11:19 PM

So I fire up my iPad and notice this strange new icon:


What the heck is this? So I fire it up to discover it's Adobe Graphic. I dont have any such program installed? So I fire it used and low and behold, it's iDraw. What's iDraw? Its an extremely affordable and easy to use alternative to Ilustrator, think Inkscape but with a UI that doesnt take you to dark dark places. So apparently Adobe purchased iDraw, although there were no such announcements.

I have long been a fan, I own it both on my Mac and iPad and use it all the time. In fact I even did a game art in iDraw tutorial here in the past. You know what one of my favorite things was about iDraw? That it wasnt Adobe! :/

This is actually the second company whose products I use that Adobe purchased this year. Early they bought Mixamo a great animation resource for indie and AAA developers alike.

I have a sad feeling Adobe purchased iDraw to have a Vector app on iPad and the desktop version is as good as dead. My more foreboding fear is that it gets rolled into an Adobe subscription I simply dont want to pay for. Only time will tell. Thank goodness Blender and Krita cant be acquired!

EDIT- OK, epic fail on my behalf. Adobe didnt acquire iDraw, Autodesk (3D Studio, Maya, etc) did. This makes a GREAT deal more sense and may in fact be a good thing. My goodness do I need to start getting more sleep!

Gamasutra Feature Articles

Zynga launches ads that are games into its games

October 08, 2015 09:11 PM

They're a mobile ad engagement booster, apparently -- and so the company's players will be subjected to its new SponsoredPLAY ads, after a successful beta. ...

Geeks3D Forums

Intel HD Graphics Driver v4300

October 08, 2015 08:25 PM

Download from Microsoft

Toshiba only 64bit


Gamasutra Feature Articles

Get a job: Hangar 13 is hiring an experienced Graphics Engineer

October 08, 2015 07:46 PM

Novato-based Hangar 13, the newest 2K Games studio, is looking for a seasoned graphics programmer to work alongside the team on Mafia III at its Novato, CA headquarters. ...

Unity seeks to preserve old Web Player games as it kills the tech

October 08, 2015 07:24 PM

Unity has plotted out the end of its browser game platform in a public roadmap, while also promising to investigate alternatives for making old Unity Web Player games playable in modern browsers. ...

Geeks3D Forums

Performance Considerations for Resource Binding in Microsoft DirectX 12

October 08, 2015 07:04 PM

With the release of Windows* 10 on July 29 and the release of the 6th generation Intel® Core™ processor family (code-name Skylake), we can now look closer into resource binding specifically for Intel® platforms.

The previous article “Introducti...

Gamasutra Feature Articles

Don't Miss: An inside look at how Valve developed Portal

October 08, 2015 06:35 PM

Erik Wolpaw, Kim Swift & Jeep Barnett explain how and why Valve managed to create its seminal Portal puzzle game in this classic feature reprinted from a 2008 issue of Game Developer Magazine. ...

PopCap hops on the theme park bandwagon with a real-life PvZ arena

October 08, 2015 06:21 PM

EA-owned PopCap Games is the latest video game company to make eyes at the amusement park business, announcing plans today to open a Plants Vs. Zombies attraction at the Carowinds theme park. ...

U.N. retracts, apologizes for error-ridden cyberviolence report

October 08, 2015 05:46 PM

The Broadband Commission has retracted a controversial report it touted at a recent U.N. event calling for greater effort to combat online harassment & violence, especially against women and girls. ...

Big game events: A press coverage analysis

October 08, 2015 05:11 PM

"Large events are very unique beasts, they concentrate a lot of the communication happening in the game industry. It is clear they are growing in terms of their media coverage too." ...

Creating joy: How Butt Sniffin Pugs came to life

October 08, 2015 04:33 PM

"If we could catalyze a multiplayer experience that revolved around joy, not only would it be memorable, but it would be fulfilling for us as developers! What better way to feel good about your game?" ...

Sony acquires gesture recognition and imaging software dev, Softkinetic

October 08, 2015 02:44 PM

Belgium-based gesture recognition and range imaging software developer Softkinetic has been acquired by Sony for an undisclosed fee. ...

Sony cuts PS4 prices in U.S. and Canada, announces holiday lineup

October 08, 2015 02:09 PM

Sony has dropped the price of its flagship console in the U.S and Canada in preparation for the holidays. ...

Sponsored: Optimizing Unity games on Android: A case study

October 08, 2015 01:58 PM

This article will show a performance gain with x86 native support on Android and share some tips for increasing performance on Intel architecture using Hero Sky: Epic Guild Wars as an example. ...

Live eSports coverage heading to the BBC for the first time ever

October 08, 2015 01:26 PM

The BBC will broadcast the League of Legends World Championships when the quarter finals come to Wembley on October 15. ...

Mobile devs: License an engine or create your own?

October 08, 2015 01:22 PM

Mobile studio Sproing's head of programming considers the issue: Go with in-house tech, or license Unity or Unreal Engine for mobile game development? ...


Arstechnica Metal vs OpenGL benchmark - perhaps not quite what you expected

October 08, 2015 01:05 PM

The benchmarks use Manhattan and T-Rex, both high-level tests that render a full 3D scene. Manhattan is the more demanding of the two, and it uses more complex lighting and effects. The ALU, Driver Overhead, and Texturing tests are low-level ones that attempt to measure some specific aspect of graphics performance. For whatever reason, the OpenGL version of GFXBench consistently beats the Metal version in the T-Rex, ALU, and Texturing tests. And usually it’s not winning by a little, it’s winning by a lot. There are many cases where OpenGL still performs better despite the fact that Apple’s implementation is out of date, and there are other cases where Metal might perform a little better but may not be worth the extra programming complexity that comes with low-overhead APIs.

New OpenGL podcast series

October 08, 2015 12:50 PM

Kai Niklas from OpenGL Trainer has started a new podcast series on OpenGL and Vulkan. Although young, the series is looking promising.

Gamasutra Feature Articles

Max Gentlemen: A cross-platform postmortem of a game that 'lost us a lot of money'

October 08, 2015 11:06 AM

A catalog of mistakes made and bad decisions: "Consider the game a charitable donation from us. It's good to get our sophomore slump out of the way." ...

The Humanist Methodology: Hiring is the most important thing we do

October 08, 2015 08:00 AM

"How you hire, fire, and build your team will define your success as a leader, so you better be good at it... or you won't be a leader for long." ...

Fundraising after failure

October 08, 2015 08:00 AM

"I'm here to talk to developers who might have failed in the crowdfunding world and want to work their way up to deliver on the promise of projects many others believe in." ...

Gamasutra Feature Articles

Video game voice actors overwhelmingly authorize strike

October 07, 2015 11:22 PM

Negotiations between the game industry and the leading actors' union, SAG-AFTRA, have taken on a new tinge as the actors vote in favor of a strike. ...

U.N. vows to battle online harassment -- while tarring games

October 07, 2015 10:27 PM

UPDATE A major governmental agency pledges to battle online harassment of women -- while at the same time drawing fire for unfairly criticizing video games. ...

Grey Goo developer Petroglyph lays off staff

October 07, 2015 09:57 PM

Gamasutra has learned that Las Vegas-based Petroglyph Games laid off more than a dozen people this week, primarily in its production and art departments, due to a lack of funds. ...

Nier's outspoken creator on why he includes atypical voices

October 07, 2015 09:53 PM

"I don't believe I'm some sort of example of someone anti-discrimination. In the past and up until this point of my life, I'm guilty of bullying, hating others." ...

2K seeks a Senior Game Engine Engineer for its Core Tech group

October 07, 2015 09:30 PM

"Core Technology is a forward-thinking group of experts who handle the challenge of supporting multiple products, platforms and studios, while at the same time anticipating the needs of tomorrow." ...

The power of politics in games, 1980s-style

October 07, 2015 09:25 PM

"It was quite primitive, but for the dawn of the computer age, the predictive results seemed miraculous." - Nelson Hernandez, developer of President Elect ...

Video: Why game designers should study dance, music &amp; comedy

October 07, 2015 08:10 PM

At GDC 2014 writer Susan O'Connor (Bioshock, Tomb Raider) argues game devs can learn from watching how dance, music & comedy artists use timing and motion to draw people into the experience. ...

Modders pick up Spacebase development where Double Fine left off

October 07, 2015 07:44 PM

A group of Spacebase DF-9 fans released a significant update to the game last month that fixes known problems and adds new features, nearly a year after Double Fine ceased developing it. ...

So you're going to be an indie parent

October 07, 2015 05:42 PM

"Lately I feel like I've been having the same conversation over and over. This conversation starts like this: 'We're having our first child soon! We're excited but sort of terrified. How does this work?'" ...

Game From Scratch

SFML with C++ Tutorial Series–Configuring Visual Studio 2013

by at October 07, 2015 05:26 PM


This text tutorial is a companion to this video tutorial showing how to create and configure a new SFML project using Visual C++ 2013.  If you are running Visual Studio 2015 instead, the process should be virtually 100% identical, although you will have to download a different set of files.


First you need to download a version of SFML.  Head on over to the SFML download page and select the newest SFML version, as of writing 2.3.2:



Now you need to figure out which version to download.  This mostly comes down to identifying what C++ compiler you are using as well as the “bit-ness” you want to target.  Keep in mind, even though you OS is 64bit, it is likely that you want to use the 32bit version.  This is especially true if your game is meant to run on Windows XP.  A 32bit binary can run on a 64bit OS, but not the opposite.  Additionally, for a 2D game, 64bit doesn’t really get you all that much in return.  In the end though, it doesn’t really matter which one you choose, just be aware of the results.



Now that we have SFML downloaded, extract the resulting zip file somewhere.


Now load up Visual Studio and create a new C++ project of type Win32 Console Application:


Name it and locate it however you want then click ok.


A new window will pop up, click next, then on the next screen, I used the following settings:


Click Finish.


We now have a project, let’s add a bit of code to it.   In solution explorer, right click your the Source Files folder in your project and choose Add->New Item..



Now choose C++ file and name it Main.cpp.



Click Add and your file is created.


Now enter the following code:

#include "SFML/Graphics.hpp"

int main(int argc, char** argv)
  sf::RenderWindow renderWindow(sf::VideoMode(640, 480), "Hello SFML");
  while (true){


You will notice lots of errors in Visual Studio, like so:


Don’t worry, we will fix these in a second.


Copying files from SFML

Open up the archive you downloaded earlier from sfml.  The contents should look something like this:


Copy the folders include and lib to your project directory, which should now look something like this:



Leave the SFML folder open, we will need it again in a second.


Configuring Visual Studio


Now that we have the libraries and header files copied into our project, we need to tell Visual Studio about them.  Right click your project and select Properties:



In the resulting dialog, select C++ on the left, then Additional Include Directories:



Enter the following value (for more detailed explanations, watch the video, it goes more into the why of things):


Make sure to hit enter and it goes bold so you know your setting was saved.


Now we need to configure the linker.  On the left hand side select Linker instead of C++ then Additional Library Directories:



Now enter the following:



Next we need to add our lib files.  Under linker, select Input, then locate Additional Dependencies on the right.



Assuming you are using all of the components of SFML and linking to DLLs ( see video for more options ), click in the white area and select edit and add the following (order is important!):



Your project should now be configured.  Hit CTRL+SHIFT+B to build it.  Don’t run it yet, it wont work without the DLLs, but we need to build it once to have the proper folders made.  Assuming your build went without errors, you should now have a Debug folder inside your project directory, like so:



Now, remember the SFML zip file I told you to keep open?  Switch back to it and select the contents of the bin folder:


And paste them into your Debug directory.  This folder actually contains both debug and release dlls, and you only need the debug for now, but disk space is cheap, no? :)  We will cover building for release at a later date and I will go into the difference in more details then.


Now your “game” should be ready to run, hit F5:



Congratulations, you just completed your first successful SFML project.  Now let’s head over to the next tutorial and make it actually do something!


The Video


Gamasutra Feature Articles

Designing smooth systems

October 07, 2015 05:19 PM

"Always design for fun. When you can keep your mechanics consistent and allow for innovation, you bring your world alive to players and offer even more fun." ...

Designing the fearsome creatures of Total War: Warhammer

October 07, 2015 05:02 PM

We talk to Creative Assembly about translating the Warhammer world into the Total War framework, and why creating an array of monsters is much harder than traditional human-on-human combat. ...

In-game events: A sure shot for increasing revenues

October 07, 2015 03:57 PM

"While in-game events can truly cover the gamut, from special, limited-time characters to tournaments, all good ones have one thing in common: they have a dramatic positive effect on revenues." ...

League of Legends creator bans G2A from sponsoring eSports teams

October 07, 2015 03:36 PM

League of Legends creator Riot Games has formally banned G2A from sponsoring any eSports teams involved in League after the key reseller violated competition rules. ...

Losing control of difficulty in game design

October 07, 2015 02:54 PM

"At the end of the day, you're never going to be able to please everyone in terms of difficulty. There will always be people who will find your game laughably easy and those that fail." ...

Nintendo reveals Splatoon and Mario Kart 8 Wii U bundle

October 07, 2015 02:12 PM

Nintendo is bringing a new Wii U bundle, featuring Mario Kart 8 and Splatoon,to UK stores on October 30. ...

Telltale pulls high-profile games from the App Store

October 07, 2015 01:39 PM

Telltale Games has been forced remove a number of games from the App Store due to issues brought on by the release of iOS 9. ...

Game Design Aspect of the Month

Upcoming Events: NY Comic Con and Immersive Edge

by (Sande Chen) at October 07, 2015 12:00 PM

I'm finally making some virtual appearances, though you can catch me in person at New York Comic Con tomorrow, October 8! I will be there with colleagues Caitlin Burns, Steele Filipek, and Matthew Weise on a panel about Writing for Video Games.  It'll be broadcast live on NYCC Livestream.  Just go to Twitch and check out NYCC's Live Stage.

New York Comic Con
Writing for Video Games
Thursday, October 8, 2015, 11:30 AM

Secondly, I had a great time at the first installment of Game Writing Portfolio Workout on September 28.  We didn't have time to practice quest writing and interactive dialog, but definitely can during the second class on October 20.

Tickets are available here through PlayCrafting NYC and of course, there's still the early bird price if you sign up early.  The first workshop was sold out, so make plans to come soon!  No virtual appearances for this one because PlayCrafting believes hands-on attention and interaction is what makes its classes so valuable.


Finally, on November 8, I will have the unique pleasure of attending the launch of Immersive Edge, a collaborative Hypergrid story written, built, and produced by 25 persons.  My avatar will be there in the virtual world to do a short presentation about how technology affects storytelling.  Check out the trailer below to learn more about Immersive Edge.

Geeks3D Forums

NVIDIA Geforce driver 358.50

October 07, 2015 11:40 AM

This new GeForce Game Ready driver ensures you'll have the best possible gaming experience in the Star Wars: Battlefront Open Beta. This driver also brings support for the latest OpenGL AR...

Gamasutra Feature Articles

5 helpful tips behind P.A.M.E.L.A.'s Steam Greenlight success

October 07, 2015 11:02 AM

"After a crazy week-and-a-half of possitive feedback, refreshing tabs, and all other sorts of craziness, P.A.M.E.L.A. has been Greenlit! I've done a post-mortem look back on the Greenlight process." ...