Feedback for PHOTON

Hi Photon Pun Developers,
I want to both complain about your basic tutorials and give you feedback. Your unity examples can be more advanced that can teach more about photon structure. For example, we all know that almost all multiplayer games uses recover connection to allow users to rejoin room when they have sudden internet lost. It has its own mechanics like when user lost connection, other player sees a waiting opponent panel with a timer. If remote player comes again within that time they continue playing game from same state. If other dont come within a timer, game ends etc.

So my question is that, although you see that many of photon users including me try to implement such a mechanic why dont you make an example like this schenario and put as a example!!! Otherwise, we try to understand everything from beginning. For the last 2 month I am trying to understand and implement it!!! So, please help me!!!

Comments

  • I'm sorry you're struggling with this for so long.
    Yes, maybe a sample for rejoining would be in place. Request noted.

    What's making your life complicated in this context?
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @Gokhaan,

    Thank you for choosing Photon and for your feedback!

    About rejoin, is this helpful?

    About the lack of examples or tutorials, I think there are already plenty non official PUN tutorials out there. Some series on YouTube, we list a few here but people keep making new ones.
  • Hi @Tobias and @JohnTube
    Thanks for quick response. First of all, I came to some points with the help of linked pages and previous discussions. However, it is not working %100. My last problem about my stuation is that: I cannot get an event exactly the time when remote user soft disconnects so that I can show timer!! I get userleftroom(inactive) message after 5-10 seconds later. That is why my timer is not correct I think.

    I have a few more questions. Better to ask them at once because we are approaching to release of our game.
    1- I have a ball that is controlled by 2 player. Like turn based. Player a moves ball then control transfered to player b and go on. Should I instantiate this ball as room object as it has no specific owner? Or as normal networked object(whoever master creates it)?
    2- When player a rejoins room(recover connection) ball position is reset to orginal position although I am using cleanupcacheonleave=false. However on player b, ball stays in its last position. Is it normal? By the way I am not using transform view etc. I am handling sync of ball differently. If it is normal how can I handle it? I mean when player a returns room back, ball position should be same as player b.
    3- My last question, do you guys have private support system? To take help from experts?

    If I can learn these answers I will be really fast. Thanks in advance
  • Hi @JohnTube
    Is there any news? I tried same with PunBasicTutorial and when user rejoins room character's position resets to orginal position. Like it is respawned! I am waiting your response. Thanks
  • xXNicolaXx
    edited January 2021
    Hi Gokhaan,
    I have implemented this kind of thing just few days ago. In my racing game, I need the player to be reconnected on his last known position. Default photon reconnection system, respawn the player in the original spawn position when you instantiate him the first time. So to solve this, in the update method of my player, I save his last position and rotation. Then when photon reconnect the player and spawn it again, I set the transform position and rotation to the last saved position.

    Let me know if you need some more info.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @Gokhaan,

    1. room object maybe.
    2. yes this is not supported out of the box, you need to handle it yourself.
    3. we offer consulting package but it's mainly for doing proof of concept or onboarding enterprise customers etc. we do not do a normal regular contracts where we look into your projects and debug stuff or code for you.
  • xXNicolaXx wrote: »
    Hi Gokhaan,
    I have implemented this kind of thing just few days ago. In my racing game, I need the player to be reconnected on his last known position. Default photon reconnection system, respawn the player in the original spawn position when you instantiate him the first time. So to solve this, in the update method of my player, I save his last position and rotation. Then when photon reconnect the player and spawn it again, I set the transform position and rotation to the last saved position.

    Let me know if you need some more info.

    Hi @xXNicolaXx
    Thanks my friend for your answer. I understand now what to do. Actually I was thinking about it but I thought it was a bug. what do you think about soft disconnect? I can understand remote player soft disconnected after 5-10 seconds later. I already have player ttl = 12. I think photon should fix it. I should get message onplayerleftroom(inactive) as soon as player connection lost
  • Gokhaan wrote: »
    xXNicolaXx wrote: »
    Hi Gokhaan,
    I have implemented this kind of thing just few days ago. In my racing game, I need the player to be reconnected on his last known position. Default photon reconnection system, respawn the player in the original spawn position when you instantiate him the first time. So to solve this, in the update method of my player, I save his last position and rotation. Then when photon reconnect the player and spawn it again, I set the transform position and rotation to the last saved position.

    Let me know if you need some more info.

    Hi @xXNicolaXx
    Thanks my friend for your answer. I understand now what to do. Actually I was thinking about it but I thought it was a bug. what do you think about soft disconnect? I can understand remote player soft disconnected after 5-10 seconds later. I already have player ttl = 12. I think photon should fix it. I should get message onplayerleftroom(inactive) as soon as player connection lost

    I set my ttl to 10, so players who lose connection have time to rejoin. If after 10 seconds player is not connected again, I leave the room and go back to main menu. This is a personal choice. But I tested it and if I turn off the mobile data and then turn it on again, the player instantly reconnect and spawn in my last saved position. So ReconnectAndRejoin() works fine.
  • @xXNicolaXx @JohnTube
    No Problem for disconnecting player. In my app, he can successfully connect again. My problem is I want to show timer on the other player saying that your opponent is disconnected, waiting... But I can show it 5,6 seconds delayed.
  • I use the "OnDisconnect(DisconnectCause cause)" method and it is called immediately:
    here an example:

    public override void OnDisconnected(DisconnectCause cause)
    {
    if (!GameManager.Instance.HasQuitTheMatchManually)
    {
    Debug.Log("Disconnected because: " + cause.ToString(), this);
    if ((DisconnectCause.ClientTimeout == cause) || (DisconnectCause.ExceptionOnConnect == cause) ||
    (DisconnectCause.DisconnectByServerLogic == cause) || (DisconnectCause.Exception == cause))
    {

    rejoinCalled = true;
    PhotonNetwork.ReconnectAndRejoin();
    }
    }
    }