temp glitch

  • 12Me21
    13th Oct 2015 Member 0 Permalink

     

    the maximum value seems to be 67108868

     

    No one seems to read the "official game feedback" thread, so I posted this here instead.

    Edited once by 12Me21. Last: 13th Oct 2015
  • jacob1
    13th Oct 2015 Developer 0 Permalink
    @12Me21 (View Post)
    I always read the Official Game Feedback thread. It also helps to put stuff there because it will always be sticked and active (and this thread could die).

    But yes, this looks like a glitch.
  • 12Me21
    13th Oct 2015 Member 0 Permalink

    Shouldn't temp be saved as a 20 bit integer instead of floating point? Then it could range from 0 1048576, which could be divided/multiplied by 100 when saving/loading, so it could go from 0.00 to 10485.76

     

    this would affect the file size much more than resetting particle order, I think.

    Edited once by 12Me21. Last: 13th Oct 2015
  • jacksonmj
    13th Oct 2015 Developer 0 Permalink

    Temperatures are currently stored as a 16 bit int, except for values near room temperature which are stored as an 8 bit signed integer offset from room temperature. This means they are saved to a precision of 1 degree, and go from 0 to 65535. As far as I know, there are currently no floating point numbers in the save format.

    Edited 3 times by jacksonmj. Last: 13th Oct 2015
  • 12Me21
    13th Oct 2015 Member 0 Permalink

    @jacksonmj (View Post)

     Oh. Wouldn't a 14 bit unsigned integer be better? Then it could go from 0 to 16384 (kelvin).

     

  • Jokersona
    13th Oct 2015 Member 0 Permalink

    12Me21:

    @jacksonmj (View Post)

     Oh. Wouldn't a 14 bit unsigned integer be better? Then it could go from 0 to 16384 (kelvin).

     

     or they could just use the built-in 8, 16, 32, or 64 bit data types and not try to make a custom one.

  • jacob1
    13th Oct 2015 Developer 0 Permalink
    @12Me21 (View Post)
    Well I guess it would be, but currently the save format just works on 1 byte boundaries. Saving 2 bits of space might make a difference, but I guess isn't that big of a deal ...

    The main problem I Was worried about here is that the NTCT's temp wasn't reset to MAX_TEMP like it should be.
    Edited once by jacob1. Last: 13th Oct 2015
  • jacksonmj
    13th Oct 2015 Developer 0 Permalink

    It would be more difficult to load and store, especially since temperatures are not in their own array but are interleaved with field descriptors and all the other properties, which are stored using whole bytes. Also I suspect the bzip2 compression operates best when the bytes repeat rather than just the bits, but I haven't tested that.

     

    The current save format is a balance between file size and being reasonably simple to read and write. For most saves, I think it gave around the same file size as the previous save format (PSv), the advantage was just being a lot easier to parse and to add extra data to.

     

    If you enjoy experimenting with compression techniques, then yes, storing temperatures as 14 bit integers is something you could try. There are a number of other things you could try too, which might give bigger gains, such as:

    • grouping the data by property then particle instead of by particle then property (on the basis that a property might have similar values in different particles)
    • grouping property data (except type) by particle type (on the basis that particles of the same element might have similar property values)
    • delta encoding
    • Huffman coding (since if you're going to make life complicated by coding data in units that aren't a multiple of 8 bits long, you may as well use an efficient code to do it)

    (Though note that changes need testing on a broad range of saves to make sure they reduce file sizes on average, rather than reducing just for a few saves and making the rest of them bigger.)

    Edited 4 times by jacksonmj. Last: 13th Oct 2015