question

Dylan Powell avatar image
Dylan Powell asked

Saving a loadout to the cloud.

Hi all! I'm currently in the works of implementing a loadout system to my game, and I'm trying to figure out a way to save this data efficiently so that the player both can't cheat themselves in things they aren't supposed to have, and so that these integers actually save into the cloud and can be read back when the game opens and such. I figured storing this information in playerdata would be a good idea, but I can't find any documentation on how something like this would be done. Cheers ^^

2021-02-19-06-58-16.png

Player 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

Player Data on PlayFab will be a good solution to store those data. There are three types of Player Data:

  1. Player Data. The basic Player Data will allow clients to update by themselves. This resource is recommended to store less-important information of a player, like decoration equipment, personal signature text, etc. – GetUserData and UpdateUserData
  2. Player Read-Only Data. Clients can only read this resource, to update, it requires server API or Admin API. In the common scenario, developers will implement API calls in Cloud Script/Azure Function, however, please note that always adding verification steps before the data is update to prevent cheating.
  3. Player Internal Data. This is something invisible attributes of a player because they can not get or update via Client API. Normally it is used for server-side checking, for example, an internal flag for a low priority player to affect his matchmaking.

You may either store data as different KVP entries as PlayFab doesn’t have a limit of Key numbers, or construct a JSON and serialize it to a string to store in the value field of a single Key. Since the update of PlayFab is override update, to update a specific value, you may need to get the key value then modify the data. Incremental update is not natively supported. The former method will be more convenient when the data size grows.

To avoid cheating, the verification steps in Cloud Script/Azure Function will be the most important thing, there is no all-in-one solution, and it depends on the genre of your game. Necessary checking will avoid malicious update, but excessive inspections will take time and affect gaming experiences.

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.