question

Canberk Soner avatar image
Canberk Soner asked

Entity Groups of Entity Groups?

Hey,

I'm not sure if this is a dumb idea so here I am :) We intend to use entity groups for chat rooms. Chat itself is done by another service, but that service does not support any kind of data storage so I have to track chat room states in PlayFab.

The problem is, there is no API to search for specific entity groups, or even getting all groups via PlayFab. In related questions it was suggested to use another persistent data storage to track this.

Now, my question is: Are entity groups themselves entities too? If so, can I make a group of entity groups? Then I can simply get members of this parent group to know which groups (chat rooms) are currently active and their related data.

What do you think of this approach?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

The problem that causes is that you'd have every player in your game (potentially millions) all using a single Entity Group. The Group system is designed as a way to provide for guilds/teams/clans - systems where you have upwards of 1,000 players. It is not an in-memory data system like Redis, and so does not support having massive numbers of players all querying/updating a single one. You'll really need to use an external data system if you want to have any form of data where every player in the game needs to query or update a single data source.

7 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Canberk Soner avatar image Canberk Soner commented ·

Hey Brendan,

To clarify, my intention was not having every player in the game in a single group. I wanted to store a group that stores other created groups.

My idea was a structure like this:

ChatRoom1: Is an entity group. PlayerA and PlayerB join this group.

ChatRoom2: Is an entity group. PlayerC and PlayerD join this group.

ChatRoomList: Is an entity group. When ChatRoom1 and ChatRoom2 are created, they "join" this group, but their players do not. So this "ChatRoomList" contains the entities "ChatRoom1" and "ChatRoom2", but not PlayerA, B etc.

Of course I'm writing this under the assumption that groups themselves are entities too.

This won't be updated by "every" player, but rather only when someone creates a chat room. We don't intend to use chat rooms for small channels, so we won't have more than 1000 chat rooms joining this ChatRoomList group.

But the members of this ChatRoomList will be requested by every player. So every player won't be updating it, but reading it. I guess this is a problem too?

In a comment, I saw a solution by a user where they create a player on playfab side and use the player's data stores (either player data or entity files I guess?) to store this master list.

0 Likes 0 ·
brendan avatar image brendan Canberk Soner commented ·

Yes, my point is not about membership of groups - it's about reading or updating that group. In your design, every player in your game would be reading ChatRoomList, which isn't supported.

0 Likes 0 ·
brendan avatar image brendan Canberk Soner commented ·

Quick follow-up: Using player data for that is much worse. Player data is designed to be the data store for a single player. A version of it - Shared Group Data - was created to allow for sharing data between a very small number of players (a dozen or less), and specifically only for turn-based games, so that there's no write contention. If you could please link the comment you saw about using player data that way, I'd appreciate it. They need to be informed that we cannot support that.

0 Likes 0 ·
Canberk Soner avatar image Canberk Soner brendan commented ·

Hey, turns out I misread that comment (also it is a few years old):

https://community.playfab.com/comments/34871/view.html

Apparently they're adding that dummy admin player as a member to all the groups they want to track, and then get group memberships of that player to read the list of available groups.

Is that still a bad idea? How many groups can a player safely join?

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.