Setting up peer controls for Multiplayer behavior

Just started using Construct 2? Post your questions here

Post » Fri Mar 25, 2016 9:05 pm

Hi, I've read through all the tutorials on the Multiplayer behavior but I'm still not understanding how it controls peer behaviors.

I see the example capx uses something along the lines of this:
Image
Image

And I have mine set up to do this:
Image
Image

This shows me having a 0/1 variable for if the player is sending they want to "bounce" (how the players move). When the client updates, if the player bounce variable is 1 then it sets the bit value to to 1 then resets the bounce to 0. As far as I understand this should be received by the host, which applies the bounce force to them. "FlirtMultiplier" in the case here is currently 1 and so does not modify the number at all.
B
3
S
1
Posts: 7
Reputation: 336

Post » Sat Mar 26, 2016 12:08 am

Message: Sirvoid can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
I know this is maybe not your problem but i suggest you to use a client sided movement to be able to do your bounce thing etc more easily.

http://sirvoid.vv.si/clientsidedmovement.capx
My Twitter:

@Sirvoidd

My Tutorial:

Multiplayer with Photon
B
32
S
12
G
9
Posts: 73
Reputation: 7,089

Post » Sat Mar 26, 2016 9:49 am

Message: Flytnn can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Sirvoid wrote:I know this is maybe not your problem but i suggest you to use a client sided movement to be able to do your bounce thing etc more easily.

http://sirvoid.vv.si/clientsidedmovement.capx


Thanks! I was initially actually thinking of doing something very similar to this, but hadn't really got an idea how to do that. After slipping in what you've suggested however, I've now got the opposite issue that only peers can move while the host (on the peer views) will appear at the origin point 0,0 (though the peers can move fine and are synced to the host properly).

Image

Though the client variables for the X and Y location update and the player is set to where these are, is there anything special you have to do for the host (does On Client Update work differently for them or anything like that)?

Image

Image

Image

Image
B
3
S
1
Posts: 7
Reputation: 336

Post » Sat Mar 26, 2016 3:25 pm

This is pretty strange I don't find any problem in what you did ..
My Twitter:

@Sirvoidd

My Tutorial:

Multiplayer with Photon
B
32
S
12
G
9
Posts: 73
Reputation: 7,089

Post » Sat Mar 26, 2016 3:32 pm

Sirvoid wrote:This is pretty strange I don't find any problem in what you did ..


I've tried it with 3 players connected and the issue seems to be that peers aren't receiving data for where the other players (inc. the host) are;
  • Player 1 (Host) can see Players 2 & 3 fully updated
  • Player 2 only sees themselves updated; Player 1 (Host) and Player 3 are stuck at origin point
  • Player 3 only sees themselves updated; Player 1 (Host) and Player 2 are stuck at origin point
B
3
S
1
Posts: 7
Reputation: 336

Post » Sat Mar 26, 2016 3:44 pm

Did you forget something here ?
Image
My Twitter:

@Sirvoidd

My Tutorial:

Multiplayer with Photon
B
32
S
12
G
9
Posts: 73
Reputation: 7,089

Post » Sat Mar 26, 2016 4:03 pm

Sirvoid wrote:Did you forget something here ?
Image


I had a look and it turns out I hadn't set Linear or Client tags for X/Y, however neither of those fixed the issue. Though as I managed to miss something small it's likely there's other small things I've missed so I'll keep scouring your code; I must be missing something if yours works and mine does not.
B
3
S
1
Posts: 7
Reputation: 336

Post » Sat Mar 26, 2016 4:06 pm

Just to be sure the client value tag need to be xloc and yloc
My Twitter:

@Sirvoidd

My Tutorial:

Multiplayer with Photon
B
32
S
12
G
9
Posts: 73
Reputation: 7,089

Post » Sat Mar 26, 2016 4:16 pm

Sirvoid wrote:Just to be sure the client value tag need to be xloc and yloc


Oh yeah that's what I've got in there (not "x" and "y"). Does the order of anything like these matter (besides syncing variables after the player)?
B
3
S
1
Posts: 7
Reputation: 336

Post » Sat Mar 26, 2016 4:28 pm

sorry but I'm not sure to understand what are you talking about.
and I saw than I have a lot of useless thing in my capx cause this is a old prototype like the client value tag in the Sync variable action.
My Twitter:

@Sirvoidd

My Tutorial:

Multiplayer with Photon
B
32
S
12
G
9
Posts: 73
Reputation: 7,089


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 3 guests