Multiplayer Sync strange problem

  • Hey, hoping anyone here might shed some light on a (probably very simple) problem I've got.

    I'm building a multiplayer game. Hosts start a lobby where they wait for other players, which loads character select, stage select and then the game itself.

    The foundation is code right from the multiplayer example, but with one change: When players join the lobby, that's where the 'Signalling' happens. This is where I've synced the player object "Ego". But there is no Ego on screen — it's only when players join the game layout that the Ego actually exists.

    Just like in the multiplayer tutorial, there is one Ego in the game layout, which the host keeps and the peers destroy. But because the Ego isn't created when the peer connects, I have it being created when they arrive in the game layout (by sending a message to the host).

    The strange problem: Peers are creating duplicates of the Egos. Sometime triplicates, meaning the host will have an Ego.Count of 2 and the peers will have 4 or 6. And in the browser console, this error appears (paraphrased): "Don't know which object aligns with NID 1"

    Here is a screenshot of the code. Nothing else is included or runs in the game layout (apart from the Multiplayer > Sync Object > Ego done in the Lobby layout). ... apture.JPG

    I'm sure I'm making a very obvious mistake, and am too close to it to see my error. Any perspective would be great!

  • "Don't know which object aligns with NID 1"

    'm suddenly getting a similar error. Only, in my case, none of the objects I'm trying to get created are created on the peer/client side. I simply get this error in the console.[attachment=1:2j9s3t9e][/attachment:2j9s3t9e]

    Any tips? Ashley?

    Sorry to call you but I'm so stumped. All I am doing is:

    Sync peers (this works fine, all peers are created and input is sync'd)

    Sync Tilemaps family (I tried removing everything from the family and sync'd everything individually, no luck, so it's no the family that's the issue)

    Watch as all objects area created

    Unfortunately, there is one object not created. I have two different tilemap objects. One is created successfully (two of them as I have on the server/host peer) and all variables for that object correctly sync'd across all clients. The other is not created, neither of the two on the server side, and I when I went to the log I discovered the above error.

    lennaert, you also have some experience with this, any tips?

    Edit: here is another screenshot of what I have on the start of the layout. That particular family of objects, my Tilemaps, are basically just a static bunch of tilemap objects.[attachment=0:2j9s3t9e][/attachment:2j9s3t9e]

  • I can not see your screen shot ... brushfe

    But here are some tips:

    Objects associated with IDs ?

    Synced objects selected before connecting to signalling server ?

    You would not need to send a message to the host for an action, when a peer connects, have the host do a "on peer connected" and have a create action happen there, which should automatically sync it with the connected peers.


    I have not yet tried multiplayer with the tilemaps, but have you tried synching the indivudal tilemaps, as opposed to them being in a family ?

  • Are all players using the same version of the same project and connecting to their own room with no other players in it?

    The main reason I can think those errors would happen is if you are trying to mix unrelated/altered projects connecting to each other. The multiplayer object only knows about objects in its own project, so if it starts receiving data about objects not in its own project that it doesn't know about, it'll show those kinds of warnings.

  • I should probably clear things up then: I am using two separate projects, one for the client and one for the server. It allows me to more easily manage the server and client functions, such as telling the client they can't connect yet if they somehow wind up connecting to an instance before the server.

    Ashley, the object in question is identical in both projects, as with the other objects being fully created. However, the starting UID is the only difference I can think of. Or at least is the only difference of note between projects.

    Edit: what throws me off is that this is working fine for another object with all the same disrepencies between the projects. Also all objects besides the issue one are able to be created from a different object layout on the client. The server has all objects in its layout already, sorta like a map.

    lennaert, I did try completely tossing the family objects: same error(s).

    I could post the project if needed: each project has under 50 events, less than what the real time example project has.

    Update: setting the UIDs to be the same in both projects did nothing to help. Still will not load the object. Gonna try to completely remake the object on the client side, and see if that does anything.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Another update:

    I just realized that the SIDs referred to in the error I've been getting are the same as those stored inside of the *.caproj file. I will try matching the SIDs in both projects and report back. I am 100% sure that this is the issue. In which case, a simple solution that still allows me to keep two separate projects.

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