ThePhotons's Forum Posts

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

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

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

  • Try Construct 3

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

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

  • Can photon help me with a multiplayer game that's not real time?

    Hi,

    Take a look at Photon Turnbased solution https://doc.photonengine.com/en-us/real ... -turnbased

    It allows to save state between game sessions.

    For not Construct specific requests please contact support email developer(at)photonengine.com

    You may also find Photon forum useful http://forum.photonengine.com/

  • ThePhotons

    When I export to Android (via Construct 3) and have minify script set to ON - I get black screen when trying to run it on my Android device.

    I noticed earlier in this thread some users were experiencing this issue. Has this not been resolved?

    Do you have something useful in logs? I can try to export for Android maybe next week.

    EDIT:

    Minified export in C3 fixed. Please find updated SDK at Photon SDKs download page.

  • Plugin event data is always a string value. You can pass a number as well but it will be converted to a string.

    To preserve types and js objects structures, use json encoding and decoding for event data.

  • If I raise an event with the value 1 in integer.

    The received event will have the value 1 but this will be a literal value, not a integer, am I right? I will have to use int to get the integer value 1.

    In case you mean event code. There is a bug in Photon plugin. Photon.EventCode should return numeric type instead of string. To be fixed soon.

    Note that usually 'onEvent' condition used which accepts event number, so you do not need Photon.EventCode.

    Thank you for bug report.

  • Hi, ThePhotons

    Is there any "Rejoin" and "FindFriend" example in Photon's official showcase?

    https://www.photonengine.com/en-US/PUN/showcase

    i,

    You can find Rejoin button below Suspend in demo-test app.

    We do not have "find friends" demo. To implement it, you need:

    • call "Set user id" action with user name before join
    • call "Find friends" action with comma-separated list of friend names while connected to a lobby
    • handle "On FindFriends result" event
  • What happens when two players shoot the same event?

    Is the same event executed twice on the same tick? I think that is not possible and the data of a player will be lost.

    By default (Recievers=Others), 1st client receives 2nd client's event and vise versa. All other clients receive both events. With Receivers=All, both 1nd and 2nd receive both events. Events are differenciate by player number (Photon.ActorNr). That is why you do not need event codes per players.

  • Hello

    How to control the loss of packages ?.

    Hi,

    Websocket connection guaranties packets delivery. You can't loose any packet while connected.

    Add logging of sending and receiving of events and key presses. This should help to find the reason of the issue.

  • Hi.

    Please I do not understand well ... what is the difference between photon.ActorNr and photon.MyActorNr?

    Hi,

    Each player in a room uniquely identified by a number assigned during joining a room.

    photon.MyActorNr is the number assigned to the local player.

    photon.ActorNr is the number of the player last "per client" condition like "On actor join" or "On event" was triggered for.

  • Yes but sometimes it doesnt added when i killed another player..

    Synchronizing player properties over network does not happen immediately. Make sure that you update player property successively from the same client: property owner or master client. This prevents from concurrent writes when 2nd client increments the value not seeing that it's already incremented by 1st client.

    Trace your code with logs to see how kill count changes.

  • ThePhotons How can i make a kill counts after my bullet colliding an object without adding a kill count to another players? because i got stucked on this problem that the another players also get the kill counts

    How do you add kill count?

    Using player properties looks like the simplest option if you need to synchronize count across network.

  • Here is my summary before page 54.

    Great work.

    I've added the link to initial post.