Can't remove Player from Group

68 views
Skip to first unread message

Andrew Meyer

unread,
Oct 15, 2012, 11:58:49 AM10/15/12
to unitypa...@googlegroups.com
I'm not sure if I'm understanding the function completely.

Version:
1.3.0-beta5 Lina (2012-10-02)

What I'm doing:
I instantiate a few objects with group id of "2".
I set the groups flag as follows:
uLink.Network.SetGroupFlags([networkGroup], uLink.NetworkGroupFlags.HideGameObjects);
Later in the script (after a player has been added to a group), I call the function:
uLink.Network.RemovePlayerFromGroup

Expected Result:
To remove that player from the group and send commands to player to destroy the networkviews within that group.

Actual Result:
I receive the error "Can't remove Client 1 from Group 2 because player still has 2 object(s) in that group." on the server.

Goal:
My goal here is to setup a "cull" in a sense, so that a particular player doesn't have certain objects instantiated (and taking up memory) if they are too far away. We have a whole lot of objects that load into memory, and I was hoping to use "groups" to reduce the amount of memory the client is loading, and at the same time eliminate the network traffic for those particular (mostly static) objects altogether unless they are within viewing distance.


Is this a bug, or did I misunderstand the function of groups?


Aidin Abedi

unread,
Oct 15, 2012, 4:14:24 PM10/15/12
to unitypa...@googlegroups.com
Hello Andrew

This is not a bug. Groups and Owers are implicitly coupled together, so when you instantiate a object (in a group) - the owner will implicitly be a member of that group until all his/her objects (in the group) are destroyed. One of the design goal is to not have to use AddPlayerToGroup or RemovePlayerToGroup explicitly, for most use cases.

We're very eager to know more about your use case. Could you please describe it in more detail? What purpose does the far away player objects have in the game? If you don't wish to disclose this information in the mailing list, you can send me a private email.


Sincerely,
Aidin

--
 
 

Andrew Meyer

unread,
Oct 15, 2012, 4:36:43 PM10/15/12
to unitypa...@googlegroups.com
The server ("uLink.NetworkPlayer.server") is set as the owner of all the grouped objects. Should it still behave that way?

I apologize, I'm a bit new to Google Groups, where do I find your email at?

Aidin Abedi

unread,
Oct 15, 2012, 4:48:46 PM10/15/12
to unitypa...@googlegroups.com
If a client does not own any objects in a group, then you can remove him/her using RemovePlayerFromGroup. Did you use AddPlayerToGroup when adding the client? If this is the case, then I'll need a unity project to reproduce the issue.

My email is: aidin.abedi at muchdifferent.com

--
 
 

Andrew Meyer

unread,
Oct 15, 2012, 6:27:01 PM10/15/12
to unitypa...@googlegroups.com
I've attached a very basic example.

Creates a group of objects with owner as server, and toggles add/remove.

It will display the error when it tried to remove the player from the group.
uLinkGroupsTest.zip

Aidin Abedi

unread,
Oct 18, 2012, 5:40:21 PM10/18/12
to unitypa...@googlegroups.com
Hello Andrew!

Thank you for reporting this and sending the project. Sorry for the late response. We've fixed the issue and verified that it works. The fix will be part of the upcoming final uLink 1.3 release,  but we've also made a custom build for you and others on the mailing list - which includes the fix along with all other improvements that will come.

Sincerely,
Aidin

--
 
 

uLink 1.3.0-custom10 Lina (2012-10-18).unitypackage

Andrew Meyer

unread,
Oct 18, 2012, 6:15:48 PM10/18/12
to unitypa...@googlegroups.com
Thank you for the prompt fix, we are eager to get this implemented.

:)

Andrew Meyer

unread,
Oct 22, 2012, 10:34:41 AM10/22/12
to unitypa...@googlegroups.com
There seems to be an issue with custom 10 release.

The "uLink.NetworkPlayerApproval" no longer contains a definition for "Pending()".

Andrew Meyer

unread,
Oct 22, 2012, 10:54:02 AM10/22/12
to unitypa...@googlegroups.com
Custom 11 also doesn't have the "Pending" definition for "uLink.NetworkPlayerApproval".

Aidin Abedi

unread,
Oct 22, 2012, 2:01:58 PM10/22/12
to unitypa...@googlegroups.com
Hello Andrew,

Pending() has been renamed to Wait() to be more consistent with Unity's use of the term Wait, but also because Approve(), Deny() and the rest of uLink's API methods are all verbs. A obsolete attribute was not kept because Pending() had only been added during the beta phase. Obviously we should have mentioned this, we're sorry for the inconvenience and will add a obsolete attribute in upcoming final release.

Sincerely,
Aidin

--
 
 

Reply all
Reply to author
Forward
0 new messages