playMaker

Author Topic: Sending other Variables with Photon RPCs and PlayMaker  (Read 2273 times)

piddau

  • Playmaker Newbie
  • *
  • Posts: 2
Sending other Variables with Photon RPCs and PlayMaker
« on: September 26, 2013, 04:16:57 AM »
Hello!

I am working on a simple project to try to learn how Playmaker works, this includes with Photon and other add-ons I have. So far I have not ran in to many problems, I have one issue though, I know how to solve it, but was wondering if there is a better solution that I just dont know how to do in Playmaker yet?

I want the player to click the mouse somewhere in the gamespace, and when the user does this he shoots a bullet towards that position. This could be created with a simple state that calls Photon Instanciate, but that probably wont be too efficient later on when there are hundreds of bullets flying around etc.

So what I want to do is create an RPC that tells the other users to create a local shot at this and that position.

Now the way I know I could do that is that I just extend the PhotonGameObjectProxy script to add more RPCs to handle what I need. (This is what I would like to avoid)

Is there some other way where I don't have to change any code to do this?
Can I somehow attach Vectors to an Event and send that along straight from PlayMaker?

BTW, love what I can achieve with PlayMaker so far :)

Best wishes
Peter Oldhammer

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Sending other Variables with Photon RPCs and PlayMaker
« Reply #1 on: September 26, 2013, 06:59:17 AM »
Hi,

 You basically only have these two mechanisms.

 However, I can definitly add more signatures  to RPC and allow you to send a vector instead of a string. This basically is what you want to avoid doing, but I am not sure there is a better way.

 is it because you don't want to script? or is there something else bothering you with this RPC technic to begin with?



bye,

 Jean

piddau

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Sending other Variables with Photon RPCs and PlayMaker
« Reply #2 on: September 26, 2013, 09:04:56 AM »
Coming from a coding background I really just want to see how far I can bend PlayMaker before it "breaks" :) I dont mind to code it on my own so its usable in PlayMaker.

I'm just trying to think in PlayMaker terms.

Then I'll just go ahead and code it myself, thanks for clarifying it!


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Sending other Variables with Photon RPCs and PlayMaker
« Reply #3 on: September 26, 2013, 02:50:59 PM »
Hi,

 PlayMaker "only" glue your actions together, what is in actions and what are in bridges such as the photon bridge will not perform better or worse than usual, they are subjects to the same rules and pitfalls as if PlayMaker would not be in the loop.

so in your case, you have to be careful with the number of events you want to tackle. You may find that instanciating a networked impact object that is simply a particle or a blood splat may very well perform better than if you try to first do a RPC, and then instanciate manually on each running instance.

 I am speculating, but this is to show that the problem could be elsewhere potentially, especially in your description. you may want to also look at not passing all impacts. It's like soundtrack and sound effects in films, they do not try to reproduce the sound of everything that is actually happening on screen, instead they give you a mood and accentuate vey precise sounds to make it clean. The same would apply here, if you have 20 players fires at will... maybe you should not try to repro every bullet over the network. Maybe you could have an rpc even "FIRE STARTED" and another event "FIRE STOPPED", and in between each running instance actually does it's own firing system, no need to think everysingle bullet fired, instead only make it looks like it's firing. In case of rockets and bombs, that's a different deal, but you don't fire 5 rockets every sec...


what's important is the result of the firing, if USER A doesn't get the exact amount of bullet fired by USE B, no big deal. what's important is that if USER B hits another USER, it's processed properly, and why not fire the bullet then for sure following the "HIT" event, not the "FIRE" event.

 I hope I am explaining myself clearly here :)

bye,

 Jean

Bye,

 Jean