Issue with using photon instantiate and UFPS multiplayer

Options
Hi there , i have recently started using photon through the UFPS multiplayer addon , and i have run in to a issue after spawning a AI using the PhotonNetwork.Instantiate method any subsequent players joining fail to create the master player , although they create the zombies fine. How should i approach this problem , is it something i can avoid by assigning the zombies lower photonview id's than the players? or can i prioritize the player creations somehow?

Comments

  • Tobias
    Options
    Sorry, but we don't know that much about UFPS, so we can hardly help here.
    I don't know how things are arranged in that package. I would have to dive into things first (and that takes a while).

    I guess you also asked in the UFPS forum?
  • Blunty
    Options
    I did ask there - i had thought you guys where some what connected to their UFPS multiplayer Photon addon pack , i probably read to much into the logos and such on the package. the error i am getting is from Photon though;

    Received OnSerialization for view ID 1001. We have no such PhotonView! Ignored this if you're leaving a room. State: Joined

    ID 1001 is the id for player 1 and this error occurs on client 2 , only after i have created stuff using PhotonNetwork.Instantiate. Could it be UFPS has assumed the RPC that created player 1 is still in the servers buffer (does the message queue work like that?) and because i have sent through a ton more RPC's the old ones have fallen off the end?


    I will try writing my own Instantiate method , and see if that makes a difference in the mean time.
  • Tobias
    Options
    We know the UFPS package is using Photon and we support them with their questions, etc. But we're not actively using the package. That's what the UFPS team does best :)

    As you already assumed, the error is for an incoming "update" message of some object which the client of player 2 doesn't know (yet).
    I guess 1001 is the player character to player 1? Does it show up?
    Did the players load levels or something?

    In general, if everything else works, this is not a big deal. It would be interesting to know where the code execution order fails but if it's working, it might be just a race condition between a character being created, updated and then it's view is registered.
  • Blunty
    Options
    yep 1001 is the player1 photon id , and no it does not appear. The error continues as further updates are received.
  • Tobias
    Options
    Do you load levels? If so, that destroys all objects - including the ones that were network instantiated.
    Use PhotonNetwork.LoadLevel in that case, if possible.
  • Blunty
    Options
    Well that sent me on a interesting path , there was no load level in the connection script (your already in the scene when you join the server currently) . Added a photonnetwork.loadlevel and it made no difference to the outcome. tried Application.loadlevel , and i got player1 appear. However exactly as you said it kills off the network instantiated zombies.

    it seems that the players need to load before zombies , but i am not sure how to differentiate the RPC's (those from the zombies and those from the players) , or how to defer the creation.
  • Tobias
    Options
    Set PhotonNetwork.automaticallySyncScene to true and use PhotonNetwork.LoadLevel() on the Master Client. This uses a room property for the level to load and automatically defers the Instantiate calls until after loading.
  • RenegadeGames
    Options
    Just a quick question, I know this is an older post. But I am having the same issue with UFPS multiplayer asset, wondering if this was resolved and how?
    Thank you for the support! :smile: