Received OnSerialization for view ID xxxx We have no such photon view.

Options
I have a racing game where the master client is able to change the scene / track that players are racing on at any time. The players all join a room and then within that room the race manager can choose to load a new scene once racers get bored of the current loaded scene / track.

I'm using automaticallysyncscene = true and the master client loads the new scene by calling PhotonNetwork.LoadLevel

This works fine and you can see the master client switches first and then the clients follow automatically as expected.

After the new scene loads the master client can see all players but players in some cases can't see each other or the master client and I get the warnings about no such photon view existing. I can also see that the clone GOs for the players have not been instantiated.

My understanding was that using automaticallysyncscene and photonnetwork.loadlevel all this serialization stuff would be handled for me but clearly something is going very wrong. I've been searching for a solution but so far nothing found except stuff about turning off the message queue which I thought was automatic in the scenario I've described above?

Another symptom is if the player who can't see others then leaves and rejoins he may then see multiple instances of the same players as if the scene has been changed multiple times it seems to be stacking 'ghost' entities which then reappear as clones with view id's that just float about as there is no seralization for them.

What am I doing wrong to cause this?

Comments

  • Ash68
    Options
    Interesting ..... I delayed the instantiation of the player prefabs after loading the scene and now the problem isn't happening
  • Ash68
    Options
    It seems just delaying the master client instantiation resolves the issue, it's a bit of a hit or miss solution though as the question is just how long is the right delay time as different machines may take different times to load the level. Still playing with it to see what I can and can't get away with but would appreciate some thoughts from technical support on this one. What exactly is delaying things doing for me to make it work ok?
  • Ash68
    Options
    No update on this at all from Photon development?
  • jeanfabre
    Options
    Hi,

    Yep, This rings a bell. You need to flag your instance using DontDestroyOnLoad() to survive scene loading.

    We've created a new tutorial using scene synchronization, maybe I could send you the preview for it and you could compare the behaviours?

    Bye,

    Jean
  • Ash68
    Ash68
    edited June 2016
    Options
    Hi Jean, that may be useful, at the moment it's mostly working ok by me delaying the instantiation of the player prefab at scene load but I get the occasional unconnected ghost prefab/clone which I can't attribute to anything other than it's a ghost of the master client. The master client is the one that causes a new scene to load and will always be the first player to arrive in the new scene. Aside from that I can't see any reasons for the ghost appearing.
  • jeanfabre
    Options
    Hi,

    Sorry, I did not quite understand, should I send you the demo package?

    Bye,

    Jean
  • Ash68
    Options
    yes please send it to me, do you need my email or can you find it from the forum?
  • jeanfabre
    Options
    Hi,

    Good news, it's now available in the package on the Asset store :)

    So download the latest Photon, and check out the "PUN basics-Tutorial" in the "Demos" folder.

    Check out the "PlayerManager" script, this is where I set it to DontDestroyOnLoad().

    There is a related tutorial for it here:

    http://doc.photonengine.com/en-us/pun/current/tutorials/pun-basics-tutorial/intro

    this takes to a step by step tutorial on building this demo, so you'll find lots of information.

    Let me know if you have questions or things you need more details on.

    Bye,

    Jean
  • ElenaJones
    Options
    @Ash68
    Were you able to get this work without using the delay instantiation (b/c like you said this can be unreliable)...I have been having the same problems but it seems unanswered throughout the forums
  • Ash68
    Options
    No, I didn't go back and try to fix this without a delayed instantiate. We have been running for a long time now with the delayed instantiate and it has been very reliable. I'm afraid my memory doesn't serve me very well on how I got rid of the disconnected ghosts we were seeing but those are now gone, I think I just increased the instantiate delay in the end, it's set at 3 seconds and we never see any problems now. It's a bit of a crap solution but it works reliably for us.
  • ElenaJones
    Options
    Thanks for letting me know, I'm struggling with the same problem....wish they had a mod look more into this it seems it gets asked about a few times a year with no reasonable response.
  • jeanfabre
    Options
    Hi,

    I am a mod :) I replied above on this basic tutorial having some code examples on how to deal with this. The basic tutorial has a system to load different levels based on the number of Players in the room, it's just an excuse to show how levels loading can be synchronised across the network and how to handle Player instances between levels.

    http://doc.photonengine.com/en-us/pun/current/tutorials/pun-basics-tutorial/intro
    https://doc.photonengine.com/en-us/pun/current/tutorials/pun-basics-tutorial/gamemanager-levels
    https://doc.photonengine.com/en-us/pun/current/tutorials/pun-basics-tutorial/player-instantiation

    So check it out and get back to me if you have trouble still :)

    Bye,

    Jean