My game is multiplayer with a single map consisting of many cells with their own coordinates and variables. Those cells can be owned by players and updated when needed. (Clients will get the map information from Playfab and update it on their side once every minute or so, doesn't need to be real-time)
The problem is that I'm not sure what method should I use to store the map information in Playfab.
I have the idea of making a leaderboard of players with their owned cells and these cells' variables as the value. Then updating the corresponding leaderboard value when a player makes a change on the cell. (Then iterating through the leaderboard to get the whole map information)
That's the best idea I have on how to implement this but I'm not sure if there is a better and more optimized method.
Is there a better way of storing and updating global information like these?
Just realized you can't have JSON as a leaderboard value so my idea won't work; but the question is still relevant.
Answer by Sarah Zhang · Jul 29, 2021 at 08:48 AM
If about a dozen or fewer players will share one map, you can consider using Shared Group Data and CloudScript to implement it. This document -- Using Shared Group Data - PlayFab | Microsoft Docs contains the example of the turn-based multiplayer asynchronous games. If all players of your title will share one map, as you said, it will be the global variable of the title. Currently, PlayFab doesn’t provide the feature to handle the global variables. For this case, we would suggest you use the external cache, such as the Azure Cache for Redis, to handle such global data.
What happens after I overstep the free limit of updates per user 1 Answer
GetUserData vs GetPlayerProfile ? why Different 1 Answer
Amount of data max storage for persistent turn based game 1 Answer
How to acces other player's data values using EntitId(Player ID (title)) 1 Answer
Is it possible with PlayFab to host the data only in the EU / a certain country (not the US)? 1 Answer