About Veriables in Multiplayer

  • Hello guys, I hope evreything is fine in your life. I need to help about veriables in Multiplayer game. I hope somebody can help me.

    MY QUESTION:

    I'm developing a game and listing all of my online peers in a list object. There are two variables in the game.

    Veriable 1: mypowerscore (This variable stores our total power in the game.)

    Veriable 2: peerpowerscore (This veriable will store our enemy's power in the game.)

    The problem begins here. The second variable is initially equal to zero. Now imagine a page, you have the names of other peers in front of you. Here we choose a peer. I have to equal the first variable of our chosen peer to the second variable in our game.

    A visual to better convey what I'm asking you:

  • There are a lot of different possibilities depending on how your game works and what you've built so far.

    Please offer an example of your code so we know what's going on. Otherwise it won't be easy to help at all.

    First and foremost you have to make sure that the required data is being synced, unless you calculate the data localy on every single machine. (depends on how your handle things)

    A good way would be that the Host is aware about all the data in the first place.

    So either sync the required data to the Host, or calculate the individual powerscore on the host itself.

    Assign it to each peer and sync the data back to all peers.

    Directly syncing data from Peer to Peer isn't possible in Construct which is a limitation by the multiplayer behavior design. You will have to relay it through the host eventually.

  • There are a lot of different possibilities depending on how your game works and what you've built so far.

    Please offer an example of your code so we know what's going on. Otherwise it won't be easy to help at all.

    First and foremost you have to make sure that the required data is being synced, unless you calculate the data localy on every single machine. (depends on how your handle things)

    A good way would be that the Host is aware about all the data in the first place.

    So either sync the required data to the Host, or calculate the individual powerscore on the host itself.

    Assign it to each peer and sync the data back to all peers.

    Directly syncing data from Peer to Peer isn't possible in Construct which is a limitation by the multiplayer behavior design. You will have to relay it through the host eventually.

    First of all, thank you for trying to help me with this. The situation is simple. As I said, I want to get value from peer's veriable when I selected peer's alias from list object. How do I do this through the host? Can you tell me? A video or at least a visual or capx file? I know how to register a peer alias to the list, but I selected it in the list, I don't know how to see a variable value of the peer on my own computer. First, I must store the relevant variable value in an empty variable, so that I can use it later. Thank you for your interest and I apologize for my bad English.

  • There are a lot of different possibilities depending on how your game works and what you've built so far.

    Please offer an example of your code so we know what's going on. Otherwise it won't be easy to help at all.

    First and foremost you have to make sure that the required data is being synced, unless you calculate the data localy on every single machine. (depends on how your handle things)

    A good way would be that the Host is aware about all the data in the first place.

    So either sync the required data to the Host, or calculate the individual powerscore on the host itself.

    Assign it to each peer and sync the data back to all peers.

    Directly syncing data from Peer to Peer isn't possible in Construct which is a limitation by the multiplayer behavior design. You will have to relay it through the host eventually.

    First of all, thank you for trying to help me with this. The situation is simple. As I said, I want to get value from peer's veriable when I selected peer's alias from list object. How do I do this through the host? Can you tell me? A video or at least a visual or capx file? I know how to register a peer alias to the list, but I selected it in the list, I don't know how to see a variable value of the peer on my own computer. First, I must store the relevant variable value in an empty variable, so that I can use it later. Thank you for your interest and I apologize for my bad English.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There's an example in Construct 3 already, which covers all the basics.

    Start Page -> Advanced Examples -> Multiplayer: real-time game

    As i've said before.

    Please show us an example c3p file.

    I understand what you're trying to do.

    But i don't understand what your current code base is and what's missing.

    End-Goal should be:

    - Host must have all the individual PowerScore variables

    - Host then syncs this data to all the connected peers

    - You then differentiate each individual variable with the sync function.

    There's actualy no need for a second variable.

    But if you're keen for it then that's the smallest problem you have.

    Here's all the information you need:

    construct.net/en/make-games/manuals/construct-3/plugin-reference/multiplayer

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