Log In  


I am at the end of my first project, adding a few new rooms to my level string, when I realized I was over the compressed size limit. So I started deleting new line characters here and there... but it seems like this just makes the compressed size go up. Can someone please explain this to me, or is this a bug?



2

Compression works by using short sequences of bytes to represent regular patterns in the source text. The more the same regular pattern appears in the source text, the more the text can be compressed. Removing characters here and there can make the source text less regular and therefore less compressible.


So I realized this once I decided to just go through and reduce some commands to mnemonics and saw it jump down suddenly as I edited it. Still... to be honest, being under the token and character limit and having this arbitrary compression size that you cannot plan for makes me want to abandon PICO-8


1

> having this arbitrary compression size

I've been there and can relate to the frustration of not knowing how to get the compressed size to go down, but it is important to note that that size limit is far from "arbitrary"; in fact it is the only limit of the three code-size limits that is not arbitrary! it is a hard limit set by the maximum amount of data (32 KB) which can be encoded into the final PNG image of the cart. Hopefully that helps a little when you are feeling frustrated with it :)

EDIT: oh it also helps to keep in the mind the history of the cartridge format: originally, the only limit was a very low character limit. It was quite limiting, I can tell you from experience! So zep then added compression to allow us to squeeze more code into a cart.


That makes a lot of sense. Arbitrary was definitely the wrong word. I guess a better word would be unpredictable due to it's non-linear nature.


I wish I had been keeping an eye on it... I saw compressed size and foolishly thought if I kept below the token and character count I would be good. Now I have to back pedal and figure out how to get my end game screen in there without going over.



[Please log in to post a comment]