? SmileBASIC File compression system (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password

SmileBASIC File compression system

  • #1 ✎ 369 Chemicalex Drawing I like to draw! Hobbies RNG Hidden Easter Eggs Video Games I like to play video games! Hobbies Today I'm going to be making a SmileBASIC compressor/decompressor that makes a 'zip' than can be 'unzipped'. It's going to be stored in an array of byte numbers (the ASC of each character). Posted
  • #2 ✎ 425 MasterR3C0RD Helper Received for being very helpful around SmileBASIC Source Achievements Third Year My account is over 3 years old Website osu! Is Awesome! I love osu! Express Yourself
    Today I'm going to be making a SmileBASIC compressor/decompressor that makes a 'zip' than can be 'unzipped'. It's going to be stored in an array of byte numbers (the ASC of each character).
    How will you be ZIPping it? I mean, just making a DAT file with ASCs will not make anything smaller. In fact, it will make everything bigger!
    Posted
  • #3 ✎ 369 Chemicalex Drawing I like to draw! Hobbies RNG Hidden Easter Eggs Video Games I like to play video games! Hobbies
    Today I'm going to be making a SmileBASIC compressor/decompressor that makes a 'zip' than can be 'unzipped'. It's going to be stored in an array of byte numbers (the ASC of each character).
    How will you be ZIPping it? I mean, just making a DAT file with ASCs will not make anything smaller. In fact, it will make everything bigger!
    Fortunately my method has changed. If the command is larger than 3 characters, it converts to a 3-character value (such as !#( or #=- )
    Posted
  • #4 ✎ 90 HackTheWorlds Second Year My account is over 2 years old Website Summer 2016 Contest Participant I participated in the SmileBASIC Source Summer 2016 Contest! Programming Contest Reading I like to read books! Hobbies Well that would be handy. 4 megs of upload space isn't very much. Posted
  • #5 ✎ 369 Chemicalex Drawing I like to draw! Hobbies RNG Hidden Easter Eggs Video Games I like to play video games! Hobbies
    Well that would be handy. 4 megs of upload space isn't very much.
    I've written down every command in the sb library (finally)... now for decompressimg
    Posted Edited by Chemicalex
  • #6 ✎ 3 Xenoslyce Video Games I like to play video games! Hobbies Night Person I like the quiet night and sleep late. Express Yourself Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength That aged well Posted
  • #7 ✎ 495 IAmRalsei Video Games I like to play video games! Hobbies First Year My account is over 1 year old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Ima try doing this! Posted Edited by IAmRalsei
  • #8 ✎ 72 seggiepants I would suggest starting with something like Huffman Coding https://en.m.wikipedia.org/wiki/Huffman_coding. Code is largely text so this should work well. Although, using it on a binary file will probably end up making the files larger. It may be awkward to do it without pointers to make a proper tree, but if you can manage to make a dictionary of sorts that maps characters to variable length bit patterns you should be set. I hope you are comfortable with bit masks and bit shifting. If you can do that, the next step would be to look at something like https://en.m.wikipedia.org/wiki/LZ77_and_LZ78 LZW compression where you replace repeated patterns in a sliding window with back references. I haven't tried that one before but it shouldn't be much harder (I think). Finally you could try marrying the two into something like the deflate algorithm https://en.m.wikipedia.org/wiki/DEFLATE. Which is the heart of gzip and of course actual zip files. Gzip is probably the simpler one to try to copy but only works on single files which is usually worked around by gathering things into a Tar (tape archive) file first. Good luck. Posted Edited by seggiepants
  • #9 ✎ 908 Y_ack in addition to the above, a reminder that an actual good file compression package already exists in http://wiki.hosiken.jp/petc3gou/?Toukou%2F%A5%D5%A5%A1%A5%A4%A5%EB%A4%F2%A4%DE%A4%C8%A4%E1%A4%C6%B0%B5%BD%CC in case anyone thinks this should be done for anything other than fun Posted Edited by Y_ack
  • #10 ✎ 259 Shelly If you want something simple RLE is always an option (though a bad one). Posted
  • #11 ✎ 495 IAmRalsei Video Games I like to play video games! Hobbies First Year My account is over 1 year old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength I was planning on giving each command an ID to save space... Thanks for the good luck, mr. anti-goto Posted