question

zeffy avatar image
zeffy asked

Storing "large" data in character data ?

Hello !

I'm facing a little problem in creating one of the parts of my game. My players can create custom characters (i'm using Unity's asset UMA to do this). They create their own character, change a few sliders, update colors... a few basics things.

When they hit "create", i turn their avatar to a json string that is around 3000 bytes (3255 in my last test) and I would like to be able to store it somewhere. I thought that I could store it as a character data, make it public and let everyone read it when player see each other ; problem is that character data allow only 1000 bytes, so it cannot store the json string.

Is there a way to increase this limit in my settings ? Or somewhere else to store this ? I could also split the json and then join it latter but it doesn't feel like a "good" way to do this, and creating a database only for this feel a bit overkill :/

Thank you !

Zeffy

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

1 Answer

·
Alex Taras avatar image
Alex Taras answered

Hi Zeffy,

I don't know how much data you have for character, but 3000 bytes seems a lot for what you mentioned.

What you can do to reduce overhead is use enums instead of strings in your Json. ("Hair"="Black" -> HairColor.Black = 0, and only store the "0", convert "Hair"="Black" to "h"="0" for example)

Also, you can compress the Json even further by combining values of known length into a single variable using string.format()

("strength" = "10", "agility" = "12", "intelligence" = "19" -> "d" = "010012019" and cap the max value at 999 for those attributes)

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.

JayZuo avatar image JayZuo ♦ commented ·

@Zeffy If you still need to increase this limit, you can go to "Settings" → " Limits" → "Character data value size" , there are several plans you can choose.

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.