How do I carry over multiplayer group between layouts?

  • So I'm trying to develop a multiplayer game, and before actual gameplay is a lobby where up to 4 players can join simultaneously before proceeding onto the action. How do I get it so that all connected players move on to the same layout after this lobby layout?

  • Have the host send a message to trigger changing layout on all the peers.

    Then in the new layout, set it up as the tutorial describes where objects are created and assigned to peers.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Have the host send a message to trigger changing layout on all the peers.

    Then in the new layout, set it up as the tutorial describes where objects are created and assigned to peers.

    How do I go about the first part?

  • OK so I may be wrong but, following the multiplayer tutorial it shouldn't be too hard I am working on the same thing its not going to be layout to layout in essence. It will basically have to be from one game to another, ( this is if you are wanting them to be connected to both the "main lobby" and the game or lobby at the same time. Basically you would name your lobby connecting to the server as one name then name your game table another name thus they would not disconnect from both or either or until disconnected from that instance.

  • Here is an example.

    You will use the action Multiplayer: Broadcast Message for the host, and the condition Multiplayer: On Peer Message or On Any Peer Message for the peers.

    Edit: I'm actually not sure myself how changing layouts interact with object syncing, maybe someone else who has experience regarding this can chime in.

    Changing rooms is also an interesting idea, but I think re-associating peerIDs to the correct people could possibly cause a lot of headaches and problems. I assume the peerIDs will change upon entering a new room.

  • Here is an example.

    You will use the action Multiplayer: Broadcast Message for the host, and the condition Multiplayer: On Peer Message or On Any Peer Message for the peers.

    Edit: I'm actually not sure myself how changing layouts interact with object syncing, maybe someone else who has experience regarding this can chime in.

    Changing rooms is also an interesting idea, but I think re-associating peerIDs to the correct people could possibly cause a lot of headaches and problems. I assume the peerIDs will change upon entering a new room.

    What is the condition I place to get the Multiplayer.Message = "start"? Trying to look through the system conditions but not sure which.

    Thank you for your help, also.

  • System compare two values. You might not even need that, if you use a message tag that is unique.

  • System compare two values. You might not even need that, if you use a message tag that is unique.

    Tried assigning it as a button the host must click, doesn't seem to do anything.

  • In your screencap it looks like they are both subevents for something else, did you split the host and peer groups? The message received event needs to be in a peer group,and the host will also need its own action to go to the new layout.

    Here is an example. Tested by previewing and duplicating a couple tabs/windows.

    https://www.dropbox.com/s/sjtjilffjvtdu ... .capx?dl=0

  • In your screencap it looks like they are both subevents for something else, did you split the host and peer groups? The message received event needs to be in a peer group,and the host will also need its own action to go to the new layout.

    Here is an example. Tested by previewing and duplicating a couple tabs/windows.

    https://www.dropbox.com/s/sjtjilffjvtdu ... .capx?dl=0

    Nah, they were just under a group. Your example is really helping, I'll let you know if I run into any other problems!

  • > In your screencap it looks like they are both subevents for something else, did you split the host and peer groups? The message received event needs to be in a peer group,and the host will also need its own action to go to the new layout.

    >

    > Here is an example. Tested by previewing and duplicating a couple tabs/windows.

    >

    > dropbox.com/s/sjtjilffjvtdu ... .capx?dl=0

    >

    Nah, they were just under a group. Your example is really helping, I'll let you know if I run into any other problems!

    Seems to work as intended, just looks like actually carrying over the connection between the layouts is a whole, bigger can of worms.

  • I didn't check if the connection was maintained or if everyone has to reconnect via signaling. If they do stay connected, they will probably retain the same peerids from the original layout. The host can probably keep track of all the peers/peerids in an array and sync/create/assign the objects on the new layout accordingly.

  • I didn't check if the connection was maintained or if everyone has to reconnect via signaling. If they do stay connected, they will probably retain the same peerids from the original layout. The host can probably keep track of all the peers/peerids in an array and sync/create/assign the objects on the new layout accordingly.

    I just haven't put the multiplayer objects and such in the gameplay layout yet. Might that be what clinches it?

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