Good day everyone,
I'm getting a bit lost in all the different ways PlayFab saves data.
If anyone has an overview, I would very much appreciate it if they could quickly tell me where each of the following should go.
Our game has, similar to Apex Legends or Fortnite, a SeasonPass with customizations.
These can be characters, hats, emotes, skins and more.
I saw that I can have a store of sorts for our ingame-store. That is fine, however how do I realize the following concepts:
- Season Pass Data
-- Has to match a specific timeframe (e.g. 1st May to 1st June)
-- Static Data, Read-Only, set by the Developers
-- Is a complex Json Object with multiple fields in field
- Optained customizations of the player
-- Via Season Pass or Store
-- Can maybe stack in the future
-- Read-Only!
- Currently equipted items/loadout
-- Read-Only!
-- Should be adjusted via custom CloudScript to "equip" items.
This would ultimately check if the player owns the item before equipping it.
-- Other players might need to be able to retrieve the data too.
- Experience and Level
-- Of the SeasonPass
-- Of the Player
-- Read-Only!
As you can see the data has to be read-only for clients at all times. Now I saw that most of the stuff you can do in PlayFab has a Read-Only version, which is good. I also assume that the "Optained customizations" can go into the "UserInventory", however how does one stack these if wanted (Hat XY optained 3 times)?
Furthermore, what is the difference between PlayerData and PlayerStatistics?
Should I save XP and Level in the Data or Statistics? I saw both already while searching the forums.
Then I thought I could use the PlayerData (Read-Only) for the current loadout, but I struggle to see how I can retrieve these. I want to save an object of an array, something like this:
Controllers = [{ "custom_drone" : "custom_drone_daze", "custom_hat" : "custom_hat_hatless", "custom_trail" : "custom_trail_fire", "custom_material" : "custom_material_chrome", "custom_color" : "custom_color_white", "custom_brightness" : 1.0, },{ "custom_drone" : "custom_drone_daze", "custom_hat" : "custom_hat_hatless", "custom_trail" : "custom_trail_fire", "custom_material" : "custom_material_chrome", "custom_color" : "custom_color_white", "custom_brightness" : 1.0, },{ "custom_drone" : "custom_drone_daze", "custom_hat" : "custom_hat_hatless", "custom_trail" : "custom_trail_fire", "custom_material" : "custom_material_chrome", "custom_color" : "custom_color_white", "custom_brightness" : 1.0, },{ "custom_drone" : "custom_drone_daze", "custom_hat" : "custom_hat_hatless", "custom_trail" : "custom_trail_fire", "custom_material" : "custom_material_chrome", "custom_color" : "custom_color_white", "custom_brightness" : 1.0, }]
This is basically an array for 4 splitscreen players and their loadout.
Set through CloudScript and Read-Only for Clients.
Looking into the API for "GetUserReadOnlyData" tells me it ultimately returns a "UserDataRecord" in a Dictionary which seems to only have one "Value" field of type "String". That doesn't really seem to support JsonObjects, or?
So yeah, I'm pretty lost at what to use here. I would love to just have one single PlayerData concept where I can save every sort of JsonObject I can come up with, which is at the same time Read-Only for clients.
Cheers,
Cedric