Welcome to the Facebook Instant Games SDK Tutorials. This series of tutorials covers many aspects of using the Facebook Instant Games SDK.
Introduction to Facebook Instant Games
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. Eventually I will move onto the IGX SDK, which is a wrapper which enables you to deploy your Facebook Instant Games to other places without code changes.
What is Facebook Instant Games?
Facebook Instant Games (IG) is a relatively new gaming platform that runs on the Android, iOS and desktop platforms. It is supported via the various Facebook apps such as Facebook and Messenger. The main features of the platform include:
- Connecting players – Friends can play games together using a sort of turn based mechanism using contexts. Players scores can also be tracked via leaderboards. These features are useful for bringing in new players and increasing retention.
- Social sharing – Players can share their game progress with friends, this is useful for bringing in new players.
- Game bots – Players can sign up to be notified about changes within the game or changes made by friends within the game which is useful for retention.
- Monetisation – Developers can earn revenue from interstitial / rewarded adverts. Android and desktop also support in-app purchases.
- Game switching – You can push users to your other games via game switching. This is useful when marketing a new release.
- 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.
IG is designed with bringing players together in mind so simply porting any old single player game over to IG will not work. Most games will need a significant re-think and should be re-designed to take into account the social aspects of IG if they are to stand a chance of succeeding.
What Constitutes a Facebook Instant Game?
Games created for the IG platform are written using HTML5, CSS and JavaScript, both Canvas and WebGL are supported. To distribute your game you basically zip up your html, css, js and assets into a zip file and upload it to Facebook via the developer dashboard.
There are a number of popular game engines available which support export to IG. My own personal favourite (because I wrote and maintain it :)) is the Booty5 game engine and game editor. Booty5 spits out a working IG game into a folder which you can then zip and upload to Facebook.
Unity 3D does not support export to IG out of the box, although some developers have had some success modifying the exported base unity loader to make them compatible with some devices. This is not a route that I would recommend to developers as it is too risky.
Setting up a Facebook Instant Game
In order to add your games to IG you will need to create a developer account at https://developers.facebook.com/. Once created you can create an app and then upload your game via the web hosting options. This tutorial series isn’t about walking you through getting your game onto IG so to find out more about getting your game onto IG see https://developers.facebook.com/docs/games/instant-games/getting-started
I recommend reading the guides found at https://developers.facebook.com/docs/games/instant-games/guides and the SDK reference found at https://developers.facebook.com/docs/games/instant-games/sdk.
Anything else I should know?
Yes a few things:
- In order to submit your games for review you will need to have a valid Apple developer account, even if you do not plan on supporting iOS.
- In order to receive exposure from Facebook and earn revenue you must also create a verified business on Facebook. See https://www.facebook.com/business/help/1710077379203657 for details.
- The Facebook Instant Games SDK relies heavily upon asynchronous callbacks using promises.