Host can't see peers, but peers see host, how to fix?

Get help using Construct 2

Post » Sat Sep 24, 2016 5:45 am

Hello guys,

I am fighting a bit with the Multiplayer plugin following a tutorial that shows you how to make a multiplayer tank game. The person starts off with getting you to make a single player game and then the multiplayer version.

What I have so far is that the host connects, it detects it is a host and you can control it. Then the peer connects and detects it is a peer and you can control it while the host can't be moved. However, the problem is a peer can see the host but the host can't see the peer. I tried everything I can think of but it isn't working.

Any idea what might be the problem and how to get it fixed?

Side note: Since I am working on multiplayer and getting to learn its ins and outs, I'll probably have a few questions; should I stick to one thread (like this one?) or open new threads when the question arises -- I am afraid of being spammy.
B
19
S
7
Posts: 161
Reputation: 1,751

Post » Sun Sep 25, 2016 4:06 am

Bump, any ideas? I still can't solve the problem!

Thanks!
B
19
S
7
Posts: 161
Reputation: 1,751

Post » Sun Sep 25, 2016 5:33 am

There are so many things that can go wrong with a multiplayer game it will be impossible to give you advice without a capx. It would also help if you linked the tutorial you are referencing.

But first to confirm it's not a routing issue, are you testing locally with multiple browser windows or are you testing across a network?

Also have you done all the official multiplayer tutorials and understood them? You will find it painfully difficult to progress otherwise.
Mistakes were made.
B
54
S
28
G
115
Posts: 1,705
Reputation: 65,083

Post » Sun Sep 25, 2016 5:49 am

oosyrag wrote:There are so many things that can go wrong with a multiplayer game it will be impossible to give you advice without a capx. It would also help if you linked the tutorial you are referencing.

But first to confirm it's not a routing issue, are you testing locally with multiple browser windows or are you testing across a network?

Also have you done all the official multiplayer tutorials and understood them? You will find it painfully difficult to progress otherwise.


I am testing locally using Chrome on different tabs and incognito mode.

As for the tutorial I am following it isthis one. Here is the capx I have made.

I did follow most of the tutorials that are on the website and understood them. I didn't follow every tutorial, I just followed the first 2 (the general concepts one and the chat one). That said, like I said, I am only following what the guy does in the video, step by step. Perhaps changing a few minor things. The tutorial on the website while great to explain concepts, they aren't quite good in the "step by step" department. I learn best with a "Monkey see, monkey do" approach, then let me do my own thing afterwards.
B
19
S
7
Posts: 161
Reputation: 1,751

Post » Sun Sep 25, 2016 6:10 am

So the problem is in event 8 - your peer is creating an object. Multiplayer sync only works from the host's point of view. Whatever is being created on the peer side does not sync to the host.

The host should be responsible for creating the object when the peer joins. If synced, this will create the object on both the host and the peer. The peer then associates the object created as their own.

This is described in more detail in the following:
https://www.scirra.com/tutorials/915/mu ... ame/page-5
https://www.scirra.com/tutorials/915/mu ... ame/page-6

Sorry for being preachy, but I'm going to again highly recommend going through all the official multiplayer tutorials. The first one is full of concepts only yes, and it serves as a basis for understanding why the multiplayer plugin was set up the way it is. The following three are step by step tutorials that showcase and explain all the bare minimum building blocks of multiplayer games.
Mistakes were made.
B
54
S
28
G
115
Posts: 1,705
Reputation: 65,083

Post » Sun Sep 25, 2016 6:22 am

I see, thanks for pointing out the issue. I will try to follow the tutorials you mentioned closer, sorry for the idiocy.
B
19
S
7
Posts: 161
Reputation: 1,751


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests