ThePhotons's Forum Posts

  • justifun

    Where are you storing your player list? In a room property?

    It's stated clear in my post above that rooms properties should be used. Is anything unclear in that post or it's just not relevant to your case?

  • fredriksthlm

    1. If you view the AD for a very long time, you will be suspended from the game in background (I guess it will timeout somehow).(I know I can increase the supsended time.)

    What is the best practice here?

    2. When you get back to the game (from the Ad), you will have a LOT of queued raised events waiting for you

    Maybe app still runs but very slow in backround and getting messages but can't handle them.

    If you really suspend the game with "Suspend room" action, client disconnects and does not receive any messages. The point of suspending is later rejoin with the same actor id as was assigned at previous join which may be more appropriate than joining with new actor id.

  • Hi fredriksthlm,

    The task is easy if players never leave the room or always rejoin with old player id. In this case it's enough to assign animation according to index number in players list ordered by id.

    For changeable player list, you can maintain 'animation id' to 'player id' map in room properties. Joined player should scan this map and find 1st empty slot or slot with player id which is not connected (not in player list).

    To avoid concurrency issue when 2 new players trying to occupy the same slot, use expected value check feature (CAS, doc.photonengine.com/en-us/pun/current/gameplay/synchronization-and-state ): property update will fail if you do not provide correct previous value (happens when other player updated it few ms before).

    Don't forget to initialize all slots with 0 during room creation to allow CAS work for first properties updates.

  • Hi fens,

    i think sending positions periodically and interpolating or extrapolating them is the best you can do w/o putting much effort in development.

  • Hi ,

    Photon Voice API is pure C# solution. It can be used w/o Unity but only on C# platforms. We do not have plans for porting it to another platforms including javascript. There is a lot VoIP solutions for web including WebRTC. So I guess JS Photon Voice API would not be very demanded.

  • Hi oOScuByOo

    You need to assign unique identifier to each enemy during creation and send it in position event. When event received, use this id to apply position to correct enemy.

    Also make sure that you run enemy logic on single client only to avoid concurrent updates.

  • Seems like the last bit I tried in the previous post does work, but only if you retrieve it with PropertyOfMyRoom, and not with RoomProperty.

    I can only retrieve the room property after one has joined the room, but not before, even with the "set properties listed in the lobby" before creating the room. Why's that?

    Properties listed in lobby is a parameter of room creation. So they should be set before room creation.

    Lobby provides the list of currently existing rooms for players joined to the lobby (not to a room). It also exposes room properties which were marked as "listed in lobby" during room creation. To get property value, you need to pass room name and property name to RoomProperty.

    Normally, client in a lobby should handle "On room list update" event which triggered by any room creation, closing and and "listed in lobby" properties values change.

    Currently plugin does not provide info on which exact rooms have changed (though Photon js api does). So you most likely need to rescan entire room list in lobby and read properties. Like demo-test does in addRoomToList function:

    - iterate from 0 to Photon.RoomCount - 1

    - get Photon.RoomProperty(Photon.RoomNameAt(loopindex), "level")

    If you call these methods while joined to a room, most likely you will get rooms state at the moment of joining to a room which does not make sense.

  • Photon plugins updated. Both photon and photon chat support C3 runtime. Not every case is tested. So please do not hesitate to report errors. I will fix asap.

    Download from photonengine.com/sdks

  • The reason was mixed case in files names. Either C3 runtime AJAX addon or preview host converts url to lowercase automatically. This does not happens in C2 runtime.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have ported the Photon Plugin into the C3 Runtime. Feel free to use it.

    Thanks

    The addon failed to start until I replaced all 'C3.Behaviors.Photon's with 'C3.Plugins.Photon'. Not sure why it worked for you.

    C2 and C3 runtimes are still different. E.g. I can't run my unit tests directly in editor because they rely on AJAX 'Request URL' method which requests project files fine in c2 runtime but throws CORS error in c3.

  • DenniTerpstra

    I'm having trouble reconnecting players to the same multiplayer game. According Photon docs there is a rejoin and reconnect available but using the Contruct 2 Photon plugin these options are not available.

    ...

    I tried several ways to achieve a reconnect and rejoin same game but no success this far. Maybe someone knows the trick? Or someone can use it as a plugin improvement.

    Rejoin process simplified in latest plugin update. You do not need to pass token (current actorNr) in join room operation, just set 'rejoin' option. Rejoin should work if client leaves the room with 'suspend room' operation or gets disconnected.

    It's important to set reasonable 'suspended player live time' (and 'room live time' if you want to rejoin empty room) before room creation. Server defaults are 0 as far as I can see. So rejoin would not work w/o setting at least player live time.

    Please check log for any errors or warning. This can help find out why rejoin does not work.

  • Hello, please, could you help me with these questions?:

    Hi

    1- How do I choose the region of the photon server I want to connect to?

    Set "Region" option in Photon object properties or call "Set region" action if you need to change region in runtime.

    2 - Does Photon do this automatically and connect to the most convenient region ?.

    No, best region selection is not supported currently in Photon js sdk and construct plugins

    3 - When I use "Connect to the name server", am I connecting to a master server or a name server?

    Client connects to name server first, then automatically to master server of region you specified.

    I'm confused with this, what condition should I use to know if I'm connected to the photon server ?:

    Is connected to master server

    OR

    Is connected to name server

    It seems that neither works, even though I am connected to the server.

    Although I am connected in a room, these conditions are always true and the text is written.

    Then, how do I check if I am connected to the photon server?

    What exactly you need to know? You are connected to a server (name, master or game) while one of "Is connected to Nameserver", "Is connected to Master server", "Is connected to a lobby", "Is joined to a room" conditions is true. You may find more convenient to handle "On" events like "On join room".

    "On state change event" is useful for client state tracing.

    -------------------------------

    Final note.

    I received this error:

    When I added this condition:

    Can I give you some information to solve this?

    You use "Is connected to a lobby" as an event but it's simple condition which called on each frame. Use "On join lobby" event instead. See samples bundled with plugins for details.

  • kingpirux Photon SDK package contains both Construct 2 and Construct 3 plugin versions.

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

  • 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