Multiplayer Object Bug

0 favourites
  • 11 posts
From the Asset Store
Match same tiles with each other as fast as you can and earn more score during a limited time!
  • Problem Description

    I have a complex problem with multiplayer plugin.

    It's a 4 peer game. I hosted it on BitBalloon.

    It's a card game so in order for the cards to be placed 4 players need to be connected to the room.

    When I am opening the link 4 times to emulate the 4 players i have no problems.

    The problem comes when i ask my friend to do so. For some reason it does not work for him.

    Which I don't understand because it's quite the same link with the same code. And we have both CHROME.

    And yeah one more strange bug. When i try to pick the Multiplayer.HostAlias for the other players it adds a 2 to it. So if i chose Player1 as a nickname it puts Player12.

    It can be seen in the official multiplayer plugin with shooting.

    Attach a Capx

    I can't attach a capx until the game is released but i can attach this.

    And i join a simplified capx containing my connection logic

    Steps to Reproduce Bug

      Put a Nickname Put the same room number Do it 3 more times in defferent browser windows

    Observed Result


    Expected Result

    Should be this. ... 3proof.jpg

    Affected Browsers

      All of them. Chrome worked for 1 person. Safari does not support webrtc, and Mozilla has this 3*player 2 bug

    Operating System and Service Pack

    WIN 7

    Construct 2 Version ID


  • And yeah one more strange bug. When i try to pick the Multiplayer.HostAlias for the other players it adds a 2 to it. So if i chose Player1 as a nickname it puts Player12.

    This is a feature, if you have a same username login, the signal server will assign running number for you. If you intend to build a strict mode for username, I think you have to setup a database for that, unless we get an expression for [action: request peerlist in roomIndex] without having to join the room, then you can check whether certain username has been taken or not.

    Ashley, as of now, is it possible to request peerlist in a room without joining it yet? I had a few use in it as such a player can check which room/instance are their friends already in, and join their friends.

    The problem comes when i ask my friend to do so. For some reason it does not work for him.

    Which I don't understand because it's quite the same link with the same code. And we have both CHROME.

    What didn't work? Can you be specific?

  • The problem for other people is that when they are connecting as the first peer it's okay they are host. But when they open another version they stay blocked as a player 2 for any other connection in the same room.

    I had the chance to check this. A dude entered first so became a host. I entered and became a player 2, and the following attempts stayed as player 2.

    However I once tried to enter as host player 1. The dude entered as peer player 2, THEN I opened a second window and it showed i am player 3, and i did it one more time and i was player 4. So everything went well. This was strange.

    So i don't understand why with the same code and the same browser I can emulate 4 peers and my friend can't.

    By the way i joined the capx showing my connection logic.

  • Concerning the concatenation to the HOST Alias. It seemed to occur sometimes and and sometimes not.

    Is it possible that it happens when you are giving the same string to the room and the nickname.?

  • I'm confused what you think the issue is. Is the problem that your friend can't connect, or that it adds 2 to the end? It's by design that it will add a number at the end if the name is already taken, so that would not be a bug. If your friend can't connect, what evidence do you have that it's a Construct 2 bug and not your NAT/network setup blocking the connection?

  • Ashley

    Concerning the "+2" bug

    Aparrently C2 does not like when your hostAlias is composed of 1 letter only. He ads two when you put only 1 character. It does not do it when you put at least 2 character (just try nickname "a" for the host, and enter a second time as a peer)

    The problem is that my friend cannot play. And it's not just my friend. It was 3 different persons. I was thinking of an antivirus issue but i think it would have told that it blocks something. And i have one too so I don't know.

    And he can connect, it just does not work with peer assignement for him, which is strange.

    What people get is. Player 1=host and 3 times Player 2=peer when they open hosted file 4 times and joining the same room with different nicknames.

    What I'm kindly asking to do if people want to help me is.

    Firstly: use this link to enter in the same room as 4 different peers on your computer and tell me if each player has a different number (player 1, player 2, player 3, player 4)

    Secondly: do the same with a different person. So first try to connect as a host and tell the other person to connect 3 times in the same room. And ask him if he has a different player each time. Then invert the role, ask him to be host. If it works i'm pretty sure it's not a multiplayer plugin glitch.

    Thank you!

  • And I just asked another person to launch it 4 times. And she has 3*player 2. Instead of this.

    It would be cool If i find out why.

    I made a video of how i proceed and what you should have. Because there is no reason I have this and other people dont.

    EDIT: I asked 2 more people showing them the vid and giving the link.

    Same problem. Logic gets broken and they create only "Player 2" players.

    Ashley In your opinion what can do this? (and check on your side if it works for you aswell please)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I had a talk With a programmer at uni. We both tested the stuff.

    Safari: The stuff does not even launch

    Mozilla: The 3*player2 bug

    Chrome: worked for him. (strange stuff because the first dude i tested with had chrome and it didn't work)

    He said it was a browser bug. I thought webRTC was worked on mozilla.

    Another strange stuff is that with the 3*player2 bug the cards get shuffled and placed when peer number=4. So the peer counting works even if the function that shows which player you are does not work.

    Tho I don't see why this simple functions do not work.

    Function to show the message on the right depending on your player var number.

    Player number determination

  • Player number determination

    This can happen if you let peer to handle the logic. I think you missed the principle of "calculate only on host". Your method is calculated by peer which is not recommended, possible delay in connection between peers might cause your problem I think.

    Below is one way to "calculate using host", give it a try.


  • I can't reproduce the "+2" bug with the real-time game multiplayer template. I managed to become host with the name "y", which is a single character, proving that the multiplayer engine supports hosts with a single character name without adding "2". The most likely cause is the name was already taken, which is more likely with single character names since there are fewer options.

    If nobody can connect to you, it suggests your NAT is blocking inbound connections. This is not a Construct 2 bug. It's to do with the architecture of the internet. The first multiplayer tutorial covers this in part.

    Closing as I don't see any evidence of Construct 2 bugs here; most likely you are just confusing various issues of Internet architecture, server name assignment, and perhaps muddling your events with displaying player aliases. In order to investigate bugs we need clear unequivocal proof that the problem is in Construct 2 and not a mistake in your events.

  • All four players connected for me...

    can only add 3 images... but peer3 also connected. As well is single "G", "O", "O1" etc... different hosts... it all works.

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