Log In  

Hi,

Perhaps this has been asked before, but I don't recall seeing anything about it specifically. Apologies if so.

I've just gone over the png compression limit on a cart, but have about 1128 tokens & 20,000 odd characters left to go. I'll probably use all of them.. I know I can reduce the length of my variable names, or minify the source to make it fit, but -

I was wondering if there was a technical reason why the cart file size couldn't be, say, doubled, or even left unrestricted? As long as you're within the token and character limit that is.

For the record, I think the idea of storing data directly in the image is pretty damn cool & I'm not suggesting that be changed, but if it's only restricted by image size, perhaps the 'overflow' data could be stored in a private png chunk? In theory it shouldn't interfere with how it appears or downloads in browsers or image viewers etc.

If it's a hard limit on file size or Javascript or something though, I guess I can't really argue against that one.

I guess it's no big deal, but I'd love to be able to keep the original source in the cart is all.

Cheers

edit: clarification - cart file size.

P#29121 2016-09-22 23:39 ( Edited 2016-09-23 04:59)

Increase memory ?
Increase cart size ?

Ouch. Hoo boy. Here we go again ...

I guess I could point out initially that you are limited to 8192 TOKENS, not K or BYTES. A variable, no matter how long the name is, always and only counts as one token to PICO. So shrinking your variable names will not save any space in this unique and fantasy restriction-given language.

P#29122 2016-09-22 23:51 ( Edited 2016-09-23 04:04)

Hi dw817,

I'm not asking for memory to be increased, not sure where you're getting that from, neither am I asking for the token or character limit to be increased.

Regarding variable length, perhaps this is out of date now, but I'm going off the information in this thread - https://www.lexaloffle.com/bbs/?tid=2400

In particular:
"the maximum number of characters that can be copied from a previous point in the [encoded or compressed data] stream is 17 characters, so try to keep your variable names below this threshold".

You are correct that I will not save any tokens by using shorter variables, however it appears to have an effect on cart compression.

Thanks

P#29124 2016-09-23 00:05 ( Edited 2016-09-23 04:38)

Here's the thread from last year when the limit was upped a bit that includes info about the limits.

P#29125 2016-09-23 00:15 ( Edited 2016-09-23 04:19)

Thanks tyroney, I hadn't seen that one. I'm not entirely clear what zep meant by not wanting to store binary data, however if that means no extra metadata in pngs, I guess I'm out of luck.

P#29126 2016-09-23 00:33 ( Edited 2016-09-23 04:34)

Sorry, Catatafish. I read, "why the cart file size couldn't be, say, doubled" and interpreted that to mean an increase.

My code currently is so rife with remarks, I am quite pleased to see they take no token space at all. I'm only at 943 symbols and have already finished half of my program, yet have munched up a good 4800+ chars in actual raw characters.

If 8192 is the upper limit on tokens to a single program, I think it's pretty safe to say I can write just about anything I want in PICO, including a small Online RPG Maker. I was dabbling on one for Gameboy years ago and my limit there was 64k.

P#29131 2016-09-23 00:59 ( Edited 2016-09-23 04:59)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-20 10:09:09 | 0.007s | Q:16