playMaker

Author Topic: Issue with Photon View  (Read 2377 times)

bodsey

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Issue with Photon View
« on: September 25, 2015, 03:51:51 AM »
Hello again,

I'm having another issue with Photon in Playmaker. Sometimes I got the error :
"Fsm Component 'xxx' on gameObject 'xxx' has variable checked for network synching, but no PhotonView component is observing this fsm", although :

- There is a PhotonView component on the object
- The exact same object has been instantiated on a previous test without any error

So this error seems to pop randomly and it's getting on my nerves. The only turnaround so far has been to remove the component and make a new one.

I don't want to come out as harsh or anything, but does Photon and Playmaker has been used by some users to make a full game yet, or is it just good for quick prototyping ? I'd like to go in production soon but I'm starting to wander if it's a good idea to start with Playmaker and Photon, maybe I should already start coding and using the latest built-in Unity network manager.

Thanks !

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15212
  • Official Playmaker Support
    • View Profile
Re: Issue with Photon View
« Reply #1 on: September 25, 2015, 04:08:35 AM »
Hi,

 That's odd you are getting this.

Do you mean that if the problem occurs, it then happens always? and you have to refactor it? Or is it happening randomly.

As for wether photon+PlayMaker is used in real production, I can't speak for other developers, but I haven been involved in many projects from other developers helping them getting things done, but I am not sure what's their current state.

Photon is in my opinion still number one for networking in Unity, even with the new Unity's own networking system. It needs to mature before reaching what photon is providing.

So if you have a problem, I am more than happy to assist you to find the issue and if it turns out it's something in the playmaker bridge, in playmaker or in Photon, it will be fixed.

-- Are you using templates on the fsm that you use network synch variables?
-- Are you sure you instantiate the prefab at the right time ( when user enters room), maybe it's slightly too soon?
-- is it happening on the owner or on instances over the network?
-- can you get the latest ( I just updated yesterday to the latest version of pun)
-- are you on Unity 4 or 5?


Bye,

 Jean


Bye,

 Jean

bodsey

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: Issue with Photon View
« Reply #2 on: September 25, 2015, 04:25:53 AM »
Hi Jean,

Thanks a lot for the answer, it's reassuring. I'd love to proceed with Playmaker for my project, and I truely hope it'll work out well.

Any, to answer your questions:

-- Are you using templates on the fsm that you use network synch variables?

No, I've posted my issue with this this week, so no I stop using reference to template for network object.

-- Are you sure you instantiate the prefab at the right time ( when user enters room), maybe it's slightly too soon?

I instantiate the object with the Master Client on the JOINED ROOM EVENT

-- is it happening on the owner or on instances over the network?

I'm not sure I'm understanding the question, but I've got the issue while testing the game in editor mode so it's with the Master Client.

-- can you get the latest ( I just updated yesterday to the latest version of pun)

I did, same error.

-- are you on Unity 4 or 5?

Unity 5.

About the previous question, now it's happening always on my latest prefab. I add a PhotonView and drag and drop the Fsm Component in Observed components, with no luck. Note that the gameobject with Synch variables is nested in the gameObject which is instantiated, if that helps.

Update : I tried to instantiate directly the gameObject with synch var and it seems to work. So the error might come from the fact that I instantiate a gameobject which contains the gameobject with synch var...

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15212
  • Official Playmaker Support
    • View Profile
Re: Issue with Photon View
« Reply #3 on: September 25, 2015, 05:00:07 AM »
Hi,

 ok, so the nested bit could be an issue yes, the networview being on the higher fsm right? or do you have the nested GameObject with its own networkview too?

 maybe you could do a small description of your prefba hierarchy and I'll try to repro.

 I personally always have one networkview per prefab sitting on the root of the prefab, with one fsm with all the network var to synch, it centralize stuff and is more manageable for complex setup, that's maybe why I never get into these problems myself. So it's good you step in with some alternative setup.

 Are you sure you can nest networkviews ( if this is what you do), I would double check on photon forum if this is actually possible/reliable/effective.


Bye,

 Jean

bodsey

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: Issue with Photon View
« Reply #4 on: September 25, 2015, 05:14:05 AM »
My prefab has :

- A parent empty gameobject with a photon GO proxy and an empty photon view. I have this set-up because I'm trying to manage groups of enemies over network so I need to instantiate a parent and not individual enemies. I have the 2 components because I need so for the network instantiating
- A child gameobject with several FSMs, including only one with synch var, with one Photon View observing this one FSM.

If you think this set-up can be the problem / isn't reliable, I'll go ahead and do things with another logic. I didn't investigate that much on Photon forum but a quick search brought no info on nested photon view.

Thanks !

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15212
  • Official Playmaker Support
    • View Profile
Re: Issue with Photon View
« Reply #5 on: September 25, 2015, 06:35:04 AM »
Hi,

 yeah, I can see where things would go very wrong here.

 to manage a group of ennemies, have an abstracted system, at least not nested

maintain a prefab "EnemyGroupManager" on its own, and have all ennemies for a given group maintain a group id, and so they always refer and communite amongst them or their manager using this id.

the manager can maintain a list of them, but that's all with pur logic, not mixing networkviews, it's two distinct needs. you don't need to nest networkviews to have a group of networkview being managed.

 so yeah, go with a simpler approach, like you would do without any networking on, and then within the ennemy manager group, you can start sharing variables accross the network, but that's a second phase, distinct from the management side of things.

Interesting topic :)

Bye,

 Jean

bodsey

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: Issue with Photon View
« Reply #6 on: September 25, 2015, 06:43:54 AM »
Yes thanks, I'm already re-working. I know it's just an habit to get, but the way I did it was the way I'd have done it without network. I'm working on a semi-procedural game, and I use to put "level design patterns" in empty gameobjects so I can generate them on the go as the player advances. But to instantiate with Photon you must have a photon view. Now I understand you can't have another objects with photon view in children, so it's my whole design logic I have to rethink.

Now I'm thinking I can have a proxy GO and instantiate it, and when it's instantiated recreate the hierarchy I'm used with a script.

Yes, interesting topic, thank you for your support

bye !

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15212
  • Official Playmaker Support
    • View Profile
Re: Issue with Photon View
« Reply #7 on: September 25, 2015, 09:10:38 AM »
Hi,

 I would leave network instances as they are at the root of the scene without parenting them afterwards, I have a feel it's not ideal, especially if you are using rigidbodies ( even without networking, it's not a good idea)


Bye,

 Jean