[C3][Plugin] AirConsole

For discussion and help with the Construct 3 Plugin SDK

Post » Fri Jul 28, 2017 3:44 pm

To tease or not to tease...

Image
B
34
S
12
G
3
Posts: 233
Reputation: 4,490

Post » Fri Jul 28, 2017 7:54 pm

Ok, first working state. This is still subject to changes, at least in the C3 plugin. The backward compatibility plugin is completly working and should not change in it's content. This is not an automatic portage and has been rewritten from scratch, which made me discover bugs in the C2 version (already updated in 1.7.0.9)

This is an early beta version of the plugin, take it at your own risks! I did create a pong exemple from scratch and it worked fine on AirConsole emulator. I did import the C2 pong exemple in C3 and tried it on the emulator and it worked fine too, so the risks are calculated.

https://github.com/Psychokiller1888/c3airconsole

Please report any problems you might discover directly on github: https://github.com/Psychokiller1888/c3airconsole/issues

This plugin is not yet officially supported by AirConsole but should be its property by mid august :)

Documentation will follow, once the plugin is stable and finished.

If you win the AirConsole 2017 dev contest using this plugin, please PM me for my Paypal details loool
B
34
S
12
G
3
Posts: 233
Reputation: 4,490

Post » Fri Jul 28, 2017 10:48 pm

You officially rock!

Is there any chance that you could add a "isController" property so that we could use it for controllers as well? Isn't the API pretty similar between the two?

I would be willing to contribute half of my Airconsole earnings (about $20) - the rest is reserved for @quaziGNRLnose. :)
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
50
S
15
G
25
Posts: 424
Reputation: 17,296

Post » Sat Jul 29, 2017 4:23 am

Sure I can! You want a plugin property to choose if it's a "screen" or a "controller"? Controllers and screens call the same api
B
34
S
12
G
3
Posts: 233
Reputation: 4,490

Post » Sat Jul 29, 2017 4:44 am

@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
B
34
S
12
G
3
Posts: 233
Reputation: 4,490

Post » Sat Jul 29, 2017 9:20 am

Psychokiller1888 wrote:@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.
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
50
S
15
G
25
Posts: 424
Reputation: 17,296

Post » Sat Jul 29, 2017 10:57 am

So I should add the few controller reserved functions to the plugin as well I guess?
B
34
S
12
G
3
Posts: 233
Reputation: 4,490

Post » Sat Jul 29, 2017 6:07 pm

Psychokiller1888 wrote: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.
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
50
S
15
G
25
Posts: 424
Reputation: 17,296

Post » Sat Jul 29, 2017 9:44 pm

cjbruce wrote:
Psychokiller1888 wrote: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)
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
50
S
15
G
25
Posts: 424
Reputation: 17,296

Post » Sun Jul 30, 2017 12:32 am

@Psychokiller1888 thank you for your continued support of the airconsole plugin :) it is most appreciated :D
Image
B
60
S
32
G
5
Posts: 118
Reputation: 8,325

PreviousNext

Return to Plugin SDK

Who is online

Users browsing this forum: Demiurge999 and 0 guests