Introduction to Facebook Instant Game Development

Introduction to Facebook Instant Game Development

This is the first part of my tutorial series that covers Facebook Instant Game Development. Over the coming months I will be covering all areas of the IG SDK, providing information, examples and hopefully working code :). I will also be throwing in some back-end tutorials, showing how to write bots, messaging systems and so on.

Its the new developer craze, well sort of, its still a bit niche at the moment because compared to the app stores, users are very low and paid user acquisition is not yet an option.
Instant games (or minis) are small games that load more or less instantly within apps such as messenger apps (for example Facebook Messenger). They are created using HTML5 / Canvas / WebGL and JavaScript so they can be easily delivered to users without app store approval, although you do need to get Facebook approval which is sometimes much quicker.

So what are the advantages of developing and releasing products for platforms such as Facebook Instant Games? First and foremost is that it is quite easy to get something on there quickly, although delving deeper into the Facebook Instants technology does become a lot more complex when you start to create more social games, you will need to start thinking about writing your own back-ends for example. It is also fun, the bit I like about it the most. The platform is also good for testing iterative improvements out on very casual gamers as once your game is reviewed and approved further updates do not currently need any approval.

What are the downsides? Discovery and retention are bad, I’m talking single digit day 1 retention figures and players numbering in the hundreds per day in mainly none English speaking low revenue countries. The system is also currently winner takes all where a few games at the top take up most of the visibility so breaking through is incredibly difficult. My advice is do not think that you can dump any old game onto IG, for example simply porting an existing web game not designed for IG, it just doesn’t seem to work. The top games all feature integration at various levels to the IG SDK, this is your only source of retention and discovery.

Features

What sort of features does Facebook Instant Games have from a game developers perspective?

  • Its main and most important feature is that it enables social play between people and groups of people. To get to the basics you do not need to create a complex back-end, its all available from the SDK and handled by Facebook’s servers.
  • Important moments from within the game can be shared amongst friends and in other contexts such as groups.
  • Leaderboards are supported. Global, friends and context scoped leaderboards are all available.
  • Monetisation is available out of the box and easy to set up. You can show interstitial ads, rewarded video ads and offer in-app purchases, although IAP’s are limited to Android only. Ads are limited to mobile and not available on desktop.
  • Metadata support, almost everything you send anywhere can have some kind of meta data attached. For example, if I post my score to a messenger conversation I can attach some replay data which can be picked up by anyone that clicks on the message when the game is launched.
  • Bots – Whilst a blessing and a curse, chat bots can help to remind users to come back to your game and play increasing your retention. Not a fan of them but they have their uses. Its possible to build a complex back-end bot which practically becomes an extension of the game play itself.
  • Analytics – You can track various default events for your game as well as send custom events which you can view in the analytics section of the developer dashboard.

Context

Facebook Instant Games revolve very heavily around the concept of the context. What is a context? A context is basically a collection of players in some area of Facebook. A few examples:

  • Two people in a messenger chat. This is a context with two people
  • A Facebook post – This is a context with many people potentially on the same thread

Each context has its own unique ID that allows you to identify it and switch into it to perform operations in the context, What sort of operations? Once you are in the context your game can perform various operations such as get all of the players in the context, post messages to the context about the current state of the game. You can also store and retrieve leaderboard scores that are specific to that context only. Context ID’s are unique and persistent so you can store a context’s ID and come back to it at any time.

You generally post an update to a context when something important happens in your game. For example, you have just beaten a level and you want your friends to know. This helps with discovery because all players in the thread or chat or whatever context you are in will see the rich message (a message usually consists of an image from the game, a title, a sub title and a call to action button). The rich message can also contain hidden meta data about the game, this will be passed to the game when anyone clicks the posted call to action to launch the game. This enables information to be passed around from player to player in a none real-time / sort of turn based environment. I say sort of because you need to exit the game and run it from the other players message to take the next turn in the game. You can of course get around this by creating your own back-end to marshal the messages around.

Connected Players

Connected players are basically players that play your game and are connected to you on Messenger. This list is very useful because you can do things like show a list of familiar players that the player may wish to play, or maybe send a gift / ask for help.

Getting Started

You can get a hold of the Instants SDK from the Facebook developer website, note that you do need to be a Facebook developer to submit games, so you should sign up here.

Whats next?

In the next part of this tutorial series I will introduce you to an overview of the Facebook Instants SDK and show you how you can begin integrating your game into the Facebook Instants Game platform.

Wrapping up

Facebook Instants are an exciting new technology full of possibilities for game developers from all backgrounds and fun to play with as a gamer and game developer. Fingers crossed that Facebook Instant Games continues to grow and improve with each new iteration. It is still in its infancy however so be warned and do not invest crazy amounts of time and money into it like I did. Ease in gradually and try to re-use as much as possible of what you already have, but don’t just dump games that are not designed for IG onto the platform, its just messy and unprofessional.

Leave a Reply