hi!!!
( I need to reduce the save data string size Due to server cost )

I am currently saving Ork's save data on the server.
After converting the final dataobject to json, the entire string is stored in one key.

However, the size of the string seems to be very large.

In particular, the size of the "baseDevSV" key occupies about 34000 bytes.

my game scenario :
My player grows using status development, max level 200.
and has about 100 statusValues.
when i saw savedata string file it seems Each statusDev level also has about 100 statusValues
( this is problem, see donwmost unnecessary string )

The first thing to ask is,
When the player Combatant is first summoned, is the editor's statusDevelopment copied and used ?
(Is a copy? rather than just a reference? why?)
if so,
When the player statusDevelopment is changed due to an update during live servicing, is the currently loaded character not affected? (Once the previous version of statusDev is applied, can it not be changed anymore?)

When saving the game, if the character's level is 70, the keys of baseDevSV from 1 to 70 seem to be created. ( "0" ~statusvalue size 100~ , "1"~statusvalue size 100~ ~~)

This produces a lot of strings, and it costs money to write data to the server.
What I want is not to store this baseDevSv.
When loading the game, shouldn't the game be run by referring to the value stored in the editor?

If I use editor data without saving this "baseDevSv", the size of the save data string will be reduced by half.

Is this possible?

some part of the baseDevSV keys)

"baseDevSV": {
"subData": {
"One": {
"intData": {
"percentPoints": 1
},
"intArrayData": {
"statusValue": [
10,
0,
10,
0,
4,
1,
1,
1,
4,
4,
1,
0,
3,
0,
1,
0,
0,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
},
"2": {
"intData": {
"percentPoints": 2
},
"intArrayData": {
"statusValue": [
0,
0,
0,
0,

ETC.. to "200"
very big string

thanks in advance
  • Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited May 2021
    Wow. Thank you!
    Sorry for asking again before checking this.
    when i save

    DataObject saveData = ORK.SaveGame.GetSaveData();
    jsonConvert.serialize(saveData);

    i use it above code (using json converter)


    Can I use the plugin in my case too?

    GetSaveData(); Return a compressed dataobject when called?

    Or does this plugin use xml?

    Is there a separate usage method? (through scripting)
    Post edited by KESHYAS on
  • edited May 2021
    Uh, no the compression is on the XML data - but you can use the plugin's code to compress whatever string you want, e.g. your json string.

    With the plugin imported in the project, you just need to call this code to compress:
    string compressedData = new GZipCompression().CompressString(dataString);
    And to decompress:
    string decompressedData = new GZipCompression().DecompressString(compressedData);
    You don't even have to set up the plugin in ORK for this :)

    Edit:
    The namespace of that stuff should be ORKFramework.Compression.
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Wow, this is magic.
    reduced to 70,000 bytes > 10,000 bytes.
    Thank you very much. Ork has all the features I want!

    I have an additional question.

    1. In the current server, there is data of other players stored as json.
    Can I call DecompressString method with uncompressed json string?
    is it work?
    (since there is no way to check whether it is json or compressed)
    new GZipCompression().DecompressString(jsonString);

    2. When i using scripting, is there no need to register the dll in the editor?
    (only for xml and ork gui? )

    Because of the size of the save file, I chose json instead of xml, but there is no need for that now.
    Thank you.

  • 1) I think so - if something goes wrong during decompression, it'll cause a silent exception and just return the original text you passed on, i.e. in your case the uncompressed json string.

    2) Exactly, if you only use this via scripting and not as part of ORK's save game handling, you don't need to register the plugin in the ORK editor.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.