LogicDraw icon indicating copy to clipboard operation
LogicDraw copied to clipboard

New save format

Open Wieku opened this issue 7 years ago • 0 comments

As the current format is not backwards and future compatible, adding new properties to objects needs a new save version, there is a proposition of a new format of it. It will use a new extension, because .ldmap is a little too long. Before, header was packed together with map data in GZip stream which may be too CPU expensive to read just it. So header will be unpacked in the new format. Instead of beeing just values that are read sequentially, it will be read as a JSON String, new content will be added to help map sharing.

Header contents:

  • raw int as save version
  • JSON saved as raw UTF-8 string:
    • name: string
    • description: string
    • authors: string
    • width: int
    • height: int
    • creationDate: long
    • modificationDate: long
    • objects: long
    • entities: long
    • states: long
    • tickrate: int
    • thumbnail: BASE64 string

Right after the header there will be a map stored in GZipped Data(Input/Output)Stream.

  • Two integers describing map size

  • State data:

    • Total number of states (including free ones): int
    • Number of free states: int
    • Sequentially saved free state numbers: int
    • Sequentially saved state data: int
  • Object mapping:

    • "UTF-8 String and int pair saved sequentially"
  • Objects:

    • Number of objects: long
    • Sequentially saved objects:
      • object type: int
      • x: int
      • y: int
      • properties: string (or byte) to object map

Wieku avatar Jan 06 '19 01:01 Wieku