Thursday, February 2, 2012

Social Gaming

Subject: Social Gaming

  • note: originally emailed 02/02/2012 and sanitized for public consumption
  • sidenote: posting here so i can lead people here whenever they ask me about this stuff...

I haven’t done any FB apps, but I just ‘made’ a FB app following some dirt simple instructions.

You can see it here:

The ‘app’ is actually hosted outside of Facebook:
  • You can right click on (on the very right edge of the flash content and scroll bar, if you can) and see that it’s just an <iframe> (what Facebook is calling the canvas) pointing to the source of that asset.
    • You should see it open to: (or if you are having trouble getting the right click menu button to show the browser menu instead of the flash menu)

So, getting stuff to show up on Facebook is easy.  The power comes when you want to do things like inviting/playing with friends, integrate with Facebook’s credit (payment system) and other features that tie into their API’s.

For example, to look yourself up on Facebook’s API system:

And using code facebook has provide at:

You can, for example, fetch all of your friends:

require 'facebook-php-sdk/src/facebook.php';

$facebook = new Facebook(array(
    'appId' => 'YOUR_APP_ID',
    'secret' => 'YOUR_APP_SECRET'

$me = $facebook->api('/me/friends');
 * access all the information of friends
 * $me has the JSON detail of all the facebook friends of the current user

foreach($me['data'] as $frns) {
    $id = $frns['id']; /* make the echo statement a little easier to read */
    $name = $frns['name']; /* make the echo statement a little easier to read */
    echo "<img src="$id/picture" title="$name" />";

There are much more terse ways to do this.  They are all found on Facebook’s developers docs:

The following is where I got the dirt simple instructions from:

So, to answer the original questions:
  • To Build FB games:
    • You can use whatever flash, unity or plain ol HTML assets you have.

  • To scale FB games:
    • FB punted on this and makes the developers host the content.
    • So, you will need servers for the (static) pages.
    • You will need more servers if you want to do things outside of the FB infrastructure.
      • Like what? May be like a [super awesome] mechanism that FB’s systems doesn’t provide.

That’s all I got for a few of hours of research…

No comments: