Defold on Facebook Instant Games

I think the problem is just the way different browser tech handles things. On iOS it as is looks right, but in Chrome and Android app the game is cut off improperly. The sanitize.css normalizes things so the behavior is the same on iOS and Android etc. the way you want it. It would probably be good to add https://github.com/jonathantneal/sanitize.css directly to the template as it will probably show up for others later too. But there may be a smaller css change that could be made too if you can track down exactly what’s wrong.

2018-03-20%2004_08_51-Instant%20Games

29386694_1539139349532094_740035363455631360_n

Idea for how to produce images like this in HTML5 and convert to base64 image for posting?

Can use stock but personalized would be better. Special render target and then get the texture data of the render target and then convert?

Maybe use Canvas.toDataURL() somehow?

I’ve been thinking of this as well. Some games include a screenshot and that would require us to get screenshots working on HTML5. My extension is currently not handling it (although @AGulev has some ideas). Another is:

I tried this but didn’t get it to work. I haven’t spent that much time with it so it could still be a way forward.

This could also be a viable approach I think.

2 Likes

Our first FB Instant game with Defold released: https://www.facebook.com/instantgames/285409181956230/

Thanks @britzl =)

11 Likes

Got this warning when testing. Looks like Defold team needs to fix a certificate used by g.defold.com that just expired yesterday.

3 Likes

I think it was a cache issue. I got it as well and t was solved with a refresh.

4 Likes

Here is the line which fixes the previous “clipping” issue to make Chrome/Android behave like iOS

canvas{
	vertical-align: middle;
}

The other CSS may still be helpful but this is what fixes the specific issue.

2 Likes

spoke today with Facebook about Instant Games marketing. Basically they have nothing on offer. Kinds of they link to the instant games fb group for it. I understand they’re not sure how it takes off, so holding off any processes/initiatives.

Well, then I suggest you all join their Instant Games support group on FB. Sorry I don’t have the link for it now.

4 Likes

The group is https://www.facebook.com/groups/instantgamedevelopers/

I’ve posted a few questions without answers… but have also been able to answer other questions.

I have 2 simple games for Instant in polish now (one is a “why not” game) and then I’ll be making some more in depth games for it. I’ll make some games with Defold exclusively for Instant for a while to give it a chance. Also an important thing I feel that I’m focusing on is using the features of the API as much as possible.

3 Likes

on the other point, my friends at FB shared plans for a gamejam for instant games. Will follow up on it and share as much as I can.

5 Likes

I’ll 100% participate on that!

2 Likes

Some Facebook Instant related videos

And a bonus

3 Likes

Another option to make the personalized images (which some games seem to do) is to do it based on a server. Not ideal but it’s an option. An in app option would be better to avoid the extra bandwidth and service costs.

Need to figure out why Android and Chrome goes from 0 to instantly 100% once done loading instead of showing any loading progress. I’m certain for any game larger than 1MB it will cause many impatient people to exit early and never play the game. Even at 1MB the loading time with no progress will make many people think it’s broken and quit it.

Are you sure it’s the loading time? The progressbar will show the time it takes to download the content. Once it’s downloaded it takes some additional time to parse the javascript as well (webassembly will reduce this time).

On iOS the progress goes correctly from 0 to 100% as the game downloads, and then there is a slight wait at the end before you can play. Android it’s the instant jump from 0 to playable.

There’s a way to link directly to your game in Messenger. This is useful because it can help people on mobile open the game on the Messenger app directly I assume? And that’s the only place ad monetization can happen at the moment so it’s where you want people to play.

https://www.messenger.com/t/TetrisMessenger?game=tetristhegame

https://www.messenger.com/t/BotPage?game=AppID

You can omit the botpage and it will open the game in a self context

https://www.messenger.com/t/?game=AppID

The AppID is the number associated with your game on the dashboard.

A lot of games use smaller message images but you can use larger ones too such as 960x502.

The Pedro Rodrigues video has an answer to the IAP question. Right now they only are supporting it in a single game and only on Androiod while they finish building the system.