question

Fabiano Shiiti Marumo avatar image
Fabiano Shiiti Marumo asked

There is a way to save data per demand as global variable that all players can access?

Hi,

I plan to store the player replay every time the player finishes a game. All these replays should be accessible to all players.

I have 2 ideas, but I am not sure if they are viable using Playfab, so I will describe them:

1 - When a player finishes, he stores the replay in their own player data. So with Schedule task, I was planning to update the Title Data from time to time with all players replay and reset these replays in player data.

2 - When a player finishes, he stores the replay in their own player data. But, in this case, I also, maybe by cloudscript, to save the player Id in a title data from all player that finished a level.

So, when a player need x replays, I get x randoms players ids and get theirs replays.

What are the possible problems using each idea?

Title Datadata
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

Two key things to bear in mind:

1. Title Data must never be updated as a direct result of a player action. It is only designed for infrequent changes, specifically made by the developer/publisher. Using a Task to update it once an hour or day would be fine, but the question then is, what is it using to collect the data needed for that update?

2. You can certainly share data between players via Player Data (or Entity File), but do bear in mind that a) if there are many requests for a single piece of data (like a popular player), there will be delays in responses, and you may get timeouts, and b) each read of the data will tick the relevant meter (Profile Read, for Player Data) based on the total amount of data read.

But a simple way to share data for replays would be by using a standardized naming scheme, using the player's PlayFab ID as part of the name. So if players can have 3 replays stored, the keys might be "Replay_1_[PlayFab ID]", etc. That way, you wouldn't need to update Title Data for this, and you could just have players use leaderboard queries around their own score to get a set of other player IDs to randomly pick from.

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

Fabiano Shiiti Marumo avatar image Fabiano Shiiti Marumo commented ·

First, thanks for the Answer Brendan

I got your point.

But I am still in doubt about how to use the leaderboards.

For each level that I want to save a replay, will I have to create a new leaderboard?

Also, the limit of leaderboard in a free tier is 300, which is the same for a premium tier. Is that correct? (in other words, my limit for levels is 300?)

Last thing: When I get the leaderboard, I want the position the most randomly possible.

I checked this solution:

https://community.playfab.com/questions/38373/how-do-you-get-total-number-of-entries-in-a-leader.html.

Is this the only solution?

0 Likes 0 ·
Fabiano Shiiti Marumo avatar image Fabiano Shiiti Marumo Fabiano Shiiti Marumo commented ·

@Brendan Do you know the answer?

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.