Multiplayer Issues, what do I not understand?

From the Asset Store
The official Scirra Multiplayer Signalling Server for helping peers find and connect to each other
  • I'm running into an issue with all Mutliplayer apps I have been recently and I'm not sure what the issue is. I tested these apps with a several people over the last week with different results. Before I show the basic code, I want to quickly explain issues we had.

    I was always the host so would launch the app first. The Game Name stayed the same on every session, but was different for each app. The Room Name was always MainRoom in each app.

    I have a TextBox with that updates the peer count when a peer connects (this is important).

    On to the issue. Peers would connect (as host I would see the peer count up) but none of the On Peer Connected code would trigger.

    They would refresh, and it seems trying a different name or combination and it would usually work after some time, but not always. It was so random. Everyone was using Chrome, I made sure of it. Whether it be ipads, iphones, desktops, etc.

    I'm thinking I am not understanding something with how the Multiplayer plugin works.

    My Code: This part always completes going to layout 1.

    Layout 1

    With certain users, this was never a problem. With others, it was so hit or miss it became extremely frustrating. Is it a matter of moving off the scirra signaling server and moving to a different signaling server? Implementing an ICE server? Are there good options for ones out there on a monthly basis?

    I should also note, I know the Host Group is activating because everything else in the group works fine.

    Thanks everyone.

  • I did some messing with this tonight and it's something to do with mobile chrome maybe?

    Example:

    Log in host on my tablet: Check.

    Log in as Ed on my Desktop: Check

    Log in as Ed on my Firefox Desktop: Check, but severs names me Ed2 by default.

    Log in as Ed on my Phone: Problem happens, shows peer connected but On Peer Connected does not trigger.

    Log in Ed1234 on my phone: Check works fine.

    So it seems to be an issue if the name is already taken on mobile. But it's not just the name in my game in my room because all of my users over the weekend had different names, used different aliases. For the amount of times I saw the issue, it's not based on my game or room. Is it the signaling server?

    Ashley, it would amazing to get any help on this. I'm pulling my hair out.

  • After more testing, it seems to be an issue when my Tablet is the host. I tried with my computer as the host and everything seemed to work correctly. I'm not sure why that would be, but I'm going to do more testing and make sure that is really the case.

  • I used to make tons of MP systems in C2 years ago, and after reading your post decided to give it a go in C3 and see if I can help. But everything works perfectly for me on PC, laptop and phone with hosting on different devices.

    Perhaps for you the issue is ports?

  • This may or may not be relevant in your case but as far as I understand the Multiplayer plugin doesn't actually work with a lot of mobile carries because their NATs are preventing packets from being transmitted. Apparently setting up a TURN server is required for getting around this, but that's not a service that Construct offers.

    I've raised this as an issue before since I think it renders the Multiplayer plugin moot if it doesn't come with the necessary solutions to make it work on all platforms. For now we'll just have to accept that we can't assume that the Multiplayer plugin will work for mobile- and tablet users (unless they're connected to a wifi).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In my case, all of the users and my tablet were using WiFi and not mobile network. However, I still think implementing a Turn server might help. I'm going to give it a try anyway.

    You actually can add a Turn server.

    Add ICE server

    Add a custom Interactive Connectivity Establishment (ICE) server used by WebRTC to establish connections between peers. There are a couple of built-in public STUN servers used, but you can also provide your own TURN servers to enable connectivity through certain kinds of NAT. A username and credential can also be optionally provided if the server requires them.

    So I'll give that a shot.

  • OK, so I was able to sign up for a TURN server to test this out. It solved my issue, sort of....

    Setting up the same scenario:

    Tablet Host: Chrome

    PC Peer : Firefox

    Phone Peer: Chrome

    Without Turn Server:

    Connect with tablet as host. Connect with PC as peer named Ed: Connect with Phone as Ed. Peer Count goes up, On Peer Connection does not trigger on host. After about 20-30 seconds, phone disconnects.

    With Turn Server:

    Connect with tablet as host. Connect with PC as peer named Ed: Connect with Phone as Ed. Peer Count goes up, On Peer Connection does trigger changing the Alias to Ed2. After about 20-30 seconds, phone disconnects.

    So it almost works, but it's still disconnecting after 20-30 seconds. If I connect with another name, it stays connected just fine.

    Ashley is there a way to check if a name already exists when connecting?

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