ThePhotons's Forum Posts

  • PabloDev

    You don't need 2 PCs to test Photon plugin. Even 2 clients in 2 tabs of the same browser communicate via Photon servers, as if they were on different networks.

  • PabloDev

    Hello, a question, what is the best way to search for players around the world?

    Would I have to connect region by region and thus seek a game?

    Players connected to different regions can't join the same room or search each other in a lobby.

    Scanning regions is the only option for now.

    Will this plugin no longer receive feature updates?

    The plugin and Photon JS SDK are not actively developed at the moment. We mostly fixing bugs.

    For example, local game without adding code to the online game.

    I don't quite understand what you mean.

  • kentoy

    Im using Construct2 and set photon to Self hosted, and set address to my server xxxx.com:5055

    5055 is UDP port by default. See doc.photonengine.com/realtime/current/connection-and-authentication/tcp-and-udp-port-numbers

    You need to conect to WebSocket (default 9090) or Secure WebSocket (default 19090) server endpoints. The latter also requires additional setup doc.photonengine.com/server/current/operations/websockets-ssl-setup

  • PabloDev

    No. Use Photon 'On Error' event instead.

    'On disconnect' and 'On state change' events also may be useful sometimes.

  • rk123

    I have a simple drag & drop game where I use photon to update the position of an item after drop. There are only 10 items in the layout and 2 players, however the connection always gets lost after being in the layout after some time. Is this the concession we have to make when using photon? In other words, is this something we have to live with? I can't imagine that being the case for 100$ a month.

    Another problem I got is when a room is made, other players have to join quickly, because after 1 or 2 minutes or so it becomes impossible to join the room.

    Do demos from the plugin package loose connection and can't join after 2 min. just like your app?

    What's in client logs? Maybe you send too much and the connection bandwidth is not enough?

    What error do you get when client fails to join the room? A room is automatically destroyed when last players leaves it.

  • PabloDev

    So will any connection attempt fail or will the plugin just keep looking for a game until another player leaves?

    That is, what should I show on the screen if this occurs?

    A - Should I not show anything and just continue with the message "looking for a game"? -> the plugin will keep looking for a game.

    B - Should I display a "server is full, please try again later" message? -> the plugin is automatically disconnected when the limit has been exceeded.

    The plugin does not retry to connect automatically. It only calls error callback. Of course you can implement automatic reconnection in the error handler.

    Since you can't distinguish "server full" from other errors, it does not make sense to notify user about that. More generic message like in A) may be more appropriate.

  • kentoy

    So is that means if player join rooms with different lobby names using Photon C2 plugin, they can not match each others?

    Correct. Players from different lobbies can't join the same room.

  • hi kentoy

    Please read matchmaking documentation doc.photonengine.com/realtime/current/lobby-and-matchmaking/matchmaking-and-lobby

    It also has detailed lobby definition.

  • BronzeBeardGames

    I have used that but it causes console errors, ill try print them out later. Is there a special way to use it?

    I don't have an idea which errors you are talking about.

  • BronzeBeardGames

    Photon.Disconnect action disconnects from all servers.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • aminhanifm

    Sending t0 in event is even better idea than storing it locally. Then you don't confuse different pings running in parallel.

    But you do not need to do anything each tick or second. Check ping whenever you need it. Maybe once per room join. Send an event with the current time to yourself. When the event received, subtract the time stored in the event from the current time. The result is rtt or ping.

  • aminhanifm

    You need to get the current time t0 (not sure what is the best way to do so in ConstructX), send an event, receive it, get the current time again and subtract t0 from it. The result will be round trip time, that is the time required to transmit the signal to the server and back.

  • aminhanifm

    Layout loading:

    If you join a room after layout has been loaded, the "finish" signal would be "on actor join" event. You can simply check the current number of players in the room in this handler.

    Latency:

    To measure round trip time to the server, send an event to yourself (specify client actor id in TargetActors).

    The same works for rtt to players. Send and event and reply to it back to sender.

  • BronzeBeardGames

    Static objects can be handled in different ways. The simplest would be to store object positions in the room properties. Any client may add or change these properties and they are automatically updated on all other clients.

  • PabloDev

    If ccu limit is reached, new clients will be refused to connect. Unfortunately, the server does not send any specific error in such case.