Need better format for save

  • Videogamer555
    16th Nov 2013 Member 0 Permalink
    Oldest file format I could find is this one (notice no temperature field, or tmp, or tmp2). This is a real antique format. However for backward compatability, even the latest version of TPT can read it. This should make converting pictures to TPT layouts a breeze when I've finished making my conversion program. I've abandoned the OPS1 format. Just way to much to it with all that BSON crap.

    Here's the specs I managed to reverse engineer from using a hex editor to look at a few saved stamps in this old format (an act of reverse engineering that would be impossible with a BSON based format).

    Format of oldest save/stamp file:
    Header
    BZip2 compressed data


    Format of header:
    4ByteAsciiString ID letters "PSv " (last slot is actually null 0x00 character)
    Byte major version number
    Byte block size
    Byte width in blocks
    Byte height in blocks
    Int32 size of data after decompressing



    Format of BZip2 compressed data:
    ByteArray walls
    ByteArray fan X velocities (only stored for fan type walls)
    ByteArray fan Y velocities (only stored for fan type walls)
    ByteArray particles
    ByteArrayX ByteArrayY particle velocities (stored as x/y pairs, only stored if particle present)
    ByteArray particle life (only stored if particle present)
    ByteArray particle ctype (only stored for CLNE)
    Byte number of signs
    SignsArray (only stored if number of signs > 0)

    Sign format
    Int16 x position
    Int16 y position
    Byte justification (0=left 1=center 2=right)
    Byte length
    AsciiString text


    Notes on velocities.
    Velocities are positive if the velocity byte value is 128 to 255 and negative if 126 to 0.
    Velocities are 0 if the velocity byte value is 127.
    This means it is possible to have a greater positive velocity than negative velocity.
    Note that the particle velocity byte values are much less than the actual pixel per frame velocities.
    For example, 128 is 1 above 127, but it actually corresponds to a velocity of much less than 1 pixel per frame.

    Notes on life.
    Life byte value is actually 1/4 of the value in the software.
    For example, if the value of a byte in the array is 3, the corresponding particle will have a life of 12 in TPT.





    Edited 3 times by Videogamer555. Last: 16th Nov 2013
  • boxmein
    16th Nov 2013 Former Staff 1 Permalink
    ... OPS is a super simple and widely extensible format and you should be ashamed of even the fact that you use a language that has become obsolete and inadequate 15 years ago and complaining over the lack of BSON bindings for said language. Also the fact that you're trying to reinvent the wheel.

    ...Also http://boxmein.mniip.com/tptelements/references/OPS-reference.html
    Edited once by boxmein. Last: 16th Nov 2013
  • jacksonmj
    16th Nov 2013 Developer 0 Permalink

    converting pictures to TPT layouts


    This might be a good time to point out that image plotting (such as http://tpt.io/~42016) has been against the rules for a while now. So if you make a program to create saves like that, don't upload saves made with it. It's a nice programming challenge though, at least three devs (me, cracker64, Simon) and various other people have made image plotters in the past. For extra fun, do it with undecorated elements only.

    Edited 3 times by jacksonmj. Last: 16th Nov 2013
  • Videogamer555
    16th Nov 2013 Member 0 Permalink
    @jacksonmj (View Post)
    As far as I know it is ok to upload saves that have been "plotted" as long as you uncheck the box called "publish" in TPT, or if you forget this, go to your profile page on the site and click the "lock save" button. This will prevent others from voting on it (which is the primary goal here, as voting should be reserved for giving your opinion of someone's hard-work based creation, not a converted image), but will also allow others to download it even if they can't vote on it (not sure if commenting is possible on a locked/unpublished save though).
    Edited once by Videogamer555. Last: 16th Nov 2013
  • MiningMarsh
    16th Nov 2013 Member 1 Permalink

    @Videogamer555 (View Post)

    I just kind of want to point out how you rave that no third party programmer would be able to use the save format TPT uses, when it turns out that many already have, and morover, they were doing the same thing with the save that you wanted to do.

  • boxmein
    16th Nov 2013 Former Staff 0 Permalink
    @Videogamer555 (View Post)
    Nah it's not. Image plotting isn't okay even if the save is unpublished. Loads of private saves have been deleted in fact for being image-plotted.

    Just.. you can do it for proving that you're able, aside that nothing else really.
  • Videogamer555
    17th Nov 2013 Member 0 Permalink
    @boxmein (View Post)
    Someone once told me it was ok, I think in another forum post I was asking about it or in the PM/conversations section of my account. So since someone said it was ok, not against the rules as long as it was private, I just assumed it was in fact ok and not against the rules if you kept it a private save.

    By the way, my plotting program is coming along nicely. I even recorded a frames of it running with the R key and then using other pieces software to get the frames into a video and a small enough one to upload to Youtube in a reasonable time frame (original video after assembling frames with VirtualDub was Raw RGB AVI at over 600MB, FFMPEG conversion to MPEG4 with H264 codec brought it to under 50MB). Sadly Youtube butchered the video, despite me uploading the video with high quality (yes the quality was high, despite the high compression, because with so few colors used compression is fairly easy). But it's enough quality (even after Youtube's butchering) to demonstrate the outcome of my TPT image plotter software running in TPT. It's the standard "Water lilies.jpg" sample image that comes with Windows XP that I used for my first test conversion.



    So far it's a prototype only, but when it's done, I'll upload it to Mediafire and post download links in the description in my Youtube video, and also on this forum in this thread in another one dedicated to my software.
    Edited 2 times by Videogamer555. Last: 17th Nov 2013
  • Schneumer
    17th Nov 2013 Member 0 Permalink

    i dont get any of this but image plotting plus unpublish would equal a great private art gallery for some peeps on tpt...

  • boxmein
    17th Nov 2013 Former Staff 0 Permalink
    @Videogamer555 (View Post)
    Wow, that's neat. Good job.
  • Videogamer555
    18th Nov 2013 Member 0 Permalink
    I found a bug in my program. I fixed it.

    I've added the ability to load any picture from file using the LoadFile dialog box of the Common Dialog OCX control. (in my prototype version, the filename was fixed so it always automatically loaded one picture for testing purposes)

    I've added the ability to, upon loading an input image, select output image size between 612x384 (the currently used window size in TPT) and 512x384 (the really old window size used in TPT)

    I'd say it's in its beta phase now. It's almost ready to be released.
    Edited 6 times by Videogamer555. Last: 18th Nov 2013