Multiplayer - Spawn object issue after moving to new layout

0 favourites
  • 8 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • Hi!

    I'm trying to setup a 3 layout multiplayer design where it goes from a LOGIN -> LOBBY -> GAME.

    All the multiplayer samples just show a 2 layout design going from LOGIN -> GAME. The problem I'm running into is that as soon as I go from LOBBY to the GAME, a lot of things start to go wacky:

    • I can no longer create objects on host and have them sync to clients
    • the On Created on the client doesn't seem to be work like the samples any more

    1- Does anyone know what the correct practice is for setting up SYNC objects when going across a few layouts?

    2- Should we be able to add new SYNC objects after the first "Connect to signalling server" call?

    Anyone else have an issue with moving to new layouts?

    Please let me know if there is any more information I can provide.

  • Furthermore, I have now just changed my GAME (3rd layout) to have nothing but some CREATE OBJECT calls and that is not working at all. These objects are new objects and are not sync'ed with the multiplayer.

    Looks to me that moving to a new layout is causing an issue with the multiplayer state. This affects the host's ability to create objects (synced or NOT synced)

  • Changing layout will cause your object to be destroyed on layout change. You need the objects to be global to ensure it works properly. https://www.scirra.com/forum/viewtopic.php?f=147&t=118237

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for the Reply DickFace although I had no luck with the Global setting. Setting it to Yes is definitely working for my "Peer" object that is holding some properties of each player, but what's weird is that as soon as I go to the 3rd layout, the HOST can no longer create anything (even non synced local objects). It's almost like the System -> Create Object has been hijacked and is now broken.

    With Global set to true, objects that were spawned definitely carry over to the new layout. I'll post a CAPX of what I have right now to see if anyone can show me the errors of my ways

  • The attached CAPX has 3 layouts: Login, Lobby, Game.

    The Login -> Lobby works as expected. Once all players are ready and the host clicks start game, that's where it goes weird. The "Game" layout has some random tests in it that can be disabled if needed. Things like just trying to "Create Object" to see if something would be created.

    Also, the "Signalling" group in both the Lobby and Game event sheet are very similar. I'm not sure where it's valid to use the Multiplayer -> Sync Object action if you are moving across Layouts.

    The "Peer" object is the main object from the lobby that is associated with each client and follows the real time multiplayer sample's pattern

  • Hey

    1. In game events - event # 10, there is a oversight - You are trying to create objects in layer "Main"? It should be layer 1...The rocks got created

    2. I lobby events, I noticed a redundant event - In Lobby common group event #66 you have Go to layout Game and then again in Lobby Host - Event #42 you have Got to layout Game...Instead have the event in peer group and host group...remove the common event.

    Hope this helps

  • kmsravindra you rock!

    Definitely a case where I was staring at this problem for too long and missed that the Layers were out of sync. Thank you so much.

    Also thanks for the tip on Go to Layout! Will update that.

    Thanks again!

  • Sure. You are welcome...

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