playMaker

Author Topic: Photon, multiple RPC calls on the same network object  (Read 3133 times)

zorranco

  • Junior Playmaker
  • **
  • Posts: 50
Photon, multiple RPC calls on the same network object
« on: January 02, 2016, 07:22:43 AM »
Hello, we are testing how to develop an arcade shooter with photon.

To deal damage, we send an RPC to the player being hit. Let's supose that a lot of players are shooting the same player. The player being hit is processing an RPC, but this processing is (supposedly) somewhat slow. While processing, another RPC call arrives, so the current is canceled because the whole process starts again: the first RPC call is lost and damage is never dealt.

So, if I am not wrong, in this type of scenario (multiple RPC targeting the same network object) the RPCs calls must be somewhat buffered locally to ensure that no RPC is lost, right?

At the end, an RPC is not so different than a global event in playmaker. If a global event is called twice in a row, the first event gets lost. Locally this is easy to fix: a bool activated when the FSM is busy, so the FSM calling can wait. But this can't be done over the internet.
« Last Edit: January 02, 2016, 07:26:10 AM by zorranco »

zorranco

  • Junior Playmaker
  • **
  • Posts: 50
Re: Photon, multiple RPC calls on the same network object
« Reply #1 on: January 03, 2016, 04:44:59 AM »
Well, maybe this is not necessary...today I made a test, 3 objects raycasting the same player 100 times every frame, every raycast dealing 1 health point damage with a RPC "all via server"

Surprisingly, after some lagging (I suppose because of photon server sending all this RPCs) all hit points were recorded by the player, exactly 300.

Maybe...and only MAYBE :D my assumptions were wrong
« Last Edit: January 03, 2016, 05:13:49 AM by zorranco »