question

Adam Sauer avatar image
Adam Sauer asked

Using playfab for a calendar in Unity

I'm building a 3D calendar system for AR/VR, and looking at using Playfab for the backend. I'm trying to use something akin to an inventory management system for storing a user's events. Playfab seems ideal as it handles authentication across platforms, although it doesn't seem as friendly to the idea of a user being able to edit objects in their inventory. I also want to be able to duplicate, and then modify groups of event objects. I've been exploring the user publisher data, entity, and item catalog systems, although none seem to call out as a solution that meets these needs super well. Can somebody more familiar with these systems please point me in the right direction? Thanks!

Title DataShared Group DatadataPlayer InventoryCharacter Data
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

·
Seth Du avatar image
Seth Du answered

>>A user being able to edit objects in their inventory

PlayFab support modify the access policy of Client API. You can disable any client API via editing API policy through UpdatePolicy API. In addition, to get the current policy configuration, you can use GetPolicy API.

There are two kinds of Policy on the PlayFab, for client API access policy, you may use the above two APIs, which cannot be reviewed in Game Manager, in terms of Entity Global Policy, and Group Policy, they are different from API policy. If you need any help on the usage, you can send another thread on the forum.

>> I also want to be able to duplicate, and then modify groups of event objects.

The data objects should be managed on the clients and every time the sync process should only update a packaged data(structured JSON) from the client. In terms of this kind of data, Player Data should be a good place for storage. If you want to maintain the events as items and want the users to duplicate or modify them. You can implement customized Cloud Script functions. However, PlayFab doesn’t support Incremental update and what you have stated about events feature is more like the upcoming feature UGC, which currently doesn’t have ETA.

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.

Adam Sauer avatar image Adam Sauer commented ·

Thanks @SethDu.

How would I store the structured JSON in Player Data? If it makes a difference, this would be cross-platform, so I would be using Publisher Player Data. Each calendar JSON event has about 20 or so key-value pairs, so would I package the JSON for each event into the "Value" of a key-value pair in the Player Data section?

The CloudScript looks like it could maybe serve my needs, but I'll have to do some more digging. In your opinion, since this isn't a game, does it still make sense to solve the problem this way versus creating a simple API server with a few request handlers? I'm new to PlayFab, and it seems like a lot of things I might not necessarily need. Just thinking out loud. Thanks

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Adam Sauer commented ·

PlayFab is a service based on RESTful API and is Platform-independent. You don't need to configure multiple PlayFab titles for different platforms. I am not sure what's your development environment, but you may use a single title for all builds of different platforms.

Publisher Player Data is aimed at a scenario, which is multiple titles(games) in the same studio, for example, you made SampleGame 1, where there are many players. Then your studio releases sampleGame 2 and wants to "inherit" the player's data partially from SampleGame1. Players will be able to login with their original account to sampleGame 2's studio without creating new account, and Publisher Player Data will be shared automatically. You can create another title in the same studio to testify it.

Cloud Script is for server side logic handle. The most common usage scenario is verification then calling server API, like grant items, change virtual currency, where is not a place for storage, because these functions are exposed to all players.

0 Likes 0 ·
Adam Sauer avatar image Adam Sauer Seth Du ♦ commented ·

I'm using Unity. My thought on using Publisher is because I may make very different versions of the experience per platform. Desktop would be different than Oculus Rift, and different still from Android, etc. I may create newer versions as well, but with the intent to maintain backwards compatibility in the event I stop making progress on a particular platform, or something to that effect.

Either way, like before, if Player Data is the way to go, then how to I do this, just cram each event object into the "Value" field of a key-value pair of Player Data? Is there not a way to just create a table, and upload rows of data to it?

0 Likes 0 ·
Show more comments
Adam Sauer avatar image Adam Sauer commented ·

Thanks @SethDu!

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.