question

Nick He avatar image
Nick He asked

Questions on storing a list of strings on PlayFab to be accessed by all users, or similar methods

Hello everyone! My question is as follows: Is there a way to store some sort of "server-synced" info on PlayFab that all players can access?

I'm intended to use this feature for room search, ex. a list of strings of room names is created and stored in the PlayFab database. Whenever a user creates a new room, a new string is updated to the list, and whenever a new room is deleted, that string is removed from the list. And whenever a user clicks refresh, that list is retrieved and presented to the user through local UI feedback.

So basically, the core idea is a list that can be accessed and edited by all players. (Preferably a string key + a list of strings as values)

I've done some research on this topic, and so far here are the possible solutions I found:

1) Create a special Playfab user and specifically use its player data for server-wide data storage, though this method is heavily not recommended.

2) Use some sort of real-time database, like Redis or Firebase. But it seems like Firebase only works for mobile, and Redis feels time-consuming to learn (sorry, the project is on a crunch ;-;!). In addition, the functionalities I'll be using will be very limited so they don't feel worth to learn... ;-;

3) Use some sort of HTTP protocol. But since my knowledge in web socketing is basically none, I would prefer to use some already-build client and database service with implemented methods ;D (Please lmk if you have any GOATED unity store assets <3)

If you have any similar experience on such topics or solutions that work the best, I really really do appreciate your help and support. Since I just simply need to store a list of strings, I would love to keep the process as simple as possible. Again, I just want to say thank you so much for reading through this post. Have an amazing day!

Player DatadatamultiplayerShared Group DataCharacter Data
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Nick He avatar image Nick He commented ·

Just did some more research, and it seems like Title Data could be a potential path, but I have some questions regarding it:

It seems like there's a limit on the amount of key-value pairs a user can add for the title data, and there is no categorization available, so I wonder if it's the most efficient method for storing different lists of strings for different purposes. Say, for example, if you want a list of voice chat names and a list of user room names, would it be better to create two key-value pairs and store the string array lists as the values for each key, and use array list methods to add/remove strings from the list? (Can you upload array list onto PlayFab?), or would it be better to create several key-value pairs, each with a unique identifying key to identify its type (but there's a limit tho)? ex. ROOM_1, ROOM_n, VOICE_1, VOICE_n, etc, so when the local user UI grabs data, it sorts the data type based on their prefix?

0 Likes 0 ·
Made Wang avatar image
Made Wang answered

To clarify, Title Data is suitable for storing global constants or static data, it is not suitable for storing global variables, when it is modified, there will be a delay of up to 15 minutes. And it doesn't support multiple writes concurrently.

Currently, what we recommend is to use an external database to store global variables.

Also, the lobby may be able to meet your needs, but it is still in a personal preview state, you can follow the official blog to get the latest news or you can refer to Building Lobbies with Azure PlayFab to implement it yourself.

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

Nick He avatar image Nick He commented ·

Thank you so much for the helpful information! My goal is to create two lists of available rooms for players to join: 1 for Video Chat, and 1 for rooms in general. I was thinking about using an external database to keep two lists of strings to join by room name, but lobby sounds like an interesting solution; I’ll definitely take a look! But just in case if I fail to understand it: is there any simple, external database that you’d recommend that might suit my needs? Thank you so much again for your time and help!

0 Likes 0 ·
Nick He avatar image Nick He commented ·

Actually I just found some robust data bases on the Unity Asset store. Have an amazing week!

0 Likes 0 ·
Nick He avatar image Nick He commented ·

Actually, never mind... they are mostly local servers. Is there any online external database you'd recommend? Thanks a lot ;D

0 Likes 0 ·
Made Wang avatar image Made Wang Nick He commented ·

I don't know much about databases and would recommend seeking some professional advice.

0 Likes 0 ·
Nick He avatar image
Nick He answered

@Made Wang Thank you so much for the helpful information! My goal is to create two lists of available rooms for players to join: 1 for Video Chat, and 1 for rooms in general. I was thinking about using an external database to keep two lists of strings to join by room name, but lobby sounds like an interesting solution; I’ll definitely take a look! But just in case if I fail to understand it: is there any simple, external database that you’d recommend that might suit my needs? Thank you so much again for your time and help!

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.