Log In  

I'm working on a utility to help other programmers at the moment (including myself). I am using the compressor my "Image Compressor" uses for raw data but think I can do better.

Didn't someone make a compression program in PICO earlier that used the same fundamentals as PKZIP ?

And if so, does anyone remember where it went ?

P#54908 2018-08-09 21:16 ( Edited 2018-08-14 05:07)

zep made a compress/decompress demo, which is probably what you're thinking of: https://www.lexaloffle.com/bbs/?tid=3930

My compression demo implemented compression in Python and decompression in Lua, with the intent of pre-building selectable compressed strings from a database. Not useful for utils that are also carts, but possibly useful for some kinds of off-platform tools: https://www.lexaloffle.com/bbs/?tid=2776

P#54909 2018-08-09 21:27 ( Edited 2018-08-10 01:27)

Phew ! Nope, no Python or Lua if you please. Just P8 coding. I'll look to the links. Thanks.

... (a few minutes later)

GASP wow, Zep's code is - umm ... detailed. My program is already pretty big. Not sure if the compression space I save is promptly eaten up by the code space of ZEP's compressor itself.

For the moment I just need to compress one file so I'll skip it for now. It works without compression just fine.

Looking briefly at what he's doing I think I can make a really good compressor in a tiny amount of code. But later, I want to finish this project first.

P#54910 2018-08-09 21:36 ( Edited 2018-08-10 01:38)

zep's full demo cart is 1239 tokens (6072 chars), including compression, decompression, and demo/support routines. I haven't tried paring it down.

Not that I tried to optimize for tokens, but my decompressor is 557 tokens (1641 chars). That's pretty big, though keep in mind that it knows how to index into the compressed data. You can probably cut down if you're just decompressing a big blob.

Also note that both examples are using addressable RAM, not code strings. If you want an off-platform tool to make compressed code strings that can be unpacked into memory (a common task), you might do something differently.

(You realize PICO-8's language is Lua, yes? ;) )

P#54911 2018-08-09 21:52 ( Edited 2018-08-10 01:52)

Yes but I don't think you can do graphics as easily in LUA as you can in PICO, which is why I chose PICO.

I've been working on that bit compressor tool all day and it's finished now. Taking a break. Tomorrow I'll start on the idea of that miniature compressor. I'm curious to see how well it will work.

P#54914 2018-08-09 22:19 ( Edited 2018-08-10 02:19)

You could split the difference and do your offline work in Löve2D, which also has a fairly simple graphics pipeline, though you can use more advanced bits later if you need more.

I think someone wrote a set of support functions that mimic PICO-8 in Löve2D, too. I forget the name, something like PicoLöve or LövePico.

The upside is that your offline stuff can run a lot faster in Löve2D (or just raw Lua) than in PICO-8, where it's throttled to semi-sorta-kinda imitate a 4KiHz processor.

P#54991 2018-08-12 05:53 ( Edited 2018-08-12 09:53)
P#55083 2018-08-13 15:24 ( Edited 2018-08-13 19:24)

I tried messing with Love2D one time. It doesn't seem to have a good GUI, nor tile editor, nor map editor, nor sound editor, nor music editor.

Did I miss anything ? :)

P#55099 2018-08-13 18:52 ( Edited 2018-08-13 22:52)

I'm talking about offline tools, not live editing.

P#55114 2018-08-14 01:07 ( Edited 2018-08-14 05:07)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 19:45:36 | 0.007s | Q:20