Multiplayer Sync strange problem

Discussion and feedback on Construct 2

Post » Tue Dec 02, 2014 4:10 pm

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).

Image

https://dl.dropboxusercontent.com/u/628 ... 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!
B
21
S
5
G
3
Posts: 67
Reputation: 2,850

Post » Tue Feb 17, 2015 2:58 am

brushfe wrote:"Don't know which object aligns with NID 1"
I'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.
Screenshot 2015-02-16 20.47.46.png

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.
Screenshot 2015-02-16 21.13.09.png
You do not have the required permissions to view the files attached to this post.
ImageImageImageImage
B
62
S
19
G
51
Posts: 633
Reputation: 30,836

Post » Tue Feb 17, 2015 12:26 pm

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.

@DatapawWolf
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 ?
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Tue Feb 17, 2015 1:52 pm

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.
Scirra Founder
B
400
S
237
G
89
Posts: 24,550
Reputation: 195,537

Post » Tue Feb 17, 2015 2:43 pm

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.
ImageImageImageImage
B
62
S
19
G
51
Posts: 633
Reputation: 30,836

Post » Tue Feb 17, 2015 10:29 pm

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. :D
ImageImageImageImage
B
62
S
19
G
51
Posts: 633
Reputation: 30,836


Return to Construct 2 General

Who is online

Users browsing this forum: DavidCerdeira, R0J0hound and 10 guests