Defold on Facebook Instant Games

I hope FB makes the activity store api available again. Super useful for games that need to persist game state but doesn’t want to write their own backend.

2 Likes

I’d guess if you submit an Instant Game today it would be able to go live at the end of May.

5 Likes

IAP is live for everyone but that’s news a few days old.

2018-05-03%2013_15_42-Instant%20Game%20Developer%20Community

Friends only leaderboard is live with 6.2 https://developers.facebook.com/docs/games/instant-games/sdk/fbinstant6.2

2 Likes

I’m gonna get started with the leaderboards and IAP functionality beginning of next week.

5 Likes

People should know with IAP that since it’s on Apple App Store / Google Play Store first Google/Apple takes their 30%, then Facebook takes their 30% of what’s left, and then you get what’s left after that. So be aware that for anything you sell you’re only going to see about half of it.

4 Likes

let me resurrect this thread a bit. There’s a nice “so this platform is dead” thread on the FB IG community: https://www.facebook.com/groups/instantgamedevelopers/permalink/858795660983261/

Folks share their $1/day revenue stats and discuss how everything gonna be much better once Unity supports the platform :thinking:

And there’s a reply by a FB platform engineer:

It’s a credit to this community that the conversation under here is so constructive.

Instant Games is a growing platform with a large audience, but we’re not standing still. We know we have work to do around making it easier for players to find games that they will love and this will be a focus for us going forward.

We have a diverse, global audience and we’re working with our Audience Network team to improve developer value on the platform. We know that some markets are not conducive to high CPMs and will be delivering more tools to target players in specific countries.

We really value and appreciate constructive feedback and all of your ideas on how to improve. We want to make this a developer first ecosystem and that takes time.

That said, anybody had a better than a $1/day experience on Facebook Instant Games?

2 Likes

Problem is that a bunch of people flooded the platform with duplicate copies of the same game / stole the source of HTML5 games they didn’t even make / published template games as is. I doubt Unity will really impact this situation.

So that cuts off some of the free traffic you would get on launch as you are competing with a lot of trash. They rate limited everyone to only publish 1 new app a week or something, but that still doesn’t stop the spammers who simply use multiple Facebook accounts. Most of these guys live in countries where it’s worthwhile to chase the smaller amounts, it’s still more money they would get than publishing the same kind of stuff on any of the app stores.

But! Almost none of those low effort published games implement any of the actual features of the FBIG platform. Which limits their growth to basically zero. So I think it should still be possible to publish a hit on there if you do include social features which enable your game to spread, and can drive some seed traffic to your game. The platform should detect your game is actually good and will reward you with more long term viral spread.

Just don’t expect to make money without investing money. Don’t expect to get money just from publishing something there, it has to use the features of the platform. And don’t invest what you can’t afford to lose. Publish your games on other platforms too.

3 Likes

Hi @AGulev, this game stretches all the way to the edges. How did you achieve this? I havent yet figured out how to:

  1. Make the game cover the full screen area (without black bars)
  2. Calculate where the actual screen edges are for the gameworld when the game is resized (I’m testing in the local exported window)

Would be great to hear how you managed to figure out 1, and maybe 2 as a stretch goal. :slight_smile:

Hi,

  1. I am using this template you can use in game.project -> [html5] -> htmlfile (html shell) engine_template.html.zip (1.6 KB)
    (it contains sample code/html, you can read and change according your game)
    Also you can check html temlate in FBInstantGames NE for Defold here (would be better to use this template, I think.): https://github.com/defold/extension-fbinstant/blob/master/fbinstant/index.html

  2. You can use one of the camera assets from assets portal:
    https://www.defold.com/community/projects/76573/
    https://www.defold.com/community/projects/84064/
    I am using my own code, and it’s harder for understanding than these amazing assets

5 Likes

Thanks @agulev, this is a great help. The Rendercam camera works great, now I just need to get the HTML right. See below for where I’m at at the moment. I’m using the original HTML template you linked to, the only change being I replaced the resize_game_canvas() method with the one in your template.

Would be great if the HTML template worked the same as the Defold player, would save so much time! Let us know if you have any ideas on how to get the HTML to respect the Rendercam’s wishes! :slight_smile:

I had same problem with rendercam if I remember right? I switched to Orthographic and it worked better.

2 Likes

Oh yeah? Will check out Orthographic and report back.

1 Like

@Pkeod, you were right! Check out the awesome result using Orthographic camera:

This will make testing so much easier, because the Defold player appears to behave exactly like the HTML template: facebook_instant_template.html.zip (2.2 KB)

5 Likes

Happy to hear that my extension works well! Although I do wonder why RenderCam didn’t give you the same results… hmm… I would have though that RenderCam also updates view projection when window width and height changes…

4 Likes

Huh, sorry RenderCam isn’t working for you! I will look into it.

[Edit] @totebo Can you send me the HTML file you are using that does not work with RenderCam? I tried the first one AGulev posted and it works fine for me. Does it fail when you “Build HTML5” from the editor, or only when it’s bundled?
[Edit2] …Durr, you did post it, sorry.
[Edit3] Hmm, seems to work fine here. Can you give me any more information on how to reproduce the bug?
RCam_HTML_Window_Debug

3 Likes

Try it as a Facebook instant game on mobile iOS/Android. That’s where the problems happen.

3 Likes

I may well have configured it incorrectly to be fair! But in the end I got it working great in the Defold player, but when exported to HTML I didn’t get the same result. Which probably means the HTML template didn’t play nice with the cam for some reason.

OK, thanks. I will try it on Android. But @totebo in your earlier post it looks like the fixed height wasn’t working correctly on a desktop browser too? I tried AGulev’s original HTML template, the same with the modification you described, and the latest FB version you posted. Unfortunately, they all worked fine for me so far (on desktop).

1 Like

That is strange! Probably because of my configuration of the camera then.

My client spotted that these broken API calls are still there. May be a good idea to at least acknowledge that they shouldn’t be used in the docs?