Takeover not successful on Networked Scene Objects with Photon Views.

Options
We have created characters that are Networked Scene Objects with Photon Views (not instantiated through Photon) that will be in every scene, so we'd like to not have to instantiate them through Photon or destroy them at any time.

We can do a successful Takeover on the client's side but none of the other players see the Takeover, even if they are in the room at the time. This leads to the ability of many players taking over the same characters.

We have tried various Photon versions.

Is this a bug or not possible?

Thank you so much.

Best Answers

Answers

  • Okay. We figured out that Networked Scene Objects will cease to function correctly if any Takeovers occur before all the Players are in the room at the same time.

    So, is there a way that we might be able to sync Networked Scene Objects for new Players that join?
  • Repro:
    Fresh install of PUN 1.75 on Unity 5.4.0p4, running a build of DemoChangeOwner-Scene.

    Player 1 performs a Takeover of the Ownership Sphere (Scene Object).

    Player 2 joins but still sees the owner as Scene on the Photon View of the Ownership Sphere . Player 2 can also take ownership of the same sphere but it is no longer relayed over the network.

    Is this how Scene Objects are supposed to work?

    Should the owner not, at least, be buffered so that new players know who owns the scene object? If anyone joins after any Takeover on a Scene Object, it renders them useless. Are we missing a step?

    Thank you.

  • Hi,

    Thanks for the repro steps, I am trying to replicate right now, I'll get back to you on my findings.

    Bye,

    Jean
  • Hi,

    ok, basically I can't repro this:

    you can check my screencast here:



    and it works ok.

    Can you make a screencast of your repro? maybe I am missing something.

    Bye,

    Jean
  • joeDevlin
    joeDevlin
    edited September 2016
    Options
    Thanks so much, Jean, for taking the time and effort to try and reproduce this.

    In your screencast, all three clients are connected before you initiate a Takeover.

    The problem lies in a client connecting after a Networked Scene Object Takeover (non-scene objects work fine with regard to ownership).

    Could you try starting a single, master instance and performing a Takeover before connecting with a client?

    Thanks again.
  • Hi,

    yes I see. I was missing the later join in step 2. Let me investigate it and get back to you. thanks for catching this!

    Bye,

    Jean
  • We have the same issue in Stickman Battlefields ( https://play.google.com/store/apps/details?id=com.rsz.StickmanBattlefields )

    Everything used to work fine but with the latest Photon PUN version we have the problem that networked scene objects current owner (e.g. a Tank boarded by a player) is not synchronised to new players joining. (From their perspective the scene objects owner is still the scene).

    Any quick workaround available for this?
  • Any ETA on a fix? We have to decide whether going with an old or new photon version
  • Hi,

    With which version of PUN it was working? If you have a repro scene where it works with a certain version of PUN, I think it's important, because from what we've discussed the problem is there since day one.


    Bye,

    Jean
  • It used to work fine with PUN 1.67 and all lower version. Didn't try version between 1.67 and 1.76.
  • It might also be a problem with the photonView.isMine property, not really sure. If we use 1.67 it looks like the owner is always scene, no matter which player used RequestOwnership. But in 1.76, the scene objects owner changes to the owning player, but only in the instance of this player. And then for any reason it looks like both players think the object belongs to them.
  • Ok, we found a difference between the two version.

    Following situation:
    - A Tank as scene object, set to Takeover in photon view.
    - Player 1 and Player 2 in the game.
    - Player 2 enters the Tank and takes ownership.

    PUN 1.67:
    Unity inspector shows photonView.owner still as Scene on player 1 and player 2 after RequestOwnership.
    PUN 1.76:
    Unity inspector shows photonView.owner as player 2 after RequestOwnership.

    - Then, player 1 leaves the game.
    - Player 1 rejoins.
    - Player 1 boards the tank and takes ownership.

    PUN 1.67:
    Unity inspector shows photonView.owner as Scene on player 1 and player 2.
    PUN 1.76:
    Unity inspector shows photonView.owner as player 2 for player 2 and player 1 for player 1.

    Both players photonView.isMine == true when using PUN 1.76. This is what causes a lot of errors in our games logic.




  • Hi,

    Thanks for the detailed answer, very valuable! We are looking into this.

    Bye,

    Jean
  • Do you have any ETA for a workaround/fix for us? We have our update ready and really would like to include the new photon version but we have to submit asap because of other important fixes. We tested 1.76 already, works perfect except for this one issue...
  • Hi,

    I can't give you any eta here. The trouble is tricky to solve internally. Personally I would look into storing ownership in room properties to guarantee consistency. If everytime a player request ownership on a GameObject, you can set a room property for it, and another player joining can go through that list and correct ownership where it applies. Some also implemented buffered RPC, but I think room Properties could be a better alternative. I am currently experimenting with this. I'll let you know if I can make a component to solve this.

    Bye,

    Jean
  • Wait a moment... You steps you explained, are they for a workaround or do you plan not to fix this bug internally and this is the solution. Please note, this all used to work earlier without any problems. Storing ownership (a photon fundamental) in room properties looks very strange to me.

    Anyway, we will skip 1.76 for this update round of our apps.
  • Btw, we switched back to 1.67 yesterday and did excessive tests. Ownership transfer worked in every situation, regardless of the time new players are joining. If I can debug you anything on 1.67 or try to reproduce special cases just let me know.
  • Hi,

    no the internal fix would not make use of room properties, this is indeed a hack to make it work right now.

    Thanks for your confirmation on 1.67, we'll investigate.

    Bye,

    Jean
  • Thanks, guys, for taking these necessary steps. We appreciate it.
  • joeDevlin
    Options
    Might we see this fix in the next Photon update?

    Thank you.
  • joeDevlin
    Options
    Wow, great to hear that.

    Thanks so much.
  • Has a solution been found for this?
  • jeanfabre
    jeanfabre mod
    edited November 2016
    Options
    Hi,

    as a double check can you test your case with the latest version from the asset store, v1.79 at the time of wrting, v1.77 did change ownership handling.

    Bye,

    Jean
  • jeanfabre
    Options
    Hi,

    uhm, is it because of slow networking? I am having a hard time figuring out how to repro this. if you have the repro steps or even a screencast so that I can see the timing for all of this, that would help.

    Bye,

    Jean
  • I am still experiencing an error. If a player joins the server after another player has taken ownership of an object than the newly joined player doesn't recognize ownership transfers of that object. Should this have been fixed in the newest asset store version?
  • jeanfabre
    Options
    Hi,

    I can repro this. Investigating.

    Bye,

    Jean

  • jeanfabre
    Options
    Hi,

    I could repro, and it's been fixed now. It will be shipped in the next update. If you need the fix now, simply change line 2234 of NetworkingPeer.cs to

    if (currentOwner == requestedView.ownerId || (currentOwner == 0 && requestedView.ownerId == this.mMasterClientId) || requestedView.ownerId == 0)


    Bye,

    Jean