Discuss Scratch

greenninja1500
Scratcher
8 posts

Project won't save - I suspect due to too many scripts

My browser / operating system: Windows NT 10.0, Chrome 80.0.3987.163, No Flash version detected
I have a big project I've been working on for a long time. I copied a sprite and after that point I was unable to save. I then deleted the sprite and I was able to save. My internet speed was high enough (above 15mbps). I downloaded the project to check file size and it was 36 MB (Well bellow the 50 MB). None of the files in the copied sprite were above 10MB so that shouldn't be an issue either. I did some more testing and tried to manually copy the sprite I wanted to copy. It still didn't save. I found however that by removing some of the script in the sprite, I could save. Adding one script then made it not save. Any ideas on what this could be caused by? I suspect a script limit although I found no information regarding one.

Thanks,

greenninja1500

Link to project here (at the point were adding one more script made it unsaveable): https://scratch.mit.edu/projects/332238824

Edit: My project has over 350 sprites and I'm not sure how many scripts (the number cannot be seen without manually checking each sprite)

Last edited by greenninja1500 (April 13, 2020 12:51:15)

Flowermanvista
Scratcher
1000+ posts

Project won't save - I suspect due to too many scripts

There is no 50 MB project size limit anymore. However, there are two new limits in Scratch 3.0, either of which will cause a project to not save:
  • no asset can exceed 10 MB in size (assets include images and sounds, usually it's sounds that trigger this limit)
  • the file project.json inside your project cannot exceed 5 MB in uncompressed size (this file includes all the code, metadata about all sprites and assets, and contents of any lists that were saved with the project)

Opening the project in an archive manager (because Scratch projects are essentially just ZIP files with a different extension) shows that project.json is 4.999 MB in size - just under the limit. This means that adding anything to your project will probably cause it to exceed that limit.

Unfortunately, there's not much that you can do at this point. You could try the following:
  • removing anything that isn't used
  • removing all unnecessary features
  • using custom blocks to replace long scripts that are used two or more times in a single sprite with a leaner alternative
  • removing scripts that initialize a list with values, and instead just saving the project with the list populated
  • if feasible, using a compression function to compress large amounts of text data into a smaller space

Ultimately, however, these probably won't buy you that much space. Really, the only real option would be to go to the Suggestion forum and ask for the limit to be raised, but you know how the ST is with suggestions.

Also, when posting your internet speed, be sure you post the right one. Any good speed test will output two values: your download speed, which is how fast you can get files from the Internet onto your computer, and your upload speed, which is how fast you can get files from your computer onto the internet (example: making a Scratch project and putting it on Scratch). In almost all consumer grade internet connections, the download speed is faster than the upload speed.

As a final note, the number of scripts doesn't have anything to do with it - what matters more in the size of project.json is how much code there is overall. Hundreds of tiny scripts could take up the same amount of space as one big one.

Last edited by Flowermanvista (April 13, 2020 15:11:37)

greenninja1500
Scratcher
8 posts

Project won't save - I suspect due to too many scripts

OK thank you for that information. Strangely, my upload speed is generally higher than my download speed.

It's sad that there is a limit on the size of the json file though I guess there has to be one due to server space. You're probably right about removing scripts - The only thing I could think of removing that would do much is removing a list (only about 1000 characters worth) and maybe a couple simpler ways of doing some current scripts.

Anyway, thanks for the information and for taking the time to answer my question,

greenninja1500
SGames1
Scratcher
1 post

Project won't save - I suspect due to too many scripts

My project won't save. I thought it was my internet but it isn't I legit went to a place with the fastest Internet in my city. It's quite a simple script, It's a version of Ping Pong which is like a super simple script. Also music does not work…
290Scratcher
Scratcher
1000+ posts

Project won't save - I suspect due to too many scripts

SGames1 wrote:

My project won't save. I thought it was my internet but it isn't I legit went to a place with the fastest Internet in my city. It's quite a simple script, It's a version of Ping Pong which is like a super simple script. Also music does not work…
Firstly it would be a better idea to create a new topic about this. Secondly the music may be the thing that's exceeding the size limit. Either way we can't do much without the project you have problems with.
mynamejosef
Scratcher
18 posts

Project won't save - I suspect due to too many scripts

Why is this forum still open?

Powered by DjangoBB