Question about the client value tag.

0 favourites
  • 3 posts
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • Been going through all the multiplayer tutorials & documentation these days and everything's fine by now except the following. I cannot textually wrap my head around what is meant here and I would appreciate it if someone could explain to me what is meant by this:

    The client value tag is used if the instance variable also corresponds to a client input value. In other words if a peer's client input value is set from that instance variable, setting the corresponding tag here allows the multiplayer engine to know they are linked. The host can use this information to reduce the latency when relaying the inputs to other peers.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • My answer might be a little bit late but let me try to explain it to you.

    It's used to sync certain object variables, since you can't send them directly.

    So we use *Set client input state* event with a certain tag added to it to combine it with a variable sync.

    The Host will always recieve your Client Input.

    However in most cases, you want to Sync this recieved input information back to all the other Peers as well, so now you can use this tag, to sync an object variable according to the input recieved.

    Here's an example according to the Advanced Example from Construct 2/3.

    The Peer sends an INPUT STATE (which includes variable data)

    to the HOST

    So we send X and Y so the host knows our current position.

    At the top, we defined the input value tag lookx and looky (these are the ones we're sending to the host)

    And the 2 Sync variable events, is the information we're syncing back to all the other Peers.

    So we're directly syncing a specific Object variable to all other players!

    The tag is now used, to basically BIND the input value tag, and the Sync Variable event together.

    So the information recieved from the client input value is written into the variable sync, and sent back to all the players.

    Hope it helps

  • Been going through all the multiplayer tutorials & documentation these days and everything's fine by now except the following. I cannot textually wrap my head around what is meant here and I would appreciate it if someone could explain to me what is meant by this:

    > The client value tag is used if the instance variable also corresponds to a client input value. In other words if a peer's client input value is set from that instance variable, setting the corresponding tag here allows the multiplayer engine to know they are linked. The host can use this information to reduce the latency when relaying the inputs to other peers.

    Normally syncing is done One-Way

    Host ----> Peers

    The host controls the game, what's happening, where things are, etc, and tells all the Peers.

    When you add a client value tag you are allowing the syncing to be done two-way

    Peer ----> Host -----> Peers

    The peer sends inputs to the host, like "the A key is being pressed", then the host uses that information to control the game, and then it sends "the A key is being pressed" to EVERY peer

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