ThePhotons's Forum Posts

  • When I add "alertblocker" plugin there is error when i try add some new object

    Please try updated plugin: https://www.dropbox.com/s/kjr0pey3zc5nc ... addon?dl=1

  • > Btw please fix this issue of trying to connect to a random room while connected to a room. Getting alerts with js errors is not too great.

    >

    Underlying Photon js library throws exceptions. This is not a problem in js app but it seems like it's not possible to catch exceptions in Scirra app. We will think about changing error handling w/o breaking existing js apps.

    I wrote simple "alertblocker" plugin which disables alerts if AlertBlocker object exists in a project. It has nothing to do with Photon and can be used in any project. You can find plugin in updated Photon Construct 2 SDK: https://www.photonengine.com/en-US/sdks ... construct2

    Also Photon and Photon Chat plugins trigger "On error" condition if exception is thrown by Photon library.

  • So the point is, can i spawn joined player to a randomized position and old joined player spawned on the last place he moved (not by randomized) ? maybe you can help with the events that should i put..

    You spawn player object once, most likely on joined client. Then you create object copies on other clients.

    For original object, you set position explicitly (e.g. using random numbers). For object copies, you synchronize position with original object each time this position changes including initial position assignment. Also, each existing client should send position update to a new joined client.

  • gonzdevour

    Because of "visual" coding, adding custom properties table parameter to "Join Random Room" is complicated. So we choose another approach. Set properties and max player for "my" room before connection as you do when creating a room and set MatchMyRoom parameter of "Join Random Room" to Yes.

  • AbusiveChAoS

    If objects positions generated dynamically, you need to send each position to a joined client.

    If generation is based on deterministic random numbers sequence, it's enough to send random seed only and repeat generation process on joined client.

  • ThePhotons :: I have a question, how do we use the features custom authentication, userIDs and Friends in the Photon Plugin for matchmaking.

    It seems that it isn't very much documented.

    An example project would be nice with Friendlist, authentication and with the use of ActorNr and UserIDs.

    Thanks a lot.

    Did you read Custom Authentication documentation? It describes workflow well though Photon plugin client details may differ from what you find in the doc.

    Find friend is not documented currently but it's quite simple. You set user id for each client before connection. While connected to a master, call "Find friends" with comma-separated list of user ids. In "On FindFriends result" event call Photon.FriendOnline and Photon.FriendRoom with user id as a parameter to get requested user status.

    Note that custom auth can override user id set by client.

    ActorNr used to identify player inside a room, when client is connected to game server.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I got a server for self hosting and the game works via wss but I get error messages when I try to gets appPeerCount and lobby stats, etc.

    When clients connects to a game server, it disconnects from master by default. Leaving room reconnects client to a master where LoobbyStats requests start working again. JS SDK client supports keeping connection to a master while joined to a room. But this is not recommended and the feature is not exposed in plugin.

    Also Lobby statistics events are sent as client connects to a master server. Then they are sent every minute.

    Application statistics events are sent automatically each 5 sec. while client is connected to a master.

    [quote:3bl4x0iq]Btw please fix this issue of trying to connect to a random room while connected to a room. Getting alerts with js errors is not too great.

    Underlying Photon js library throws exceptions. This is not a problem in js app but it seems like it's not possible to catch exceptions in Scirra app. We will think about changing error handling w/o breaking existing js apps.

  • aminhanifm

    createFish accepts 2 parameters. You need to add 2 more to pass position. Also add position values to payload when raising event 1 and parse them when handling "On event 1". Current payload is fish type number. You need to pass a table with 3 parameters instead: type, x and y. Because Construct does not support js objects as parameters, encode this table in string, with json e.g.

  • aminhanifm

    Which exact Photon example do you use? What is the name of the function? Do you have any errors or something does not work as expected?

  • adventurist

    You can omit sending and processing event from joining client and handle "On actor join" action on master instead.

  • Phacanu

    Maybe this is related somehow to 2nd-level domain. CertificateName = "*.photonssl.science" looks like more conventional value.

    If you still experience problems with wss connection, please mail to developer(at)photonengine.com where server experts can help.

    Please specify exact error you have and attach client and server logs.

  • ThePhotons i would also like a little more insight into interest groups,the example capx are good and they cover about everything except interest groups

    Interest groups are quite simple. If you specified group in event, only clients subscribed to this group will receive the event.

    Use Change Groups action to subscribe and unsubscribe.

  • ThePhotons Will we be able to get access to the self hosted variable via the eventsheet in the future? with the current set up you can only connect to one server unless you build multiple games just for a location so i dont think that'd work in full on production.

    And i read that

    [quote:2nlfmczy]Several client libraries have built-in "Network Traffic Stats" that should help you to answer these questions.

    will that also be available for js/c2 ?

    We will add runtime access to self-hosted variables this week I hope.

    Traffic stats are not supported by underlying js Photon library. It's possible that we will add such support in the library but it's not expected to happen soon.

  • > Phacanu digitalsoapbox

    > Another option may be dividing game field in interest areas and assigning interest group to each. Subscribe player to interest group as he enters and unsubscribe as he leaves the area ("Change groups" action). In event, specify interest group which area better matches player position.

    >

    That seems like it would be more useful for something like a board game where interest groups would be more likely to remain static than what was being asked about, which is more about selecting remote Player objects around the local Player's position. Unless I'm missing something? Does dividing the playfield by interest areas also work dynamically? I haven't spent much time w/ interest areas so any additional insight would be appreciated.

    Interest groups is the way of sending data to a group of players w/o explicitly specifying players ids in event. You can group player by any parameter including position. Dynamic interest areas (with interest groups mapped to areas) is also possible of course. The question is how do you update groups subscriptions dynamically. In case of static areas, player subscribes or unsubscribes as he changes position. That way, he does not need to know other players positions.

  • Phacanu digitalsoapbox

    Another option may be dividing game field in interest areas and assigning interest group to each. Subscribe player to interest group as he enters and unsubscribe as he leaves the area ("Change groups" action). In event, specify interest group which area better matches player position.