multiplayer pinning issues with peer

0 favourites
  • 13 posts
From the Asset Store
Pin UI
$2.49 USD
Create a perfectly Pinned Interface for Any Device
  • I'm making a simple game to get the hang of p2p multiplayer. I have a player and a vision cone for the player that determines what the player can see, the vision cone should only be visible to the player it is assigned to. To do this, I made it so that if you are a peer, you delete the existing cone for the host and create a non-synced vision cone on only the peer's screen. This way the host does not see the peer's vision cone and vise versa. The problem I am having is when I pin the cone to the player on the peer's end, when I run it, the cone does not follow the player.

    Can the pinned object not be moved because it only exists on the peer's side and the host has to move it?

    Or is this a problem with the multiplayer plugin or the pin behavior?

    Is having clientside objects that only exist for the peer even possible?

    Any insight would be much appreciated.

  • I haven't tried it, but it may have to do with how the multiplayer object updates the position of synced objects. Have you tried just setting the cone's position to player.x/y every tick instead of using the pin behavior?

    Is having clientside objects that only exist for the peer even possible?

    Yes

  • Yes, I have. For whatever reason, other objects will pin the player but not the cone.

  • Things to check include making sure the cone object isn't synced and that you're picking conditions for the cone are working as intended.

  • so I got the cone to pin to the player but I have no idea why it decided to work now and not before. the problem now has become that the player on the peer's end does not rotate towards the mouse position, but does for on the host's end. I have the player synced with position only, and the angle is determined by input tags that the host receives and updates the player's instance variables to, then both the host and peer rotate the player toward the position specified by the instance variable. I have the Instance variables synced also. From my limited understanding of how the multiplayer plugin works, everything should work.

  • This will be hard to diagnose without seeing your event sheet... Is your event to set the player to rotate towards the specified position in a common group of events for both peer and host? Can you confirm if the specified position instance variables are synced/set properly on the peer side?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In the multiplayer tutorial on the last page it looks peers also manually set their associated player object's lookat instance variables locally based on mouse position.

    Why syncing the instance variable does not update them I do not know why. Maybe something to do with local input prediction activated on the associated player object?

    Try testing with 2 peers and a host, and see if the the other peer's instance variables get synced properly? (As seen by the first peer)

  • So I spent some hours brainstorming the problem and took a guess that maybe when syncing the variables the client input tag on the sync variable event should be empty. And BAM! it worked, simple as that. For whatever reason, the tag was preventing the player variables from syncing from host to peer.

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