robojumper / DarkestDungeonSaveEditor

Darkest Dungeon Save File (.json) Reader, Writer, Editor. Also, Spreadsheets.
MIT License
77 stars 8 forks source link

What is the meaning of the first bit of `Meta2Entry`'s `FieldInfo` #50

Open thanhnguyen2187 opened 2 years ago

thanhnguyen2187 commented 2 years ago

Hi.

I followed your documentation on DSON format and managed to decode the files. However, on encoding JSON files to DSON files, I found a difference with my own Meta2Block and the original Meta2Block, which is further narrow downed to the 1st bit of FieldInfo. For example, from this file, Meta2Entry for base_root (the first field) looks like this:

{
  "name_hash": 1183861218,
  "offset": 0,
  "field_info": -2147483607,
  "inferences": {
    "index": 0,
    "is_object": true,
    "parent_index": -1,
    "field_name_length": 10,
    "meta_1_entry_index": 0,
    "num_direct_children": 2,
    "num_all_children": 109,
    "raw_data_length": 0
  }
}

While my own encoding looks like this:

{
  "name_hash": 1183861218,
  "offset": 0,
  "field_info": 41,
  "inferences": {
    "index": 0,
    "is_object": true,
    "parent_index": -1,
    "field_name_length": 10,
    "meta_1_entry_index": 0,
    "num_direct_children": 2,
    "num_all_children": 109,
    "raw_data_length": 0
  }
}

I managed to see that -2147483607 is equal to 2147483689 in uint32, which can be compared to 41 of my own encoding like this:

1st: 0b10000000000000000000000000101001
2nd: 0b00000000000000000000000000101001

What do you think is the meaning of those first bits?

Thanks!

robojumper commented 2 years ago

I don't know what this bit indicates. It might be relevant for something, but it never seemed to make a difference. If you can figure out what it means, please do drop a comment though.