How to reduce transferOwndership in photon multiplayer

hardik
hardik

I'm currently building in Carrom Multiplayer. In this I have a problem when my player takes its turn and transfer the turn to the opponent the waiting time takes more so I need to fix it plz give me a suggestion.....


Best Answer

  • Tobias
    Tobias admin
    Answer ✓

    That's not a lot of objects, I would say. It should be possible to transfer ownership in less than a second.

    What the video doesn't show is why this takes so long and what's going on. You may want to check if you are sending a lot of data accidentally.

Answers

  • please answer me

  • We don't really know what you want to achieve and where you are stuck, so it's hard to make suggestions.

    How long does it take (in seconds) and how many PhotonViews will transfer ownership?

    It sounds as if you transfer each PhotonView's ownership every time the next turn starts.

    I would possibly not use PhotonViews and ownership in this type of game and just use RaiseEvent and Custom Room Properties. Typically your logic just needs to know which turn it is and then it's clear who can control board pieces. Similarly, the pieces have places where they could be placed, so synchronizing transforms may be overkill anyways.

  • Please open the link and Watch the video You can batter understand what i'm saying......

    my turn is done than transfer to opponent player the transfer time are 1sec given but it's take more time like 6 to 7sec

    https://mega.nz/file/N0UySRga#jmgRV_b4i9dZUMuz7s6zCBx4ATibERzirVQDSb1ZVP8

  • Tobias
    Tobias admin
    Answer ✓

    That's not a lot of objects, I would say. It should be possible to transfer ownership in less than a second.

    What the video doesn't show is why this takes so long and what's going on. You may want to check if you are sending a lot of data accidentally.

  • okay thank you for your suggestion

  • Hey @Tobias can reduce TransferOwnership

    transfer ownership in less than a second right. but in run time player finish there turn and move to opponent player its take 8 sec every turn change. how can i solve this problem

  • You need to figure out what causes the issue...

    Maybe you are sending a lot of data accidentally? Or there is something you send at high frequency unintentionally?

    You will need to analyze this some more and at least narrow it down. Disable components that are not relevant for the case to see if any of those contributes to the delay.

    Enable the SupportLogger, get logs from both clients and check if there are errors or suspicious values.