Instant Game plugin concerns and updates

2 favourites
From the Asset Store
Fantasy Game includes more than 600 sound effects inspired by hit computer games like World of Warcraft and Diablo.
  • Hi Scirra team,

    I have some questions and concerns regarding development and updates of the Instant Games plugin and want your view on it, if this is something that you will further improve or if the plugin we have currently is what we can expect?

    One main issue is that if we will need 3rd party plugins they will need to update variables in the official plugin. How is your stand on this? (this example concerns IG plugin, but the question is general really)

    This regards the Instant Games plugin. Many of us believe we are missing some very vital things in the current official plugin, and some functionalities is not implemented in a convenient way.

    Examples:

    -Missing switchGameAsync ( construct.net/forum/construct-3/how-do-i-8/instant-games-promo-135970 ) kytuzina

    -Missing ‘tag’ for which ad to show, making it possible to only load one ad at the time! Discussed with Artpunk Renfd ( construct.net/forum/construct-3/general-discussion-7/fb-instant-games-adverts-133364 ) (This issue is the same for leaderboard data and player score actually..)

    In this thread ( construct.net/forum/construct-3/general-discussion-7/c3-instant-games-sdk-much-prof-132977/page-8 ) you Ashley suggest to create our own independent plugins for additional functions.

    macube, paala and zjc121 have all been working on their own IG plugins for chooseAsync.

    The crucial thing is that this function (and also matchAsync and create Async) will need to update variables in your official plugin!

    (The official plugin request the context data in the initialize phase.

    Share Leaderboard update, load leaderboard, load connected players etc etc and some other things is totally dependent of the context, so if your later change context (without updating the variables in the official plugin) these functions will send and load wrong data. It will be totally out of sync, and the normal functions in the official plugin will stop work, since they will call the wrong contexts (both ID and type).)

    That’s mainly the reason why we have requested these functions in the official plugin. (the other functions such as updateAsync and switchGameAsync do not need to change variables so they could easily be implemented in a 3rd party plugin, but they are so small and easy so I would "suggest" to also include them in the official, if possible.)

    Official suggestion:

    construct3.ideas.aha.io/ideas/C3-I-486

    I add also add METR1C nlon stuatk jagoman here, since I know they are IG devs as well. Edit: add KaixaZero warmon KENYONB

    I would like to hear your views on what you all think is missing and what is most important to have.

    Is the current plugin classified as Finished or is it Work in Progress?

  • I think we've got enough features down for the current iteration of the plugin. For every feature we have there are a bunch of people who want us to implement a number of new things. As you can see on the feature suggestion system there are literally hundreds of things people want us to work on. We have only a few developers, as well as a couple of major projects currently in-progress. Time is by far our most limited resource. Everyone argues that their suggestion is the most important thing to work on, but that doesn't mean there are more hours in a day. This is one of the reasons we added in a voting system, since it can help inform our priorities (although it does not dictate it).

    I don't see why other third-party addons need to modify the official addon at all. Can't you just add separate actions and expressions to use new features?

  • I don't see why other third-party addons need to modify the official addon at all. Can't you just add separate actions and expressions to use new features?

    No, not in this case. That's exactly my point.

    It is possible to use chooseAsync to switch into a new context with a external plugin, or just with a javascript. And triggers will work fine. So yes it works.

    BUT if the "new feature" is to change the context (like in this example) it will be necessary to update contextID and contextType variable in the offical plugin as well. Otherwise all features in the regular/offical plugin (that are based on contextID) still have the old contextID, so the leaderboard update (or leaderboard load) will be from the wrong (old) context! Since the contextID in the offical plugin is only fetched on itializing.

    Hope you understand what I mean, otherwise I can create an example for you.

    (For some other features, like updateAsync it will be fine with a 3rd party plugin with its owns action. like you say. since that function will not change the context!)

  • BUT if the "new feature" is to change the context (like in this example) it will be necessary to update contextID and contextType variable in the offical plugin as well.

    Is it just these two variables that need updating?

  • Yes.

    In your plugin you first declare all variebles and set them to null.

    Then just before start layout, you fetch the player details and set all variables. The rest of them will never change withing the instance, so they will be fine:

    If I then check console for the contextID I see the same as in the plugin:

    But then when I change context via chooseAsync:

    I get a new context, which can be seen in the console. And it is now we need to change the contextID and contextType also in the official plugin. (ContextID will always be a new value, contextType can be the same but can also be changed)

    (Note, chooseAsync is not the only function that changes context, also match and create will do it, if used)

    So these two variables:

    needs to be updated in the official plugin, from the third party plugin. With the value from:

    Hope you get what I mean! :)

  • Well if it's just two variables this is easy to deal with. In the C2 runtime it's very simple - I just deleted those cached variables and make SDK calls every time they're needed so they'll update correctly. This is done for the next release and shouldn't need any code changes to third-party addons, the official plugin will just update automatically.

    In the C3 runtime it's a bit more complicated because it can run in a web worker in a different context to the Instant Games SDK, so it does need to cache the variables. To allow them to be changed I've added some methods to the official Instant Games plugin so callers can change the variables. I'm not sure if anyone's plugin supports the C3 runtime yet, but in case you need it, the relevant calls are:

    // Must check plugin used in project
    if (C3.Plugins.InstantGames)
    {
    	const igPlugin = this._runtime.GetPluginManager().GetPluginByConstructorFunction(C3.Plugins.InstantGames);
    	const igInst = igPlugin.GetSingleGlobalInstance().GetSdkInstance();
    	
    	igInst.SetContextId("...");
    	igInst.SetContextType("...");
    }
  • Feedback r109

    FYI. I can verify it works fine with the function to fetch Type and ID on the fly in the new r109 version of the plugin.

    Thanks for great and quick update Ashley!

    I tested to run this little function every time I go into a context. Works great! (would not work in versions below r109)

    The test:

    .

    So now people can continue to work on a new Instant Game 3rd party plugin then :))

    With the rest of the features! :)

  • I've always used browser execute javascript for switchGameAsync: "FBInstant.switchGameAsync('"GAMEID"');"

    Since it was a simple function with a simple workaround I don't mind for it to not be supported by the plugin.

    But there is some key features pending to be added yet, like chooseAsync, and I (and I think anyone) don't want to rely on a third-party plugin for it. So we got enough features for what we need or enough for scirra to promote C3 as supporting Instant Games?

    Also posting in the suggestion platform seems pointless. That place looks abandoned.

    Sorry for being salty here, I know scirra is very busy with C3 runtime (wich seems great), but I think the pratical solutions now is more urgent. Platforms like Instant Games is one that enables developers to monetize their works also enabling developers to keep their C3 subscription.

  • Also posting in the suggestion platform seems pointless. That place looks abandoned.

    I look at it daily.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • But there is some key features pending to be added yet, like chooseAsync, and I (and I think anyone) don't want to rely on a third-party plugin for it. So we got enough features for what we need or enough for scirra to promote C3 as supporting Instant Games?

    I totally agree to this, chooseAsync and working with contexts is pretty much was InstantGames are for. Currently I use it with a javascript call, but not working perfect, and will not work at all with C3 runtime. :(

    macube zjc121 How are your plugins progressing? or did you guys give up?

  • fredriksthlm No. I'm a littlebit busy, but i'm update the plugin soon. :)

  • Can anyone suggest here how they're approaching to implement the majority of the important features for FB instant games as C3 doesn't have many of them such as chooseAsync(), canSubscribeBotAsync( ),switchGameAsync( ),updateAsync( )

  • Can anyone suggest here how they're approaching to implement the majority of the important features for FB instant games as C3 doesn't have many of them such as chooseAsync(), canSubscribeBotAsync( ),switchGameAsync( ),updateAsync( )

    you just use the browser plugin, and call the functions via the javascript thing.

    (I have not used the subscribeBot so cannot comment on that, but the other three works fine).

    It is though not really good that almost everyone that uses IG plugin will also need to use javascript via browser plugin for many important functions since the IG plugin is too basic :(

  • > Can anyone suggest here how they're approaching to implement the majority of the important features for FB instant games as C3 doesn't have many of them such as chooseAsync(), canSubscribeBotAsync( ),switchGameAsync( ),updateAsync( )

    you just use the browser plugin, and call the functions via the javascript thing.

    (I have not used the subscribeBot so cannot comment on that, but the other three works fine).

    It is though not really good that almost everyone that uses IG plugin will also need to use javascript via browser plugin for many important functions since the IG plugin is too basic :(

    fredriksthlm Do you have a priority list of what you need from the instant-games sdk?

  • fredriksthlm Do you have a priority list of what you need from the instant-games sdk?

    Hi macube I know you are working on a plugin, I have been waiting for it ;)

    For me these functions is the ones I use with browser currently:

    1. updateAsync - works pretty well to do with javascript, but would be a lot easier with a plugin, to link image etc. (Should be implemented similar to shareAsync). I think this is quite easy to do.

    2. chooseAsync - this will be trickier for you, since this will require changing of the type and Id variables in the standard IG plugin, when success. See ashleys response above how to do it, otherwise it will not work with c3 runtime. Also this function needs proper callbacks, so this is the hardest function to fully implement in the plugin I believe.

    3. switchGameAsync - the most simple one.

    4. getSupportedAPIs - this will return the supported features for that particular session. really handy. and also this feature is part of IG Best practice.

    So this is my preffered new functions. I have not started to work with the bot-things.. basically cause I hate bots :D

    the "goal" is to not use the browser/javascript plugin at all.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)