How to get a list of connected players in a world?

Is there a way to get a list of players in the world? and/or a player count? ie: we may want to show worlds that are close to being full, and also we want to avoid the player choosing a team that has too many players on it.

We have a Lobbies system meant for this sort of metadata. If you’d like to attach metadata to your game sessions, like teams, and assign players to teams etc. you can use a lobby to accomplish that: Lobbies | coherence Documentation

Do lobbies support persistent worlds? if so what’s the difference between the lobbies and worlds?

Lobbies are not related to a replication server and are just a data layer you can interact with with the SDK.

You can use a lobby to manage metadata about the current state of a world or room.

If you’d like to outline at a high level what you’re trying to accomplish we can suggest some implementation plans with out tech

Hey JJ! (from Mythical City Games, right? :slight_smile: )

Check out this page: Rooms and Worlds | coherence Documentation

I think it would be useful to understand the difference.

Yes, that’s right :slight_smile: thanks, I will review this!

1 Like

Great. To add some more stuff, I also wanted to mention about the existence of ClientConnections: Client Connections | coherence Documentation

In short, ClientConnections are network entities that are visible to all connected Clients (and Simulator), whose lifetime is managed by coherence. So a Client connects, a CC is created, when they disconnect, it’s destroyed.

And so you can understand that if you connect to a World (or Room), you can use CCs to “see” all connected players, regarding of where their character is in space. This allows to do things like display clans, teams, and send messages to each other.

However, CCs are only available after you are also connected to the Room or World, so you’re counting against the maximum limit of that space too. If you want to maintain a more lightweight space where clients can see each other, matchmake, chat, before they join a Room or World, that’s what Lobbies are for.

Hope it helps, but in any case it’s pretty much what’s in the docs.

Awesome, thank you! This is helpful indeed.

2 Likes