question

Dan Nottingham avatar image
Dan Nottingham asked

Using Groups for follower/following relations

Hi, we're looking implement a player following system in our game. PlayerA can follow PlayerB to get notification about events from them (earning a high score, posting a piece of UGC, etc.). PlayerB also knows that PlayerA has followed them. They can look at their list of followers, follow back, block them, etc.

We're exploring whether Groups would be a good way to implement this feature. For each player, we would create two Groups: followed-by-player, and followers-of-player. But we want to make sure this will scale up to large numbers (we can imagine a popular player might have thousands+ of followers, or someone might follow thousands of other players).

Some questions about this:

  1. Are there any limits on group membership that would come in to play? Max number of groups you can belong to, max number of players in a group, etc.?
  2. In general, does this sound like a reasonable and scalable use of Groups?

Thanks,

-Dan Nottingham

entitieslimits
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

·
Ivan Cai avatar image
Ivan Cai answered

Firstly, you can navigate to the limits on the title settings and will find that the groups member count limit is 1000. So, groups do not support for thousands player members. I suggest you use playfab's friend system and it belongs to a one-way System. When player B trigger events, you can use rules to run cloudscript function that send notifications for followers. In the player B friend list, you can set followers as 'follower' tag for searching. If player A want to follow back player B, it is equivalent to player B call AddFriend to be player A friend and set tag 'followed' in player A friend list. If you want to learn more about friend system, please refer to this thread.

1 comment
10 |1200

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

Dan Nottingham avatar image Dan Nottingham commented ·

Thanks for the info! I wasn't aware of the limits page at the time, that's useful to see.

It looks like there isn't any limit on the number of Friends a player can have--is that true?

That said, how well will this solution scale up if a player has, say thousands of followers? Tens of thousands? Etc.? From what I understand, you can only query a player's entire friends list as an array, which seems like it could get expensive. We'd likely wrap this in an Azure function that would paginate the results, but each call to that function would still have to retrieve the entire friend list, and then filter it by the "follower"/"followed" tags...

0 Likes 0 ·

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.