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:
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!
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 | if (Input.GetKeyDown (KeyCode.Alpha9)) { |
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!
0
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 usingnew 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 usenew 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.0