question

David Lindskog avatar image
David Lindskog asked

Avatars as inventory items

Hi!

I would like to have a system where the player gets to choose from a couple of predefined avatars including their FB pic (if they have linked their FB account).

I was thinking that I could have all the avatar pictures in the game and save them as ints in a dictionary.

Then I only had to get the kvp from the players player data for displaying in various places like leader boards and stuff. Except for the FB pic of course.

But I also wan't to be able to reward players that reach a specific level or gets an achievement. Or straight up buys an avatar pack from the store. Is player data safe enough?

Or can I pair an inventory item in some way?

To be clear, I don't want to store the avatars in a bunch of URL:s.

Any suggestions?

Player DataLeaderboards and StatisticsPlayer Inventory
10 |1200

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

Citrus Yan avatar image
Citrus Yan answered

So you want to encode avatar pictures into ints and save them directly into player data, is that correct? In that case, I want to remind you that the default Player data value size is 10,000 bytes, hence you’ll need to make sure that the avatars’ sizes won’t exceed that limit.

Read-only player data should be safe enough for your use case, which only the sever can modify but the client can only read. And, you can pair an inventory item to a specific avatar, however, since you are not using URLs to store the avatars and the default size for a catalog item custom data value (1000 bytes) may not be enough to directly store the raw avatar data, therefore, you may need to maintain a look-up table of avatars for the inventory items to refer to, this could be done using Title Data.

10 |1200

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

David Lindskog avatar image
David Lindskog answered

No no, I just want to pass an int via Playfab. All the avatar pics is already in the build. So when the a leaderboard shows the result I swap that int to a picture via a dictionary.

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.

Error rendering WebPanel (widgets/consolidation-widget.ftl): org.hibernate.hql.internal.ast.QuerySyntaxException: AvailableConsolidation is not mapped [from AvailableConsolidation up where up.node = :node]