Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New save format #17

Open
Wieku opened this issue Jan 6, 2019 · 0 comments
Open

New save format #17

Wieku opened this issue Jan 6, 2019 · 0 comments

Comments

@Wieku
Copy link
Owner

Wieku commented Jan 6, 2019

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant