question

bealke avatar image
bealke asked

Representing relational data in Title Data,How to represent relational data in Title Data

What is the preferred method of having foreign key relations in Title Data? The system seems very limited to me when compared to an actual RDBMS.

Is the only solution to just have specific JSON tokens I will encounter that the client / cloud scripts can parse which will then lookup things in another key?

For example if I want to have a weapon that references abilities, stat boosts, element damages, and a rarity table I would need to resolve these references somehow.

Is Title Data not where this should be?

,
Title Datadata
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

·
brendan avatar image
brendan answered

Well, first and foremost, PlayFab is not a relational database service. Some of the most common issues that online games run into are due to the issues that occur with data systems at scale - especially when they use open queries (since one bad query can kill performance for the whole game). We provide services specifically designed to meet the needs of games, which can scale to any number of players.

What's usually best is to describe your game's needs at a high level - the gameplay itself, rather than specific implementations - so that we can help advise on the best ways to use PlayFab to achieve your goals. For example, when it comes to items, we would recommend storing all your global configuration elements - those that should be the same for all players, across all instances of the items - in the Catalog as CustomData or else in Title Data or the Content service, so that you can update it there, and have it be the same for all players. For customization of an item on a player, each inventory item instance also has a distinct CustomData that can be used to provide that level of extra information.

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.

bealke avatar image bealke commented ·

Thanks for the reply. I'm just evaluating playfab at the moment so I'm still new. I looked into Catalogs but I can't seem to find a way to add CustomData to an item on the website? The approach as you describe sounds like it will work just fine - I will try to find documentation for this.

At a very high level the gameplay of this game would be:

Player goes on quest, quests take X amount of time (30 minutes). After 30 minutes they would complete the quest and get some randomly generated items, let's say like 3 of them.

The server should be the authority on the items received and thus should do the generation.

I guess the complexity of the randomization is the sticky part.

0 Likes 0 ·
brendan avatar image brendan bealke commented ·

When you're editing items in the Catalog (in the Game Manager), it's in the lower right hand corner. You can edit Custom Data as a plain string (which it is, under the covers) or you can choose to edit it as JSON key/value pairs.

And no worries - what you describe is extremely simple in our service. We have Random Result Tables (also called Drop Tables in places) that get you the random loot drop. Just put items from your Catalog in one, set the weights for the randomization, and then you can either use EvaluateDropTable or put them in a Container or Bundle, and give that to the player.

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.