Setting up peer controls for Multiplayer behavior

0 favourites
  • 10 posts
From the Asset Store
Creepy Sprite Font suitable font for your Dark/Horror/Halloween games.
  • 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:

    And I have mine set up to do this:

    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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

    sirvoid.vv.si/clientsidedmovement.capx

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

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

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

  • 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
  • Did you forget something here ?

  • Did you forget something here ?

    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.

  • Just to be sure the client value tag need to be xloc and yloc

  • 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)?

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

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