question

Thomas LAURENT avatar image
Thomas LAURENT asked

Best way to Load Title Data when not Logged

In our game we have a loading screen which loads static data (stored in Title Data) which once done ask the player to login, which then loads player data (stored in Player Data).


This brings me to the question : "How do I load my static data without being logged?"

Since it's only a GET on a title wide data I hoped it didn't need the client to be logged but I was wrong.

Here are solutions that came to my mind:

  • Is using a specific policy allowing the GetTitleData request to be fetched from a Client with HasSignatureOrEncryption set to false the best way?
  • Do I need to login the player temporarily to get that static data before logging him again?

Do you know if there is a better solution or which of the ones I gave is the "less bad"

Title DataAuthenticationPlayStream
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

The thing is that players have to log in so that they can access PlayFab Service. You can either have a launcher specifically for authentication and loading information before the game is started, otherwise, there should be a shared public player account that will be used only when a player is not logged in.

6 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.

Thomas LAURENT avatar image Thomas LAURENT commented ·

"You can either have a launcher specifically for authentication and loading information before the game is started"
I don't get it, you suggest to require authentication right at the start of the game then do the loading?
That's not how most of the game I saw work, they usually load all static stuffs with a loading screen listing what's being loaded (it takes time because it's often things like packages containing textures and videos) before getting to a title screen with the "tap to play" which authenticates the player. And finally when the player tap this screen or since when the screen popped the game loads player related stuffs.

Postponing the static data load to the title screen will break the player experience in my opinion which we want to avoid.

I precise it's for a mobile game

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Thomas LAURENT commented ·

>>they usually load all static stuffs with a loading screen listing what's being loaded

This scenario is that they download resources files or updated packages from external CDN service or external package management service, which is not the common usage scenario of Title Data. Title Data provides global variables or configurations. It will be difficult to store resources files there due to the limit and format(it only accepts KVP).

Here is an example. We have a game with progressive check-in rewarding feature. An entry in Title Data stores a table that contains rewarded items for different progresses. Hence, the Cloud Script functions can read the table from Title Data to know which item should be granted to this player. You may refer to this sample: https://github.com/PlayFab/PlayFab-Samples/tree/master/Recipes/ProgressiveRewards

Please also understand that if you are using PlayFab CDN to distribute resources files, the authentication is still necessary to prevent abusive uses because CDN service is charged by network traffic.

1 Like 1 ·
Thomas LAURENT avatar image Thomas LAURENT Seth Du ♦ commented ·

Our TitleData kind of content is pretty similar to your example (btw thanks for this valuable resource), the only difference is we are caching these Title Data when the game loads so the client don't have to make a request each time it needs a value from it (for example when loading items shipped in our shop, rewards for a level completion, etc).

So instead of doing several read-only requests with the server our clients only make one big read-only request at game launch reducing interactions with the server to its minimum (btw do you think it's a good design for working with your API?).

From what you've said I now think of this solution :

  1. At game launch, loads static data (not resources like prefabs, textures, etc.) using "LoginWithCustomID" with a "Generic" CustomId to do the GetTitleData request
  2. Loads the player with it's own account
  3. Loads the player data using GetUserReadOnlyData

Do you think it fits well with what PlayFab was designed for?

0 Likes 0 ·
Show more comments
Show more comments

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.