playMaker

Author Topic: Send Remote Event huge bug  (Read 6906 times)

flekoun

  • Playmaker Newbie
  • *
  • Posts: 19
Send Remote Event huge bug
« on: June 17, 2014, 05:21:00 PM »
There is a nasty bug when trying to use action "Send Remote Event" in any FMS. This bug actually makes my hopes for making networking game using Playmaker dead.
"Send Remote Event" works fine if you have only one FSM on the GO. In fact you can have more of them but only the first one in the Inspector view (the TOP one) is working. Any other below him are deaf.
Adding more Network views wont help. I also noticed that when drag and dropping FMS into the Observer property on the Network view the text refers to whole GO not to particular FSM only. Is is even intended to use more FSM on one GO together with networking? If not than the PM networking is joke and this is still bug as no one expect that only the top FSM works (even if you drag and drop other one into the Observed field).
Waiting this to be fixed otherwise I cannot do anything serious with PM networking.

Best,
Jan

flekoun

  • Playmaker Newbie
  • *
  • Posts: 19
Re: Send Remote Event huge bug
« Reply #1 on: June 18, 2014, 09:59:49 AM »
Also want to point out other bug. When you instantiate new prefab with FSM on server then when you call "Get Parent" in the FSM of this GO on Server ( I know that parenting is not send on clients) right after the Start event it will return null even if the GO is child of other GO. However if you put a small wait before calling "GetParent" than the parent is recognized correctly.Tried to add other events instead of Start but nothing worked. There is no way to know when the GO "is ready" to recognize its parent....

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Send Remote Event huge bug
« Reply #2 on: June 18, 2014, 11:40:03 AM »
SendRemoteEvent uses Unity's RPC calls which unfortunately have the limitation you describe - they only invoke the first method found on the GameObject. You would have the same problem with multiple C# scripts on the same GameObject.

You could have the first FSM forward events to the other FSMs. But this seems like it would be a pain to maintain...

So instead I've made a new SendRemoteEventByProxy action. This action invokes an RPC function on a proxy component attached to the GameObject. In the proxy component you define which FSMs you want to forward the event to.

I've tried to make this relatively painless. The action will check that PlayMakerRPCProxy is on the GameObject and the proxy behaviour will by default include all the PlayMakerFSMs on the GameObject.

Anyway, give it a shot, and let me know how it works for you. You should consider this a beta! But if it works well we'll include it in the next update.

Thanks for helping us address this issue!

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Send Remote Event huge bug
« Reply #3 on: June 18, 2014, 11:45:57 AM »
Also want to point out other bug. When you instantiate new prefab with FSM on server then when you call "Get Parent" in the FSM of this GO on Server ( I know that parenting is not send on clients) right after the Start event it will return null even if the GO is child of other GO. However if you put a small wait before calling "GetParent" than the parent is recognized correctly.Tried to add other events instead of Start but nothing worked. There is no way to know when the GO "is ready" to recognize its parent....

How are you parenting the object on the server? With Playmaker?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Send Remote Event huge bug
« Reply #4 on: June 18, 2014, 03:15:18 PM »
BTW, Jean is the real networking expert, so I could be wrong about some of this! Jean is on vacation, so only popping into the forums when he has time... but don't worry we'll get this sorted out one way or another...

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Send Remote Event huge bug
« Reply #5 on: June 18, 2014, 03:30:07 PM »
Hi,

 Just to take the conversation with Alex we have on this to you guys so you are in the loop.

 I do think that an RPC event should be reaching every Fsm on a GameObject. This is how I have it setup with Photon support for PlayMaker, and how I am currently working on with uLink.

But this is really one way to do it. In conventinoal scripting, only one script is getting an RPC, the one that declares it. But I think we should be more flexible with PlayMaker ( just cause we can :) )

Also, I think it's very good that networking is dealt with proxies like Alex provided on this thread, at least outside PlayMaker own code base, this allows for more granular control, and tweak when performance starts to be an issue. Typically, how data is serialized, and how specific RPC calls can be ( both in terms of targets, but also in terms of data being sent with the rpc event).


Bye,

 Jean

flekoun

  • Playmaker Newbie
  • *
  • Posts: 19
Re: Send Remote Event huge bug
« Reply #6 on: June 18, 2014, 03:35:54 PM »
SendRemoteEvent uses Unity's RPC calls which unfortunately have the limitation you describe - they only invoke the first method found on the GameObject. You would have the same problem with multiple C# scripts on the same GameObject.

You could have the first FSM forward events to the other FSMs. But this seems like it would be a pain to maintain...

So instead I've made a new SendRemoteEventByProxy action. This action invokes an RPC function on a proxy component attached to the GameObject. In the proxy component you define which FSMs you want to forward the event to.

I've tried to make this relatively painless. The action will check that PlayMakerRPCProxy is on the GameObject and the proxy behaviour will by default include all the PlayMakerFSMs on the GameObject.

Anyway, give it a shot, and let me know how it works for you. You should consider this a beta! But if it works well we'll include it in the next update.

Thanks for helping us address this issue!

Alex thanks for your effort!Can you also confirm that the field "String Data" in event "Send Remote Event" is not working? I also found some thread on this forum where somebody from your team admit this(dunno if it was not fixed already). Because when I put anything into this field , the playmaker throw exception stating :

"Sending RPC "SendRemoteFsmEvent" failed because the number of supplied parameters doesn't match the rpc declaration. Expected 1 but got 2 parameters".

Seems too much struggle to get PM networking going for me. I need to send informations to server which client clicked on the GO and this seems to be only way. However seems not working. I guess I should rather use good old scripting to get networking going. Anyway thanks for your time!

flekoun

  • Playmaker Newbie
  • *
  • Posts: 19
Re: Send Remote Event huge bug
« Reply #7 on: June 18, 2014, 03:38:59 PM »
Hi,

 Just to take the conversation with Alex we have on this to you guys so you are in the loop.

 I do think that an RPC event should be reaching every Fsm on a GameObject. This is how I have it setup with Photon support for PlayMaker, and how I am currently working on with uLink.

But this is really one way to do it. In conventinoal scripting, only one script is getting an RPC, the one that declares it. But I think we should be more flexible with PlayMaker ( just cause we can :) )

Also, I think it's very good that networking is dealt with proxies like Alex provided on this thread, at least outside PlayMaker own code base, this allows for more granular control, and tweak when performance starts to be an issue. Typically, how data is serialized, and how specific RPC calls can be ( both in terms of targets, but also in terms of data being sent with the rpc event).


Bye,

 Jean

Thanks Jean. You are working on uLink integration?! Wow , great! thanks! Well I guess I will wait for the uLink than :) Cant wait.
Well ppl are expect a lot from PM nowadays. Because it is so easy to program with it for single client. If it was with networking also than PM would be king. Maybe with uLink it will!

nezzard

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Send Remote Event huge bug
« Reply #8 on: August 14, 2014, 03:13:39 PM »
Guys I have also not transmit string value, how to fix it?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Send Remote Event huge bug
« Reply #9 on: October 28, 2014, 01:23:06 AM »
Hi,

 this is coming for 1.8, I haven't had time to verify locally the fix, but it's in the notes that it's been address.

 Bye,

 Jean