question

Christian avatar image
Christian asked

Basic configuration help

Hi,

We are currently in the process of checking out backend services to consider creating a new game using one or another.

We have been thoroughly reading the documentation for the past 2 days and can't seem to fully understand some very very basic stuff here, perhaps I'm not bright enough these days but I thought I'd mention it here.

What have I understood from what I read? I understand there was a time when Playfab used to have a different model than the one that it's now being encouraged to use to all new titles. I understand the new model will be better in performance and usability. I don't believe the documentation clearly specifies what should and what should not be used, though. For instance: by checking the Player Data (Title) from the dashboard, whose name by the way already confuses me, I can see there are plenty of options in the submenu shown (Overview, ..., Characters, Inventory, Player Data (Title), ..., Objects, Files, ...). Would it be possible to add a "Deprecated" flag on the ones that you guys don't encourage to use here?

To follow with this, the very first Demo in the tutorial, fulfills the Player Data (Title) fields with JSON data in the INTERNAL DATA section such as ('equipment', 'hp' and 'maxHP'). After following the tutorial and documentation we end up in a page that suggests not to use Player Data (User Data?) and instead use Entity Objects. So we move on and start checking out Entity Objects, we end up creating an Object with some custom data in it (which is ok), but then we read that we are only allowed to have 3 objects at a size of 500 bytes, can you please ellaborate why should we use Objects? Especially when a few lines later in that very same tutorial, there's a code sample of a C# code loading/uploading files to the dashboard (which in this case can only take 1) and that file content can't be read from the dashboard (at least I haven't found the way to do so).

Our question is: could you please help me out understand how should I use each of the intended-to-be-used features in Playfab? In which case should we use Objects and in which case files? For instance, in our scenario, each player in the game has what we called "persistent data", which is basically the player standard data (lives, league, wins, loses, etc..). Where should we store that?

Also there will be information that should be shared across all players in the game, for instance, where should I save the data corresponding to the amount of times that a specific game level (or stage) has been played / won / lost? Or where should I store the information of the items that have been deleted by each player? (And more important, how to access/query that information?)

I'm sorry for the (very!) long post and please forgive me if I'm missing something very obvious. We'd really like giving Playfab a try but first we need to make sure everything is clear from our end to start the implementation and the current documentation is not helping us understand the steps to follow.

Thank you very much beforehand,

Chris

10 |1200

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

Citrus Yan avatar image
Citrus Yan answered

File contents attached to a player can be read from the “Files” option in that player’s dashboard:

Now, to answer your question:

-> could you please help me out understand how should I use each of the intended-to-be-used features in Playfab?

At the moment, for most of the features available in our legacy systems, we’d recommend sticking with the Classic Model (the Client/Server/Admin API set). For Data Services, we’d recommend that you utilize the Entity data services instead of Player Data (User data) as that will give the most flexibility and performance for your game. And, to be clear, this doesn’t mean that Player Data is therefore deprecated. Instead, I would prefer to say that it can be used in “parallel” to the entity data service, therefore, you can still use that if you want.

-> In which case should we use Objects and in which case files? For instance, in our scenario, each player in the game has what we called "persistent data", which is basically the player standard data (lives, league, wins, loses, etc..). Where should we store that?

Entity Objects suits this scenario better, you can store the “pesistent data ” in an Entity Object like this: {“lives”: xxx, “league”: xxx, “wins”: xxx, …}. Here is a thread that’ll help you understand the difference between Entity Objects and Entity Files: https://community.playfab.com/questions/18280/entity-objects-vs-entity-files.html

-> Also there will be information that should be shared across all players in the game, for instance, where should I save the data corresponding to the amount of times that a specific game level (or stage) has been played / won / lost?

Title Data is the way to store data which is intended to be accessed by all users, however, as the note says: “Title Data values are copied and distributed to potentially hundreds of machines in the PlayFab server cluster. As part of this process, Title Data is cached, and changes may take up to fifteen minutes to refresh in those caches.”, you’ll need to cache that data and update it in Title Data at a less frequent interval, for instance, in a daily manner.

-> Or where should I store the information of the items that have been deleted by each player? (And more important, how to access/query that information?)

You can store and access it in each player’s Entity Object, or Player Data if you want.


files.png (13.8 KiB)
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.

Christian avatar image Christian commented ·

Hi, thanks for your answer, I have replied to your post below because I didn't have enough room for my reply here. Thanks again

0 Likes 0 ·
Christian avatar image
Christian answered

Hi @Citrus Yan, thank you for your answer. I'm responding to your question in a separate answer, otherwise it exceeds the 1200 characters requirement. I will quote some of your responses for the sake of clarity:

-> File contents attached to a player can be read from the “Files” option in that player’s dashboard:

I see the files can be downloaded from there, but I meant there's no possible way of previewing them, probably because that section can handle any kind of file format, makes sense.

-> At the moment, for most of the features available in our legacy systems, we’d recommend sticking with the Classic Model (the Client/Server/Admin API set).

Not sure why the documentation says otherwise though, it recommends right the opposite. In our case, we are aiming to have quite a lot of traffic on this game so I believe it would be wise to avoid future problems and stick to the new system.

-> Entity Objects suits this scenario better, you can store the “pesistent data ” in an Entity Object like this: {“lives”: xxx, “league”: xxx, “wins”: xxx, …}.

We have tried storing the current profile like this but the dashboard will cut out the JSON in case it exceeds the maximum allowed (500 bytes) size. The current size of a very simple save.json profile now in our game is around 800 bytes - 1K, so I don't belive that's an option, we should then upload the json directly to the files section of each player and update the whole thing every time an attribute has been modified? I don't think that's quite performant to be honest but we will do it if you suggest us to do so. It looks like the player data (title) indeed should be the one handling this data but our concern is to have future issues regarding performance accessing this data now that the entities model is out.

-> Title Data is the way to store data which is intended to be accessed by all users

I see, that would be something like configuration json files for the game, understood.

-> You can store and access it in each player’s Entity Object, or Player Data if you want.

Finally, regarding this, due to the fact of only being able to have 1 file per player entity, how would I store this information if it keeps growing and doesn't fit either in one of the three available 500-byte limited Objects?

Also, we understand there's no cloud data here, so no collections available to query data from, but is there any possibility to re-create this kind of behaviour using your system? Could I for instance fill a table in my game which states random data located at the save.json files from each player without having to download the file of every player in the system and query their attributes?

10 |1200

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

Citrus Yan avatar image
Citrus Yan answered

Hi @Christian, I am replying your questions here:

->Not sure why the documentation says otherwise though, it recommends right the opposite.

This thread explaining Entity vs Classic might be helpful: https://community.playfab.com/questions/25819/entity-or-classic.html.

And, as a matter of fact, some new features are already adopting the entity model, for instance, Matchmaking, Groups, etc. For those features, you should adopt the entity model.

->The current size of a very simple save.json profile now in our game is around 800 bytes - 1K, so I don't belive that's an option, we should then upload the json directly to the files section of each player and update the whole thing every time an attribute has been modified?

The size of the Entity Objects can be customized for paid tiers, hence, my suggestion is that you first try using Player Data, and switch to Entity Objects if the performance doesn't meet your needs in the future (Player Data performs well enough under normal circumstances).

->how would I store this information if it keeps growing and doesn't fit either in one of the three available 500-byte limited Objects?

As mentioned before, these limits (number of objects, size of a object) can be customized for paid tiers, you can get more details in this page: https://playfab.com/contact/

->Could I for instance fill a table in my game which states random data located at the save.json files from each player without having to download the file of every player in the system and query their attributes?

Storing the attributes in the Entity Object for every player and use GetObjects to retrieve and query them sounds like a more performant way. Moreover, you can also use GetProfiles to retrieve multiple entities' profile in a single call, in this case, is the title_player_account entity.

10 |1200

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

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.