Discuss Scratch

XretroperX
Scratcher
100+ posts

Misconceptions about the project size limit

Heh. I had a project that exceeded the max size in it's current state, so I had to cut out a TON for it to properly save after it was changed lol. Still runs great, somehow.

Hey. This is a signature.
I'm semi-active ig

I don't know what to put here.
scratchfan321
Scratcher
95 posts

Misconceptions about the project size limit

Finally. I can fit Terraria on Scratch in 4Mb!
tyjinw1
Scratcher
100+ posts

Misconceptions about the project size limit

how about a blank sprite with infinite size?

check out my fun games
just idle fun (my idle virus + my idle balls)
idle virus (VERY IMPROVED) <—- a remix
idle cells
generators
!!! <– cloud clicking game
live chat <– i want the length to go crazy
and also check out my profile
and put your url milestones here
Flowermanvista
Scratcher
1000+ posts

Misconceptions about the project size limit

kenny2scratch wrote:

Okay, so I did some math. (snip)
This post is truly a modern classic - but the thing is, it's not entirely correct. I've done some experimentation of my own and found out that it's actually possible to make a project smaller (and thus, bigger) than this post says. We're going to throw any concept of “reasonability” out the window and focus solely on completely maximizing the number of assets we can cram into the new, smaller JSON size limit of 5,242,880 bytes (about 0.136% smaller than the old 5,250,000 byte limit that was in effect when that post was made, LAME!).

