Networkculling - SetIntrestGroups/SetSendingEnabled not working

Options
Hello there,

in my current project i'm trying to implement a custom network-culling method. For this i wanted to use the given methods for setting intrest groups and specifying groups to which i actually want to send messages.

My problem with this is the following:
From what i understood from the documentation https://doc.photonengine.com/en-us/pun/current/gameplay/interestgroups setIntrestGroups simply subscribes my client to a given set of groups from which i am now able to recieve messages.(e.g. setIntrestGroups(null,new byte[0]) to subscribe to all groups)
The pendant of cause will specify to which group i am sending my messages. (e.g. SetSendingEnabled(null, new byte[]{1}) should now only send messaged to intrest group 1)

But for some reason this does not work. As soon as i set a different intrest group than 0 (default) there will be no updates/messages recieved at the other end.

This is the code i currently switch my sending groups:
 1
2
3
4
5
6
7
8
9
10
		if (Input.GetKeyDown (KeyCode.Alpha9)) {
PhotonNetwork.SetSendingEnabled (new byte[]{0}, new byte[]{1});
PhotonNetwork.SetInterestGroups (null, new byte[0]);
Debug.Log ("switch");
}
if (Input.GetKeyDown (KeyCode.Alpha8)) {
PhotonNetwork.SetSendingEnabled (new byte[]{1}, new byte[]{0});
PhotonNetwork.SetInterestGroups (new byte[]{1}, null);
Debug.Log ("switch2");
}


The next point that did not get clear for me from the doctumentation is: Do i set intrest groups per programm instance or per photonview?

If anyone has any insight for me on this issue i'd be really happy.
Thanks in advance!

Comments

  • Hi @Captain_Pineapple,

    But for some reason this does not work. As soon as i set a different intrest group than 0 (default) there will be no updates/messages recieved at the other end.


    Can you confirm that the receiver is subscribed to the certain group the other client sends a message in? Because you are using new byte[]{0} in the code snippets above, do you get any error message logged to the console? I'm asking because you can't unsubscribe from group 0 (default group). Please check if you wanted to use new byte[0] instead.

    Do i set intrest groups per programm instance or per photonview?


    Most likely per application instance as long as you don't use a second NetworkingPeer.