RPC to specific players

Options
Hi all :)
Why there is no overload for the RPC method that supports players as target actors?
We can post data to all, the masterClient or one specific player.
There should be an overload for playerS as well.

Is there a specific reason for that? Or with other words, can I just create my own overload in the meanwhile.. will it work properly?

Greetings.

Comments

  • Tobias
    Tobias admin
    edited July 2016
    Options
    Edit: Just saw the "multiple players" requirement.

    While it's possible to do this in Photon, we don't think it's effective to send a message to multiple players. Due to that, it's not exposed in PUN RPCs.
    With the low number of players in PUN rooms, you don't gain much by sending a message to multiple targets, compared to sending it to all and having a few players ignore the incoming update.

    Can you describe what you want to do?
    Most likely, Interest Groups are more effective at what you want.
  • NickNack84
    Options
    Hi and thanks for the fast reply.
    What do you mean with: Low number of players in a PUN room? I see no player limit per room in the docs.

    The use case:
    I have an RPC "Attack" for example. This method executes an animation on all player targets.
    So I tried to send messages to only those players who are located near my player and can see the animation. I assume that 16 players in one room would be ok for the game, but one player will only see 2 - 3 players on the screen at once.

    I don't think that interest groups can help us in that use case.. Every player is running around in the room and has to decide which player is the nearest one. With other words, the plan was to send only messages to the nearest players and not to the others, because they are far away and not interested in animation executions. There are further RPCs that I would optimize that way, so the game doesn't exceed the 500 messages / s recommendation.
  • Tobias
    Options
    I still think that Interest Groups are OK for this. Each client defines in which groups it is interested. Each client sends attacks only into the current group (based on location) and the others see that based on their location/groups.
    You don't have to use that, though. Just an idea.

    Either modify PUN to accept a targetPlayers array or send the attack updates one by one to the players that you identify as interested.
    It's fine to modify PUN for your project.
  • NickNack84
    Options
    Ok thanks! ;)