playMaker

Author Topic: Photon View RPC Broadcast Fsm Event -- Broadcast All only?  (Read 2682 times)

Sid

  • Playmaker Newbie
  • *
  • Posts: 32
Photon View RPC Broadcast Fsm Event -- Broadcast All only?
« on: July 19, 2016, 09:02:23 AM »
Will we ever be able to use the other Photon "Event Targets" like Game Object, Game Object FSM, and FSM Component?

The extra steps of having to broadcast to every Game Object and then sort it back out to where you originally want it to go seems awfully clunky and expensive.

Should we continue to set up our games in this indirect manner or will it be possible some day to broadcast precisely to the Game Object we need?

Thanks so much!


Sid

  • Playmaker Newbie
  • *
  • Posts: 32
Re: Photon View RPC Broadcast Fsm Event -- Broadcast All only?
« Reply #1 on: July 27, 2016, 10:23:14 PM »
... also, will we ever have the option to broadcast other variables besides strings?

Thanks!

Sorry to bump but would love to know if we could set this up in a much-less convoluted way. 

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon View RPC Broadcast Fsm Event -- Broadcast All only?
« Reply #2 on: July 28, 2016, 08:56:25 AM »
Hi

You should then use PhotonViewBroadcastFsmEventToPlayer, you leave it to broadcast but only instances of that player will receive it, and this likely what want.

Else, can you explain your case?

Bye

Jean

Sid

  • Playmaker Newbie
  • *
  • Posts: 32
Re: Photon View RPC Broadcast Fsm Event -- Broadcast All only?
« Reply #3 on: July 28, 2016, 10:40:43 AM »
Thanks, Jean.

So, right now only "Broadcast All" actually works.  If you want to send an event through Photon, you can't specifically and easily target the FSM you want. 

For instance, if you just want to send an event across the network, you have to broadcast a generic Global Event to every game object.  Every variable must be converted to a string and you must build a new string with the photon_ID and name of the game object within the photon game object sending the information, followed by the information sent. 

You then have to receive this information in a seperate game object that is enabled on every other client that breaks down the string back to the photon_ID and finds the child that sent it and also send to the correct FSM event by name with all the variables converted back from a string.

So, this all works but seems rather tedious and labor intensive and is getting very hard to keep in check. 

There are other options: "Self", "Game Object", "Game Object FSM", "FSM Component", "Host FSMs", and "Sub FSMs" but none of these work. 

Will it ever be possible to use these other options?  And will we ever be able to send non-string variables across the network instead of converting every variable to a string, or is this something beyond the Playmaker-Photon proxy?

Should it not be as easy as selecting "Game Object FSM" instead of "Broadcast" to send an event directly where you want to instead of taking so many extra steps, or am I missing something?

Thank you, sir.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon View RPC Broadcast Fsm Event -- Broadcast All only?
« Reply #4 on: July 28, 2016, 01:42:05 PM »
Hi

Indeed not at the moment, and without coding.

Basically, you can't send event to a particular gameobject over the network, unless it has a photonNetworkview component, ie your player. If you want to communicate via the photon network, the gameobject must be managed by the network and uniquely identified, abd the name isn't enough.

In your case, inthink your missing this very important concept of networkviews and hiw RPC work.

However, it's true that for now, you can only send a string, but this is something i can develop further for sure, but never was a show stopper, because you should keep daya being sent over the network minimalistic, to avoid taking up too much bandwidth and affect your gameplay.

Have you studied the sample provided on the wiki? It has a chat system, giving you a good workibg case on how event can be sent over the network and the various options.

Bye,

Jean