[Plugin] Photon Cloud

  • I believe that the client should never execute this action, only the master / server can execute it but in my program the client also executes it at the beginning (when it connects) during some frames, then it does not execute it anymore.

    Why does this happen?

    There is always single client in a room which marked as master. This may be useful when you choose running game logic on 1 client only and update other clients with game state from this client. In this case master client acts as a "server" while being regular client. Note that when current master leaves, another client from currently joined assigned as a master.

    Please don't confuse master client with master server which is a part of Photon Cloud infrastructure.

  • >

    > I believe that the client should never execute this action, only the master / server can execute it but in my program the client also executes it at the beginning (when it connects) during some frames, then it does not execute it anymore.

    >

    > Why does this happen?

    >

    There is always single client in a room which marked as master. This may be useful when you choose running game logic on 1 client only and update other clients with game state from this client. In this case master client acts as a "server" while being regular client. Note that when current master leaves, another client from currently joined assigned as a master.

    Please don't confuse master client with master server which is a part of Photon Cloud infrastructure.

    Ok, this is solved, you just have to do it like this:

    I am not sure that the problem has been understood.

    I have two players in the room.

    Only one of them is photon.masterActorNr

    Only photon.masterActorNr will execute the actions of the condition "if (photon.MyActorNr == photon.MasterActorNr)".

    The problem is that the player who is not a teacher / server also performed those actions at the beginning, when he entered the room.

    The second player should never execute those actions because he is the client, this player is not the master. The master is already in the room when the second player entered, however, the second player executed the actions contained in the condition "if (photon.MyActorNr == photon.MasterActorNr)" during some frames

    Then I need to identify which player is the server in the room.

    This is achieved with the condition "if (photon.MyActorNr == photon.MasterActorNr)".

    So why did the non-master player also execute the actions in the condition?

    I need to run the logic of the game on the server only.

    -----------

    Could you try this example with 2 players?, It is the official example of fish.

    https://www.dropbox.com/s/udjs22p38ygo2 ... .capx?dl=0

    Only need the appID.

    I only added this in photon eventSheet:

    You can see that the text is also written to the second player (client).

    But the condition indicates that it should only be written to the master player.

  • Tyvm ThePhotons ! I totally missee this turbnbased stuff.

  • I have a question about the interest groups ThePhotons

    We have the Change groups action in the photon plugin to add and remove interest groups of the client.

    My question is, if I use the Change groups action to manage the client's interest groups,

    what do I enter in the InterestGroup field in the Raise event action ?

    Is it possible that the interestGroup field in the Raise event action overrides the Change groups action ?

  • OK, I made a simple test project now. interestGroupTest.capx

    Data I send shows up for the other client despite having set different interest groups via the Change groups action.

    It does however work If the interest group is directly set in the Raise event action (unless it is set to 0, then it will send data to every group again for some reason)

    Image from MMO Concept for terminology.

    If I'm not mistaken how I understand it right now, the only possible way to get interest groups working is by

    using (construct) events to loop through a list of ID's (regions) that are in the interest area of the player

    and use the Raise event action to send data for each ID (region) individually,

    this would render the Change groups action useless though.

  • Hi, what is the best way to make an event happen in both players at the same time?

    My game is 1 vs 1.

    Is the most precise way to send the event from the server simply ?.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The problem is that the player who is not a teacher / server also performed those actions at the beginning, when he entered the room.

    Neither photon.MyActorNr nor photon.MasterActorNr is defined while client is not joined to a room. So behavior of code using these variables is not defined also. Simply do not use them while not in a room (add Photon 'Is joined to a room' check to your condition)

  • Hi, what is the best way to make an event happen in both players at the same time?

    My game is 1 vs 1.

    Is the most precise way to send the event from the server simply ?.

    "Raise event" action has 'Receivers' parameter which set to 'Others' by default meaning that client sends event to all clients in a room except itself. To send event to itself also, change this parameter to 'All'.

  • If I'm not mistaken how I understand it right now, the only possible way to get interest groups working is by

    using (construct) events to loop through a list of ID's (regions) that are in the interest area of the player

    and use the Raise event action to send data for each ID (region) individually,

    this would render the Change groups action useless though.

    "Change groups" subscribes client to and unsubscribes from events sent to specified groups. Client can listen to multiple groups. But event can be sent to single group only. So technically, to send to multiple groups, you need to create new group containing clients from all groups you want to send to (subscribe all these client to this supergroup). I'm not sure that this is realistic solution, especially considering number of groups limited to 255.

    Note that mmo concept you mentioned is implemented with server support and does not rely on groups.

  • Oohhhh , well that actually makes a lot of sense.

    The players position is only ever inside one region so he only needs to send to this one region,

    but he needs to know about other players or items in all the regions he can see.

    I think i got it now Thank you ThePhotons

  • Hi, for 3/5 days it's been hard for me to connect to the main photon server.

    Are they doing maintenance or something like that ?.

    Previously I connected without problems, now I must refresh the page (reset preview in chrome) to try to connect.

    What I want to say is that there is some problem with the connection to the photon server.

  • Hi, for 3/5 days it's been hard for me to connect to the main photon server.

    Are they doing maintenance or something like that ?.

    Previously I connected without problems, now I must refresh the page (reset preview in chrome) to try to connect.

    What I want to say is that there is some problem with the connection to the photon server.

    We had an outage on Tuesday (EU) and a short one yesterday (also EU) but currently everything works fine.

    You can check current status and history at https://www.photonengine.com/status and status updates at https://twitter.com/exitgames

  • Hello guys, I have a problem... When I go to the photon website to download te Construct 2 Plugin, I can't find the download.

    There is only the Doc and the API doc section. ThePhotons Can you help me?

  • > Hi, for 3/5 days it's been hard for me to connect to the main photon server.

    > Are they doing maintenance or something like that ?.

    > Previously I connected without problems, now I must refresh the page (reset preview in chrome) to try to connect.

    >

    > What I want to say is that there is some problem with the connection to the photon server.

    >

    We had an outage on Tuesday (EU) and a short one yesterday (also EU) but currently everything works fine.

    You can check current status and history at https://www.photonengine.com/status and status updates at https://twitter.com/exitgames

    Thanks, I see what happened, now everything is normal.

  • Hello guys, I have a problem... When I go to the photon website to download te Construct 2 Plugin, I can't find the download.

    There is only the Doc and the API doc section. ThePhotons Can you help me?

    Hi,

    Download is fixed.

    Sorry for inconvenience.

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