Sending RPC to manually changed photonView results in warnin
Options
So, I am probably doing something that PUN wasn't intended for, but I don't think there is any way to do an authority scheme (where each player has authority over the objects they are interacting with) without manually allocating ViewIDs and switching them for each photonview the player is interacting with at run time.
"Had to lookup view that wasn't in dict: View (0)1003 on whatever "
The problem here is that networking peer doesn't see the manually changed viewID because it doesn't call RegisterPhotonView unless the subid was 0 (meaning it was unitialized). My terrible solution to this is to make networkingpeer.photonviewlist public and manually set up the dictionary when I'm changing viewIDs. I would really rather not have to do this, but I don't see an alternative. What can photon unity networking do for me to help me implement this network architecture?
Thanks!
"Had to lookup view that wasn't in dict: View (0)1003 on whatever "
The problem here is that networking peer doesn't see the manually changed viewID because it doesn't call RegisterPhotonView unless the subid was 0 (meaning it was unitialized). My terrible solution to this is to make networkingpeer.photonviewlist public and manually set up the dictionary when I'm changing viewIDs. I would really rather not have to do this, but I don't see an alternative. What can photon unity networking do for me to help me implement this network architecture?
Thanks!
0
Comments
-
That is a terrible solution
You probably better switch to handling objects and IDs yourself and using GameObjects or PhotonViews just to communicate about your custom objects. So instead of abusing PUN's setup of IDs, come up with something that suits you and send that info around.
Doing concurrent access and changing IDs on the fly is going to cause a lot of headache for you, I fear, cause it's all very hard to debug and reproduce, let alone imagine all scenarios how things can go wrong.
If you wanted to, you could drop PUN and use the Plain API from the Photon Unity SDK we have on our download page. It doesn't do the ID stuff and components in the first place, so you might end up with a cleaner design and something lean that works nicely for your ideas.0 -
Is the Photon server SDK compatible with photon cloud?
I could go the big-everything-manager route but that would take a lot of the convenience of just observing a script.
You're correct about the headaches. Currently I'm getting all sorts of hard to figure out bugs when two people try to access the same thing at once.
I'll check out the SDK.
thanks!0 -
Yes, the SDK is Cloud compatible. Use the LoadBalancing API for this. Especially the LoadBalancingClient class is of interest. A Unity sample shows the basics how to include network updates into Unity's game loop, too.
The headaches will eventually stop
I hope you find some fun in figuring out how you can make things work in your game.0