How to hide the other avatar

Post here your questions about the OpenSpace 2.x or notify bugs and suggestions.

Moderators: Lapo, Bax

christina
Posts: 10
Joined: 26 Mar 2012, 02:53

How to hide the other avatar

Postby christina » 02 Nov 2012, 11:03

Hi,
When the avatar goes into a scene ( eg. a map), how to hide other avatar? It means that I cannot see other people and the other people also can't see me, but we are in the same room.

How to achieve this? I cannot find anything about this.

Thanks a lot!
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: How to hide the other avatar

Postby Bax » 05 Nov 2012, 09:30

Actually I don't get the point in hiding the other users in a multiplayer environment.

Anyway, the most clean solution would be to make each user join a separate Room to which no one else has access. Of course all those Rooms (one per user) will be different Room instances on the server, but sharing the same server-side code (for example the Room extension).

A much more simple solution would be to use the iOpenSpaceAPI.getAvatarById() method to access the Avatar instance of the other users, and hide them in some way (for example removing the inner sprites from the display list). We can't guarantee this is bulletproof, because of course the OpenSpace engine is intended to be used in multiplayer environments.
Paolo Bax
The SmartFoxServer Team
christina
Posts: 10
Joined: 26 Mar 2012, 02:53

Re: How to hide the other avatar

Postby christina » 05 Nov 2012, 10:28

Hi,
Thanks for your reply. But I don't understand about this suggestion:"hide them in some way (for example removing the inner sprites from the display list)".

How to achieve this? Could you provide the API for this?

Thanks!
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: How to hide the other avatar

Postby Bax » 05 Nov 2012, 11:25

There's no API for this. In general, your avatar should be an instance of a custom class which handles the graphics displayed on the screen.
You could add your own method to make the graphics not being displayed at all.
Paolo Bax
The SmartFoxServer Team
radiateur
Posts: 62
Joined: 15 Aug 2011, 08:14

Re: How to hide the other avatar

Postby radiateur » 17 Nov 2012, 11:03

Hi Christina,

i did this for performance purpose and to build an player "ignore list user" with a very simple function wich loop on mapload and map change and change the visibility property (no loss of performances).

Check my previous posts there's one where i wrote this function, and if you found a better way please give us your solution.

Return to “OpenSpace v2 discussions and help”

Who is online

Users browsing this forum: No registered users and 12 guests