What's the structure of .stm files?

  • Creepi
    18th Mar 2021 Member 0 Permalink

    Hey! I've become curious to how exactly TPT encodes stamps in .stm files and what the data means.
    Feel free to get techincal since I already have some experience in working with raw data of encodings! (mainly .ogg files)

  • LBPHacker
    18th Mar 2021 Developer 0 Permalink
    They're just like any more recent save.
  • Creepi
    18th Mar 2021 Member 0 Permalink

    @LBPHacker (View Post)

     Thank you!

  • jacob1
    18th Mar 2021 Developer 0 Permalink
    Very quick description of what to expect:

    12 bytes of header data. This contains save format version, tpt version, width / height info and the size of the save.

    After that, it's bz2-compressed bson data. bson is basically a binary form of json, in a way. We store a lot of misc properties in here, then a few maps (like air maps, wall maps), and finally the particle data map.

    The particle data map is most complex, it saves particles from top to bottom, left to right, saving every particle in each position. For each particle, it stores a list of flags that say what properties to load. So for example, there would be a flag saying "load one byte of .life". This lets it save space only saving the info it needs.