[C3][Plugin] AirConsole

  • cjbruce

    Ok, added a "Is controller" property, a condition and an expression for it. Also fixed the max players property. Let me know if that's not what you wanted

    This is fantastic!

    Basically, I am looking to replace the AirConsoleController plugin created by X3M with something officially supported. Having the ability to create a controller in Construct is a game-changer, as it allows you to split gameplay over multiple screens. No more simple HTML elements -- now you can throw AI and pathfinding on the phone as well. Things are especially interesting now that iOS 11 supports webRTC, as latency should drop to <16 ms, allowing truly synchronized local multiplayer on all devices (not just Android).

    Unity webGL doesn't officially support mobile webGL, so as far as I am concerned, this is a big capability that Construct has that Unity does not. Combine that with the fact that Construct does HTML5 natively, and it is now a superior platform for AirConsole development.

    The only thing missing now is a good 3D plugin for Construct 3. Until that happens, I anticipate building the screen.html in Unity3D and the controller.html in Construct.

    I will try the new plugin as soon as I can.

  • So I should add the few controller reserved functions to the plugin as well I guess?

  • So I should add the few controller reserved functions to the plugin as well I guess?

    I would say that we don't need/want the ability to add html elements, but I would need to take a look at the rest of the controller API to see what else is missing. I can't remember what was there off the top of my head, as I haven't look at the API since last fall. Things like getNickname and getDeviceId would be good though.

  • > So I should add the few controller reserved functions to the plugin as well I guess?

    >

    I would say that we don't need/want the ability to add html elements, but I would need to take a look at the rest of the controller API to see what else is missing. I can't remember what was there off the top of my head, as I haven't look at the API since last fall. Things like getNickname and getDeviceId would be good though.

    Ahh. Back at the computer now. I'm having a look through the AirConsole API, and I see the following things that a controller might use. I tried to go through your code to determine what remains to be implemented, and I apologize if you included something already that is in this list:

    Members

    (static, constant) ORIENTATION_LANDSCAPE :string

    The landscape orientation.

    Type:

    string

    Source:

    airconsole-api/airconsole-1.7.0.js, line 78

    (static, constant) ORIENTATION_PORTRAIT :string

    The portrait orientation.

    Type:

    string

    Source:

    airconsole-api/airconsole-1.7.0.js, line 72

    (static, constant) SCREEN :number

    The device ID of the game screen.

    Type:

    number

    Source:

    airconsole-api/airconsole-1.7.0.js, line 66

    Methods:

    getDeviceId()

    editProfile()

    getCustomDeviceState(device_id)

    getPremium()

    getServerTime()

    isUserLoggedIn(device_id)

    onActivePlayersChange(player_number)

    onDeviceMotion(data) *** - This one wasn't in X3M's version, but is necessary for accelerometer controls

    onDeviceStateChange(device_id, user_data)

    onEmailAddress(email_address)

    onHighScores(high_scores)

    onPremium(device_id)

    requestEmailAddress()

    setCustomDeviceState(data)

    setOrientation(orientation)

    showAd()

    showDefaultUI(visible)

    storeHighScore(level_name, level_version, score, uid, data, score_string)

    vibrate(time)

  • Psychokiller1888 thank you for your continued support of the airconsole plugin

  • cjbruce

    These are all implemented, except for a very few, like

    getServerTime() (there was a reason I did not implement it, can't remember)

    editProfile() -> this one is controller exclusive

    onEmailAddress -> this one is controller exclusive

    requestEmailAddress -> this one is controller exclusive

    onDeviceMotion -> this one is controller exclusive

    vibrate -> useless, send a vibrate message and implement html vibrate on your controller. It is controller exclusive

    setOrientation -> this one is controller exclusive, used at instanciation

    showDefaultUI -> this one is controller exclusive

    Constants are not to be implemented in Construct

  • cjbruce

    These are all implemented, except for a very few, like

    getServerTime() (there was a reason I did not implement it, can't remember)

    editProfile() -> this one is controller exclusive

    onEmailAddress -> this one is controller exclusive

    requestEmailAddress -> this one is controller exclusive

    onDeviceMotion -> this one is controller exclusive

    vibrate -> useless, send a vibrate message and implement html vibrate on your controller. It is controller exclusive

    setOrientation -> this one is controller exclusive, used at instanciation

    showDefaultUI -> this one is controller exclusive

    Constants are not to be implemented in Construct

    Nice! Of the remaining ones, I think setOrientation() is the only one that is absolutely necessary to make a game. Without this, controllers are stuck in portrait mode, which is really awkward for many games.

    I'm not sure about editProfile(). I suppose it would be up to AirConsole if they want to require it.

    I'm also not sure about onDeviceMotion(). I got some weird results trying to do this in C2. It seemed like AirConsole was overriding the C2 behavior, and making accelerometer controls not work at all for iOS. I suppose it is best to not implement onDeviceMotion(), and try to get accelerometer controls working entirely with Construct.

  • Ok, I started to add missing features for the controller. I added 3 plugin properties: Orientation, Sync time and Device motion. Will finish that soon, as soon as I understand how to use a combo property in the c3 plugins...

    EDIT

    Ok, this does the trick

  • Ok, I have started and almost completed a controller maker for AC in C3

  • The plugin is now on the official AirConsole repo. Find it there and enjoy AirConsole on your C3 projects!

    https://github.com/AirConsole/airconsole-construct3

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just passing by to say that the plugin works like a charm. Thank you for your effort

  • Cool, great! Thanks for testing out!

  • This is great stuff, I have done a quick test and it is working good!

    I have not read the whole wiki yet but if I build a controller in C3, can we send messages from the Screen to the Controller? Are all the Messaging Conditions works for both?

    Thanks, once again great work, looking forward to experiment more on that!

  • Thanks!

    Well, you should be able to receive the messages on the controller, and it should work, as the messages come in from SCREEN. If you build a controller, you'd send message to deviceId 0 so the go to SCREEN. This is WIP and under design consideration, so I cannot yet guarantee everything works when it comes to build controllers

  • AirConsole for C3 1.7.0.3 is out:

    • Unbundled AirConsole API from the plugin as requested by AirConsole TOS, now using dynamic API load from external url
    • Previewing always falls to mock-up version
    • Mock-up outputs infos to console

    https://github.com/AirConsole/airconsol ... ag/1.7.0.3

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