Can anyone see what's going wrong with my multiplayer project?

0 favourites
  • 6 posts
From the Asset Store
The ultimate voice pack filled with 1,536 files of .......wav and mp3 of individual numbers, letters, and words (that go
  • I have two projects that need to communicate with one another. One is the designated Host, while the other is always the peer. I've managed to get all versions so far to play nice with one another, however, I decided to try my hand at real-time multiplayer.

    However, I'm getting something odd happening.

    These are screenshots of the code for each project. The online aspects, connecting to each other, is in a separate event sheet for both projects. This is just the real-time code.

    And here are the resulting debugs.

    Note that the 2 PeerIDs in the instance variables are different... yet the two objects are one and the same. When it's created on the Host, it is automatically created on the Peer. Also, when I change the position of the object on the Host, it automatically moves on the Peer side.

    So why is it that their PeerIDs are different? In fact, looking into it a bit closer, I can see that the ID on the Host side is showing the Peer's ID... which is correct. However, on the Peer's side, it's showing the Host's ID.

    How is it even grabbing that information?

    I have followed the real-time multiplayer example, and don't see what is causing this issue! The example states "When a Peer is created from 'Sync object', Multiplayer.PeerID has the ID of the peer that the object represents."

    Why isn't this the case for me?

  • Your peer version's event should be using Multiplayer.MyID

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • To test further, I set it up so it would display both the PeerID and the HostID.

    Both are displaying as the same thing...

  • Your peer version's event should be using Multiplayer.MyID

    Pretty sure that's not correct... as that would mean whenever someone connected it would create their object and set their variable to MyID... which would allow them to control everyone.

    This is a screen shot of the multiplayer example created by Scirra.

  • Oh I misunderstood. That is weird... will check it out in a bit.

    But also, syncing should be done on the host side only.

    Edit: Never mind... that might be wrong too. It's been a while since I meddled with multiplayer ><

  • Oh I misunderstood. That is weird... will check it out in a bit.

    But also, syncing should be done on the host side only.

    Edit: Never mind... that might be wrong too. It's been a while since I meddled with multiplayer ><

    I have tried that. If I disable the sync on the peer side, the object is not created.

    Also, in the Scirra example, it occurs for both Host and Peer.

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