[Plugin] AirConsole - local multiplayer for your game

Post your completed addons to share with the community

Post » Sat Feb 18, 2017 5:36 pm

@arod17pr glad @Psychokiller1888 was able to assist but as he suggested you need to learn some basic JS as it will help you greatly! you still have enough time. Goodluck!
Image
B
50
S
27
G
5
Posts: 105
Reputation: 7,628

Post » Sat Feb 18, 2017 7:28 pm

@ishmaelmoreno

That will be my goal. Thanks for the advice.

By the way, I just finished my controller. Thanks for the help.

:D
B
11
S
3
G
1
Posts: 45
Reputation: 1,388

Post » Mon Feb 20, 2017 7:58 am

AirConsole just merged my latest Pull request

Version 1.4.9.2
- New condition "IsPluginOffline"

This condition will check if you are running your Construct 2 project while being offline.

Please note that from now on, whenever you try to preview or run a Construct 2 game without any internet connection, your console will warn you that the plugin is offline and uses a mock up of AirConsole in order to avoid the fatal JS error "AirConsole is undefined"

This is especially needed for gmae where you implement other control setup and intend to run your game offline

Official git repo: https://github.com/AirConsole/airconsole-construct2
My git repo: https://github.com/Psychokiller1888/air ... construct2
B
29
S
11
G
3
Posts: 212
Reputation: 4,168

Post » Mon Feb 20, 2017 9:45 pm

@Psychokiller1888 thank you for the update :) @arod17pr no problem!
Image
B
50
S
27
G
5
Posts: 105
Reputation: 7,628

Post » Fri Feb 24, 2017 3:34 pm

Before I go further with debugging I thought it might be some known issue so I'll ask.

When I test my game with two controllers, the first one always connects properly as it receives the handshake trigger from the screen. Second controller however has like 50/50 chances to connect or not. It is connected to the airconsole (icon visible in top right corner) but "On device join" condition is not being triggered and so the controller is not connected to the game.

I've debugged the controller and it is sending the handshake to device 0. I use the standard part in my controler for that as below:
Code: Select all
var airConsole = new AirConsole({orientation: AirConsole.ORIENTATION_LANDSCAPE});
    // var rateLimiter = new RateLimiter(airConsole);

    var sendHandshake = function () {
        airConsole.message(AirConsole.SCREEN, {
            handshake: true
        });
    };

    airConsole.onReady = function () {
        sendHandshake();
    };

    /** -------- AIR CONSOLE MESSAGES --------- **/
    airConsole.onMessage = function (device_id, data)
    {
        if (data.handshake) {
            sendHandshake();
        }


I also put just few quick logs to the runtime.js of the plugin and "this.air_console.onMessage = function(device_id, data)" is not even triggered, therefore it can't process the handshake.

So simply saying, if the screen broadcasts "Game is ready" then controllers connect, but when the screen is already loaded and it's the controller who sends the handshake, then it's like 50/50 that the Plugin will catch it.

I'm using AirConsole plugin v1.4.8.1

Are you maybe familiar with this issue @Psychokiller1888?

Thanks

==EDIT==
Updated to newest plugin version. Still same problem. Screen just logs in console that "WebRTC active for device_id 2", but the plugin is not triggering anything.
ImageImage
B
27
S
16
G
68
Posts: 940
Reputation: 38,589

Post » Fri Feb 24, 2017 3:59 pm

@BackendFreak

Are you having these issues while using the simulator or in production?
B
29
S
11
G
3
Posts: 212
Reputation: 4,168

Post » Fri Feb 24, 2017 4:11 pm

Psychokiller1888 wrote:@BackendFreak

Are you having these issues while using the simulator or in production?


Using a link via their site: http://www.airconsole.com/?http=1#http://my.server.com/

EDIT: Just checked simulator and all works perfect there. That's interesting.
EDIT2: Ah no it's not... after more tests it start to have the same issue in simulator.
ImageImage
B
27
S
16
G
68
Posts: 940
Reputation: 38,589

Post » Fri Feb 24, 2017 4:36 pm

Well, I cannot say much because I also do have these issues sometimes. What I can say for sure is that I never had them using an android device, but one of my team mate has an older iphone and an ipad that does that like.... all the time.... I don't know how you handle the JS on your controller, but seeing the identation it looks like that part of the code you shared is under something, I think you instanciate AirConsole under $(document).ready() ? I increased the perfs a lot doing it that way. Something you should try, to see if any difference is actually upload your game without putting it in review, so you can preview it. Usually a lot of things gets fixed doing so
B
29
S
11
G
3
Posts: 212
Reputation: 4,168

Post » Fri Feb 24, 2017 4:42 pm

Psychokiller1888 wrote:Well, I cannot say much because I also do have these issues sometimes. What I can say for sure is that I never had them using an android device, but one of my team mate has an older iphone and an ipad that does that like.... all the time.... I don't know how you handle the JS on your controller, but seeing the identation it looks like that part of the code you shared is under something, I think you instanciate AirConsole under $(document).ready() ? I increased the perfs a lot doing it that way. Something you should try, to see if any difference is actually upload your game without putting it in review, so you can preview it. Usually a lot of things gets fixed doing so


Ah, then it might be something in the AC API actually. I was suspecting that as well. My controller is quite big so I spread the code across several classes that's why the indentation.

Alright. Thanks for getting back!
ImageImage
B
27
S
16
G
68
Posts: 940
Reputation: 38,589

Post » Fri Feb 24, 2017 4:46 pm

Thing is also, Unity devs report like.... No real problems, based on my meeting with Alice in Zurich, and I reported quite many....... Some problemsare also coming from C2 in my opinion. In an attempt to make things easier, I have starteed rebuilding the plugin into a new version, that gets rid of the handshake thingy. It's far from finish, it's only a draft and I didn't have the time lately to make it any further, but keep my repo somewhere in your favs and feel free to ask for specific features to make the plugin version 2 even better!

https://github.com/Psychokiller1888/c2airconsole
B
29
S
11
G
3
Posts: 212
Reputation: 4,168

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests