question

yogev avatar image
yogev asked

When should I save player Proggresion?

Hey, I am working on a game like candy crush and I am thinking on how to save the level progression

Now I am saving it locally and online the first way that I thought of doing it was when the player finished a level it would invoke the azure function and I would get the current player level and just up it by one level but is this the best way to do it? would it create too many calls 1 per level x 150 levels (maybe more in future) ?

And should I use UserReadOnlyData then UpdateUserDataRequest? is it

and will GetPlayerCombinedInfoRequestParams - GetUserData will get the readonlydata

Another question about the recharge rate of currency If I want it to give 1 heart per 5 minutes and the max is 5 hearts what do I need to set as a recharge rate? how does it work? I have read a few posts is 1435 the correct number?

apis
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

·
Neils Shi avatar image
Neils Shi answered

Now I am saving it locally and online the first way that I thought of doing it was when the player finished a level it would invoke the azure function and I would get the current player level and just up it by one level but is this the best way to do it? would it create too many calls 1 per level x 150 levels (maybe more in future) ?

In order to improve the security of the game, it's a good idea to call Azure functions at the end of each level to check and update the level info, and I don't think it's a lot of calls if players only call Azure Function once at the end of each level.

And should I use UserReadOnlyData then UpdateUserDataRequest? is it and will GetPlayerCombinedInfoRequestParams - GetUserData will get the readonlydata?

Yes, you can store level info in the user's read only data. And if you set the parameter “GetUserData” to true in the request body of API GetPlayerCombinedInfo, it will only return user data instead of user read only data. However, there is another parameter “GetUserReadOnlyData”, you can set it to true, and then you can get user read only data.

If I want it to give 1 heart per 5 minutes and the max is 5 hearts what do I need to set as a recharge rate? how does it work? I have read a few posts is 1435 the correct number?

As Manage Virtual Currencies in Economy (Legacy) - PlayFab | Microsoft Learn mentions that, recharge rate will specify how much of this virtual currency is granted to each player per day. Virtual currency that is granted to the player via a recharge rate is granted to them gradually, and is evenly distributed over a 24 hour period. So, if you want to give 1 heart per 5 minutes and the max is 5 hearts, then you should set “Recharge rate (units per day)” to 288, and set “Recharge maximum” to 5.

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.

yogev avatar image yogev commented ·

Thank you !!

does the player have the ability to invoke the function somehow? like code injection or something? because if yes they can cheat the system how should I protect myself from this? because I only invoke it after the end of the level and on the Azure function I am not checking anything

0 Likes 0 ·
Neils Shi avatar image Neils Shi yogev commented ·

If you just write a script that directly level up the player by one level without checking, then player may call this Azure Function elsewhere and easily cheat. Usually, developers need to implement the necessary check logic into the script to prevent cheating.

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.