First, the smallest possible project that will successfully load without errors (223 bytes): I've found that a surprising number of properties are entirely optional and can be omitted completely - particularly, you'll notice something pretty major missing around the part where it stores the assets:
{"targets":[{"isStage":true,"name":"Stage","variables":{},"blocks":{},"costumes":[{"assetId":"cd21514d0531fdffb22204e0ec5ed84a","name":"","dataFormat":"svg"}],"sounds":[]}],"meta":{"semver":"3.0.0","vm":"0.2.0","agent":""}}
I'd like to draw your attention to the lack of the “md5ext” property, which, as far as I can tell, is entirely optional. This significantly reduces the size of the asset object - this one weighs in at only 73 bytes:
{"assetId":"cd21514d0531fdffb22204e0ec5ed84a","name":"","dataFormat":"svg"}
Our project without that asset is 150 bytes, giving us 5,242,730 bytes to work with.
5,242,730 divided by 74 (the comma separating assets adds an extra byte) is about 70,847.702…
we'll floor that to 70,847 assets that can fit in project.json.
70,847 times 74 is 5,242,678 (then we subtract 1, since the last asset doesn't need a comma, so 5,242,677).
Then, when we add back the 150 bytes of the rest of the project, that gives us 5,242,827 bytes for the JSON file.

70,847 assets times 10,000,000 bytes each is 708,470,000,000 bytes - then, adding back in the size of the JSON file gives us a final size of 708,475,242,827 bytes (708.4 GB, 659.8 GiB) for the theoretical largest Scratch project that could be saved online, under the current size limits.

Is there any point to this absurd minmaxing experiment? No, not really. But is it fun? …I'll leave answering that as an exercise for the reader.

Add a SPOOKY SKELETON to your project!

The Scratch 3 Project Save Troubleshooter - find out why your project won't save

ST, Please Add A Warning When A Size Limit Is Exceeded

My Dumb Creations - THE BEST ANIMATION | The Windows 98 Experience (made on Windows 98) | nobody cares about Me… | the2000 Reveals His New Profile Picture | Not Dumb Creations - Ten Years
Ctrl+Shift+Down for more…
Do evil kumquats keep eating your signature? Assert your dominance and eat the evil kumquats. Did you know that kumquats are only about the size of an olive?
DIAVLODUDE
Scratcher
76 posts

Misconceptions about the project size limit

Flowermanvista wrote:

kenny2scratch wrote:

Okay, so I did some math. (snip)
This post is truly a modern classic - but the thing is, it's not entirely correct. I've done some experimentation of my own and found out that it's actually possible to make a project smaller (and thus, bigger) than this post says. We're going to throw any concept of “reasonability” out the window and focus solely on completely maximizing the number of assets we can cram into the new, smaller JSON size limit of 5,242,880 bytes (about 0.136% smaller than the old 5,250,000 byte limit that was in effect when that post was made, LAME!).

First, the smallest possible project that will successfully load without errors (223 bytes): I've found that a surprising number of properties are entirely optional and can be omitted completely - particularly, you'll notice something pretty major missing around the part where it stores the assets:
{"targets":[{"isStage":true,"name":"Stage","variables":{},"blocks":{},"costumes":[{"assetId":"cd21514d0531fdffb22204e0ec5ed84a","name":"","dataFormat":"svg"}],"sounds":[]}],"meta":{"semver":"3.0.0","vm":"0.2.0","agent":""}}
I'd like to draw your attention to the lack of the “md5ext” property, which, as far as I can tell, is entirely optional. This significantly reduces the size of the asset object - this one weighs in at only 73 bytes:
{"assetId":"cd21514d0531fdffb22204e0ec5ed84a","name":"","dataFormat":"svg"}
Our project without that asset is 150 bytes, giving us 5,242,730 bytes to work with.
5,242,730 divided by 74 (the comma separating assets adds an extra byte) is about 70,847.702…
we'll floor that to 70,847 assets that can fit in project.json.
70,847 times 74 is 5,242,678 (then we subtract 1, since the last asset doesn't need a comma, so 5,242,677).
Then, when we add back the 150 bytes of the rest of the project, that gives us 5,242,827 bytes for the JSON file.

70,847 assets times 10,000,000 bytes each is 708,470,000,000 bytes - then, adding back in the size of the JSON file gives us a final size of 708,475,242,827 bytes (708.4 GB, 659.8 GiB) for the theoretical largest Scratch project that could be saved online, under the current size limits.

Is there any point to this absurd minmaxing experiment? No, not really. But is it fun? …I'll leave answering that as an exercise for the reader.

That's cool! But then, how do we remove all this code to make it 708,475,242,827 bytes or higher than 5 MB?
DIAVLODUDE
Scratcher
76 posts

Misconceptions about the project size limit

adazem009 wrote:

Assets are using POST method wich have large limit. The project.json uses PUT method and it's more limited. My project couldn't save because the server returned error 413 (Request Enity Too Large) when posting project.json using PUT method. My project.json had size greater than 5MB. So the limit isn't 10MB but 5MB.
I had to reduce the size by removing some of the scripts.
The full size of my project is 22MB.

Cool!
plane_space_test
Scratcher
34 posts

Misconceptions about the project size limit

Flowermanvista wrote:

Hey there. I'm a fairly frequent user of the Scratch Forums, and I often see misconceptions about the project size limit. Most of these misconceptions came from the era of Scratch 2.0, where projects had a hard 50 MB limit for the entire project. However, that's not necessarily true anymore, so let me tell you about the 2 new size limits in Scratch 3.0:
  • No asset can exceed 10 MB.
What does this mean? Essentially, an asset is a costume or sound file. If any one asset exceeds 10 MB in size (usually a sound file), then the project will refuse to save. (Note that it is possible to have multiple assets that total to over 10 MB, as long as none of the assets are over that size on their own.) You can usually get around this by converting the sound file to MP3 or splitting the sound file into chunks, or both if really necessary.
  • The project.json file cannot exceed 5 MB.
What does this mean? The project.json file is a file inside the Scratch project that stores, among other things:
  • all code in the user's project
  • information about sprites and assets
  • any list values that were saved with the project
Most of these take up very little space, but it is possible to exceed the limit by accident. Keep in mind that this limit applies to the uncompressed size of project.json, and not its compressed size - for example, if project.json is 5.1 MB uncompressed but only 900 kB compressed (when it's inside the project file), the project will refuse to save.

It's worth noting that these are the only size limits - there is no limit on overall project size. You can have a project that's 100 MB or more, as long as it does not exceed either of these limits (although such a project will take a very long time to load and save).

Although these are the most common causes of projects that don't save, there are a few other causes, such as login issues and other things that aren't relevant to this topic.

To the best of my knowledge, these are the current and only size limits. If any authoritative source that is not outdated says something else, please let me know. Thanks!

Edit: So somehow this got stickied. Thank you to everyone involved in that.


but if the limit for assets is 10 mb and the limit for code is 5 mb that would make the biggest possible project 15 mb, while many projects have exceeded that. pls help i dont understand

Plane_Space_Test
CST1229
Scratcher
1000+ posts

Misconceptions about the project size limit

plane_space_test wrote:

but if the limit for assets is 10 mb and the limit for code is 5 mb that would make the biggest possible project 15 mb, while many projects have exceeded that. pls help i dont understand
The limit is 10MB per asset, not in total for every asset in the project.

This is a signature. It's a piece of text that appears below every post I write. Click here to learn more, including how to make your own.
RIP assets image hosting. 2013?-2023



Flowermanvista
Scratcher
1000+ posts

Misconceptions about the project size limit

(edit: ninja'd)

plane_space_test wrote:

but if the limit for assets is 10 mb and the limit for code is 5 mb that would make the biggest possible project 15 mb, while many projects have exceeded that. pls help i dont understand

Flowermanvista wrote:

(Note that it is possible to have multiple assets that total to over 10 MB, as long as none of the assets are over that size on their own.)

Last edited by Flowermanvista (March 21, 2022 15:20:50)


Add a SPOOKY SKELETON to your project!

The Scratch 3 Project Save Troubleshooter - find out why your project won't save

ST, Please Add A Warning When A Size Limit Is Exceeded

My Dumb Creations - THE BEST ANIMATION | The Windows 98 Experience (made on Windows 98) | nobody cares about Me… | the2000 Reveals His New Profile Picture | Not Dumb Creations - Ten Years
Ctrl+Shift+Down for more…
Do evil kumquats keep eating your signature? Assert your dominance and eat the evil kumquats. Did you know that kumquats are only about the size of an olive?
B123code
Scratcher
5 posts

Misconceptions about the project size limit

Za-Chary wrote:

I should also add that this “50 MB for the code” thing I've been saying might either be wrong or vague. Listen to what @Paddle2See says above.

However, in this sense I do believe that you can technically make projects that are larger than 50 MB total under this system.

I know that scratch has it's own server, I just can't understand why you need that server when you could just use FireBase Realtime Database, FOR FREE WITH UNLIMITED DATA STORAGE!!! FireBase runs on Google, and Google has the biggest servers on the PLANET!!! If scratch switched to FireBase, That could mean that:
1. projects would have NO STORAGE LIMIT
2. cloud variables would be able to store letters, with no length limit.
imfh
Scratcher
1000+ posts

Misconceptions about the project size limit

B123code wrote:

Za-Chary wrote:

I should also add that this “50 MB for the code” thing I've been saying might either be wrong or vague. Listen to what @Paddle2See says above.

However, in this sense I do believe that you can technically make projects that are larger than 50 MB total under this system.

I know that scratch has it's own server, I just can't understand why you need that server when you could just use FireBase Realtime Database, FOR FREE WITH UNLIMITED DATA STORAGE!!! FireBase runs on Google, and Google has the biggest servers on the PLANET!!! If scratch switched to FireBase, That could mean that:
1. projects would have NO STORAGE LIMIT
2. cloud variables would be able to store letters, with no length limit.
I believe storage limit is there to prevent large projects (with big empty lists) from crashing mobile browsers rather than to save storage space. Cloud variables can’t contain letters to make it harder to make cloud chats. They have a length limit because of server issues (not related to space) in the past when there was no limit. It’s pretty hard on the server to have huge variables being transferred multiple times per second by multiple Scratchers on many projects.

Last edited by imfh (March 23, 2022 22:39:23)


Scratch to Pygame converter: https://scratch.mit.edu/discuss/topic/600562/
thatwasdeadsimple
Scratcher
100+ posts

Misconceptions about the project size limit

B123code wrote:

2. cloud variables would be able to store letters, with no length limit.
They don't want cloud variables with letters in them because it would make it easy for anyone to make chatrooms in a project using cloud variables.

“….the right man in the wrong place can make all the difference in the world.” - the G-Man
Check out my CS:GO map!
musicROCKS013
Scratcher
1000+ posts

Misconceptions about the project size limit

Flowermanvista wrote:

If project.json is 5.1 MB uncompressed, the project will refuse to save.
So, does this mean that the hypohetical .json file size, or the size the file would be if you export it, or only if you try to import the file? I'm just curious.


Shift + Down arrow to see the rest of my signature

Hello Scratch Team. You have been pushing a liberal political agenda on this site for far too long. This site should stay out of politics. People should be able to still post their political opinions, but there shouldn’t be any “official” political stance or Scratch. The ST is not going to change this on their own, and shoot down any attempts asking them to change. Please put this in your signature if you agree that

Scratch should be politically neutral.

The ST’s biggest defense is that they’re being welcoming, but they can be perfectly welcoming of all people and stay out of politics. Scratch is about coding, and that should be the Scratch Team’s biggest concern to maintain.






This is my signature. I am allowed to adertize here.

_______________\/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ \/
Please Click —> This project is literally my life's work. <— Please Click
_______________^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Jenny LeClue is the best
CST1229
Scratcher
1000+ posts

Misconceptions about the project size limit

musicROCKS013 wrote:

(#73)

Flowermanvista wrote:

If project.json is 5.1 MB uncompressed, the project will refuse to save.
So, does this mean that the hypohetical .json file size, or the size the file would be if you export it, or only if you try to import the file? I'm just curious.
The size the file would be if you export it.

This is a signature. It's a piece of text that appears below every post I write. Click here to learn more, including how to make your own.
RIP assets image hosting. 2013?-2023



Tunde123
Scratcher
1000+ posts

Misconceptions about the project size limit

scratch_mit_edu375 wrote:

-MASSIVE SNIP-
Please snip your quotes next time.

That lagged my computer

This is a SIGNATURE. This is seperate from a normal post ^
Forum Posts: 2600+/3000
Highlight + Shift + Down Arrow = To see whole signature.




Want to friend me on Roblox? My username is BaconvsRoblox121314 if you want to friend me!

–v More Information v–
New Scratchers - Introduce yourself here!

Questions about Scratch - Ask questions related to scratch here!

Help with Scripts - get/provide help here!

Suggestions - Suggest blocks, features, and more here!

Bugs and Glitches - Report bugs/glitches here!

Last edited by Tunde123 (May 17th, 2022 10:18 AM EST)
Thethree13
Scratcher
41 posts

Misconceptions about the project size limit

I wonder why they changed it from 50mb to 5mb for the project.json
CST1229
Scratcher
1000+ posts

Misconceptions about the project size limit

Thethree13 wrote:

(#76)
I wonder why they changed it from 50mb to 5mb for the project.json
There was never a 50mb project.json limit, the 50mb limit was for the entire project in 2.0.

This is a signature. It's a piece of text that appears below every post I write. Click here to learn more, including how to make your own.
RIP assets image hosting. 2013?-2023



MonkeyBean2
Scratcher
100+ posts

Misconceptions about the project size limit

LegoManiac04 wrote:

There's also a 50 MB limit on the code.
The code is in project.json


9NAwRfSR-%dWFS$a$g&zBMTj2?;jvS?L5%^X%qpCX|A<*paJ=lU07c)wmt$v{TxL5



scratchGui.timeTravel.year = '2020'
bloctans_4
Scratcher
1000+ posts

Misconceptions about the project size limit

if its a limit for POST and PUT, then would a websocket work?

Generation 4: the first time you see this copy and paste it on top of your sig in the scratch forums and increase generation by 1. Social experiment.
CST1229
Scratcher
1000+ posts

Misconceptions about the project size limit

bloctans_4 wrote:

(#79)
if its a limit for POST and PUT, then would a websocket work?
Scratch does not have a websocket API for saving projects (why would it?).

This is a signature. It's a piece of text that appears below every post I write. Click here to learn more, including how to make your own.
RIP assets image hosting. 2013?-2023



Powered by DjangoBB