question

Rich Joslin avatar image
Rich Joslin asked

Special behavior per Character (abilities, dialog, etc)

I'm looking for some advice around using Cloud Script and PlayFab as a database to design how my Characters are going to work.

I've got several characters hardcoded into my Cloud Script, because I figure they don't need to be products. They are automatically granted to all players when they log into the game for the first time. I also have some characters set up as products because I intend to sell those.

I understand how I can store stats in Custom Data for each Character for each Player (once they own the character). So progression for each player's version of that character is pretty clear.

What I'm not sure of yet is where to store that character's dialog and special abilities. I know some special Cloud Script will be needed to process special abilities, but I'd rather not hardcode the relationships between the characters and the abilities. This is in case I want to give the same ability to two different characters, for instance. Or I want to change a spec on an ability and have it apply to everyone's instance of a character.

Would you recommend storing dialog and special abilities as Title Internal Data maybe? And I just decide how the JSON is structured and parse it as needed? Or is there something better?

10 |1200

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

brendan avatar image
brendan answered

It really depends upon your overall design goals. If you have a fixed set of data that you want to be able to share across multiple characters, then yes, storing it in Title Data could be the right approach. Alternately, if it's a lot of data, you may want to consider using the Content service for storage and distribution. Then, for assigning dialog to specific characters, you could just have a "Dialog" Key which is the array of Title Data Keys for the specific dialogs. Same for abilities. Is that basically what you have in mind?

10 |1200

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

Rich Joslin avatar image
Rich Joslin answered

Ahh, I'm not up to speed with the Content service - I'll look into it. Thanks!

10 |1200

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

Rich Joslin avatar image
Rich Joslin answered

Is there more info available about how to use the Content service than just the API docs?

What is the quota or limit for what I can upload, and is only one file allowed or multiple?  (I wasn't able to find it on the Limits page)

(Note that there is a 'more info' link in this page that goes to a 404.)

10 |1200

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

brendan avatar image
brendan answered

Simply put, it's a CDN. On the backend, we use AWS CloudFront for it, right now. So there really aren't any limits (outside the massive ones Amazon specifies), but I should point out that it isn't free. As with our hosted game servers, we pass on the cost for CDN usage at the AWS rate + 10% (to cover our costs).

Thanks for highlighting the 404, by the way - I'll get the tools team to fix that.

10 |1200

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

brendan avatar image
brendan answered

Here's the correct doc to use to learn more about using our Content service: https://playfab.com/blog/how-use-playfabs-content-management-api/

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.