playMaker

Author Topic: Photon Proxy  (Read 3811 times)

flu2120

  • Playmaker Newbie
  • *
  • Posts: 12
Photon Proxy
« on: November 26, 2013, 05:28:16 PM »
Hello,

Just found an error in my setup that is really starting to annoy me. Not that because it doesn't work, but because it does! So if someone could please clarify the photon proxy script setup it would be very much appreciated.

So what is happening in my setup? Well, I have one game object, that has two layers to work independent of one another (Canon base and canon aiming barrel). Because of this, both parts of the game objects have FSM's and as to my understanding, both require the networkview, photonview and photon proxy to get network sync. Which is fine, the main layer has all three and works perfectly as both players can see its position. However, I just noticed that my second layer only has the photon view and network view (No photon proxy)! However it works, until I add a proxy to this game object layer!


Both devices sync over two game clients, however when I add a photon proxy to the aiming device, it is no longer able to sync in its instantiating. Therefore, is this game object feeding its photon proxy script from its parent? Or is something very wrong?

Any help would be vastly appreciated!

Regards,

Simon

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon Proxy
« Reply #1 on: November 28, 2013, 02:35:26 AM »
Hi,

 the proxy is only here if you need to synch Fsm  Variables ( checked as "networl sync"), if your photonView targets the gameobject, then it's the transform that is synched ( default photon behavior if you target nothing or the gameobject transform), and I think this is what you experience.

Bye,

 Jean

flu2120

  • Playmaker Newbie
  • *
  • Posts: 12
Re: Photon Proxy
« Reply #2 on: November 28, 2013, 05:13:04 PM »
Sorry, I may not have explained the situation clearly enough.

Both objects require a Network sync variable as both can rotate independently. This works when no proxy is attached to the the child object, although I get a error log that says "Missing playmaker photon proxy Canon Layer2 with FSM Variable supposed to be synched over the network".

Whereas, if I attach a proxy, the game halts at the canon instantiation call that says "Canon layer 2 has variable checked for network synching, but no photonview component is observing this FSM". However, there is a photon view attached to this object and it is observing the variable FSM that has the network sync'd variables.

What is really concerning me is, even though I get errors on both implementations, both layers (parent, child) are sync'd over multiple clients, which is leading me to be concerned about my understanding of how these objects and photon networking work.

Is it possibly, because layer two of the canon is being instantiated by layer one, that layer two doesn't need to be instantiated and therefore is causing an unnecessary error? Or am I just doing things wrong?

Any clarification in regards to this would be very much appreciated.

Regards,

Simon

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon Proxy
« Reply #3 on: November 29, 2013, 05:01:18 AM »
Hi,

 I am not too sure I understand your setup. Could you pm me with this prefab so I can study it and see how it is understood by my system and photon.

 In all cases, for such rig, I would encourage that you only have one fsm responsible for synching variable, it's totally fine to outsource networking synchronization, especially within the same rig. Then you end up with only one photon view, which is better for performances, one fsm with synched variable, which is also better for bandwidths, and your turret would simply get and set its rotation on that fsm that is not on the same object, but in its parent.

in all cases, I am willing to get to the bottom of your issue, as this shoudl work and not fire any nonsense, so if you can share your prefab, that would be great.

 bye,

 Jean

flu2120

  • Playmaker Newbie
  • *
  • Posts: 12
Re: Photon Proxy
« Reply #4 on: December 02, 2013, 04:25:42 PM »
Hi Jean,

No problems. I will first try the one setup as you mentioned. Currently, I am treating both objects as individuals, which probably isn't exactly right considering the parent object in instantiated in and the child object simply following. If all else fails, I will send through the prefab.

Or if you like, I can send through the prefab anyway?

Regards,

Simon

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon Proxy
« Reply #5 on: December 04, 2013, 05:33:15 AM »
Hi,

 Pretty swamped atm, so I prefer you give it a go and send it to ne when you are out of ideas on how to fix this.

bye,

 Jean