Setting PhotonView.group increases message rate

Hi,
I am trying to implement mmo sample. My game has players and mobs (scene objects). If I understood correctly, interest groups work like this:
player sets interest groups
then he sets his PhotonView.group to server knows from what group data is sent
then if message is sent from photonView with group that is one of interest groups - server sends message to players that are interested in this group

So on my scene object mobs I set their groups similar to players :

orderIndex = (++orderIndex % cullArea.SUBDIVISION_SECOND_LEVEL_ORDER.Length);
pView.group = activeCells[cullArea.SUBDIVISION_SECOND_LEVEL_ORDER[orderIndex]];

Without mobs settings their PhotonView.group - the send rate is 11 messages/sec. (all are in group 0)
But after I use the code above - rate jumps to like 50 messages/sec.

What am I missing?

Thank you

Comments

  • Hi @webmonch,

    then he sets his PhotonView.group to server knows from what group data is sent


    This is wrong: the server only knows the subscriptions to certain Interest Groups of certain clients in order to forward messages correctly. The 'group' variable just describes, to which Interest Group the next message is sent to. For example: if the 'group' value is 1, all messages from this certain PhotonView are sent to group 1 (until the value get changed).

    Without mobs settings their PhotonView.group - the send rate is 11 messages/sec. (all are in group 0)
    But after I use the code above - rate jumps to like 50 messages/sec.


    I guess this is because of the changed 'group' variable of the PhotonView component. If you don't change the group and don't update the object as well, PUN won't send a new message as far as I know. If you change the group (what you actually do when adding the NetworkCullingHandler component), this behaviour might be different. Please note: the network culling solution that is included in the PUN package is not for optimizing the sending behaviour of a client, but the receiving behaviour of a client because messages get filtered and forwarded by the server.
Sign In or Register to comment.