question

Dale Strickler avatar image
Dale Strickler asked

Recycle or reconstruct Group Entities for tournaments?

My current thinking is that for multiplayer tournaments that last 2 to 10 minutes, I would associate the competing players via a Group Entity. Then when the tournament is over the Group Entity data is useless.

At this point I see two possible approaches:

1. Just delete the Group Entity when the tournament ends. Create new for a new tournament.

2. Keep a pool of Group Entities and recycle them. When a tournament ends I clean the Group Entity and put it into an available pool that supplies recycled Group Entities as new tournaments start.

It seems like 2. would be less overhead on the systems (no allocate/delete). But, I can image a lot of factors that could come into play, many of which I could be unaware.

entities
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

·
JayZuo avatar image
JayZuo answered

May I know why you want to use Group Entity here? For multiplayer tournaments, maybe you can use Matchmaking (Private Preview).

And for Group Entity, I'd think you can just delete it when the tournament ends. As for now, you can't list all existing group entities, see https://community.playfab.com/answers/25653/view.html. So it might be hard to keep a pool of group entities.

5 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.

software1103 avatar image software1103 commented ·

Hi, @JayZuo

I also have a question about the tournament.

Is the multiplayer tournament that you mentioned the same with the tournament that is referred in the poker game?

I am absolute new to this part so I don't know at all.

Thanks...

0 Likes 0 ·
JayZuo avatar image JayZuo ♦ software1103 commented ·

I'm not sure what you mean "the tournament in the poker game", I'd suggest you check the tutorial: https://api.playfab.com/docs/tutorials/landing-tournaments/ to see if it meets your requirement.

0 Likes 0 ·
Dale Strickler avatar image Dale Strickler commented ·

It seems my use of the word "tournament" sidetracked my question. What I am trying to understand is the relative costs (performance, storage, other?) of created new Group Entities vs. recycling them. It seems like recycling them is better but maybe the cost of creating and destroying is low enough that it is not an issue. The coding is simpler to create and destroy. I was involved in a project a long time ago where recycling allocated storage was a major performance win over create/destroy. I just wanted to get a sense of PlayFab's interworkings to see if, in a modern world, the extra code to recycle was enough of a performance boost to be worth doing.

0 Likes 0 ·
brendan avatar image brendan Dale Strickler commented ·

The short answer is that it's a minor impact, so feel free to do it the way that's simplest - delete the groups when you're done, and create them as you need them.

0 Likes 0 ·
Dale Strickler avatar image Dale Strickler brendan commented ·

Super! Thanks.

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.