Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » The Scratch Clone Limit
- 55nn
-
Scratcher
17 posts
The Scratch Clone Limit
Hey guys! I am making a scrolling map of the world with all the countries and states. Problem is, there are well more then 300 countries and states. I know, eventually, I will hit the clone limit, and I see no way around it. I could try stamps, but you would get like 3 FPS while scrolling. I already have mechanics in place, like deleting the provinces when the countries aren't selected, but the USA has 50 states, and there are like ~300 countries alone. I plan to add every country. If anyone has a solution to this, it would help a lot.
Here is the project: https://scratch.mit.edu/projects/516212569/
Here is the project: https://scratch.mit.edu/projects/516212569/
- UndertaleSuxatcoding
-
Scratcher
29 posts
The Scratch Clone Limit
my advice is just not use clones and justuse duplicates of sprites
- 55nn
-
Scratcher
17 posts
The Scratch Clone Limit
my advice is just not use clones and justuse duplicates of spritesThere would be 1000 sprites in no time and an hour loading time.
- TheAnomalousPseudo
-
Scratcher
1000+ posts
The Scratch Clone Limit
What if you make one clone for each continent, then when you click on one, it deletes them all and makes new ones for the countries of the clicked continent?
- han614698
-
Scratcher
1000+ posts
The Scratch Clone Limit
my advice is just not use clones and justuse duplicates of spritesYou can't have 300+ sprites without lag. I suggest you delete the clones when they move off the screen, then add them back when they come back on.
- 55nn
-
Scratcher
17 posts
The Scratch Clone Limit
my advice is just not to use clones and just use duplicates of spritesYou can't have 300+ sprites without lag. I suggest you delete the clones when they move off the screen, then add them back when they come back on.
my advice is just not to use clones and just use duplicates of spritesYou can't have 300+ sprites without lag. I suggest you delete the clones when they move off the screen, then add them back when they come back on.
That would probably be the best solution, only thing is that it may be a problem when zooming out that the clone limit may be reached.
- 55nn
-
Scratcher
17 posts
The Scratch Clone Limit
What if you make one clone for each continent, then when you click on one, it deletes them all and makes new ones for the countries of the clicked continent?I want people to see all the countries when zoomed out.
- deck26
-
Scratcher
1000+ posts
The Scratch Clone Limit
I suspect you'll hit problems however you do this - the space just required for costumes is probably going to hit the limits of Scratch.
Deleting and recreating clones is less effective, generally, than reusing them. So if a clone goes off-screen it is avialable to be given a new costume and location when you next need a clone.
Deleting and recreating clones is less effective, generally, than reusing them. So if a clone goes off-screen it is avialable to be given a new costume and location when you next need a clone.
- TheAnomalousPseudo
-
Scratcher
1000+ posts
The Scratch Clone Limit
Do you need to have a map that the user is free to rotate and zoom on? Could you do this? Make a map of the continents, then when you click on a continent, there's a cool zoom animation and you delete the continent clones and make country clones. Next, you click on a country and the province/state clones appear.
- 55nn
-
Scratcher
17 posts
The Scratch Clone Limit
I suspect you'll hit problems however you do this - the space just required for costumes is probably going to hit the limits of Scratch.There are no limits on the amount of costumes.
Deleting and recreating clones is less effective, generally, than reusing them. So if a clone goes off-screen it is avialable to be given a new costume and location when you next need a clone.
- TheAnomalousPseudo
-
Scratcher
1000+ posts
The Scratch Clone Limit
They do take up space in your project, though.I suspect you'll hit problems however you do this - the space just required for costumes is probably going to hit the limits of Scratch.There are no limits on the amount of costumes.
Deleting and recreating clones is less effective, generally, than reusing them. So if a clone goes off-screen it is avialable to be given a new costume and location when you next need a clone.
- deck26
-
Scratcher
1000+ posts
The Scratch Clone Limit
There is a memory limit for graphics as far as I'm aware but don't know the details. There is also the limit on overall memory for the project. Either way you can't reallly say there are no limits for costumes.I suspect you'll hit problems however you do this - the space just required for costumes is probably going to hit the limits of Scratch.There are no limits on the amount of costumes.
Deleting and recreating clones is less effective, generally, than reusing them. So if a clone goes off-screen it is avialable to be given a new costume and location when you next need a clone.
- Yusei-Fudo
-
Scratcher
1000+ posts
The Scratch Clone Limit
Maybe try making 1 country 1 level instead of trying to make them all at the same time?
- dhuls
-
Scratcher
1000+ posts
The Scratch Clone Limit
Turbowarp lets you remove the clone limit. I don't think there's a way around this limit in vanilla scratch (without deleting and re-adding clones) If you want to force people to use Turbowarp use this script:
when green flag clicked
if <not <is compiled?>> then
stop [all v]
end
- Yusei-Fudo
-
Scratcher
1000+ posts
The Scratch Clone Limit
Turbowarp lets you remove the clone limit. I don't think there's a way around this limit in vanilla scratch (without deleting and re-adding clones) If you want to force people to use Turbowarp use this script:when green flag clicked
if <not <is compiled?>> then
stop [all v]
end
But then how many people would use turbowarp? There are workarounds instead of having to use different websites (Not the kind to bypass 300 clone limit).
- fireandforgetting
-
New Scratcher
4 posts
The Scratch Clone Limit
have a main sprite with all the countries and handle them as clones only when the mouse is in their bounding box, with coords stored in 4 lists.
- 55nn
-
Scratcher
17 posts
The Scratch Clone Limit
have a main sprite with all the countries and handle them as clones only when the mouse is in their bounding box, with coords stored in 4 lists.Already considered. The details of all the countries would surpass the 10MB custome limit.
- 55nn
-
Scratcher
17 posts
The Scratch Clone Limit
Deleting and recreating clones is less effective, generally, than reusing them. So if a clone goes off-screen it is avialable to be given a new costume and location when you next need a clone.Using this method with a mixture of stamps.
Last edited by 55nn (May 8, 2021 23:33:37)
- Cinderpelt9
-
Scratcher
75 posts
The Scratch Clone Limit
my advice is just not use clones and justuse duplicates of spritesYou can't have 300+ sprites without lag. I suggest you delete the clones when they move off the screen, then add them back when they come back on.
What if you used a combination of both clones and different sprites? Say, one sprite for Australia, a few for Europe, a few for Asia, one for North America, a couple for South America and a few for Africa, then one for all the islands that don't fall under any of those, and just use clones of those sprites as the countries? Might lighten up the load a little.
- MiniCoder11
-
Scratcher
100+ posts
The Scratch Clone Limit
If you are only stamping countries recognized by the United States, you will have less than 200 clones on the screen which should not be an issue. If you are going to stamp the 251 countries and territories recognized by the United Nations, you still haven't exceeded the clone limit. However, if you begin to add more large cities from each country or landmarks to the map, you can use stamping about 3,000 times per frame with minimal performance impacts (as shown here in this test: https://scratch.mit.edu/projects/527761082/). 3,000 stamps-per-frame still runs smoothly on my computer at thirty frames-per-second.
Another thing to note is that if your project becomes too slow or ends up requiring more than 300 clones, you can use TurboWarp to fix both of those issues either by disabling TurboWarp's clone limit or by using its compiler to run your Scratch project at much higher framerates.
Another thing to note is that if your project becomes too slow or ends up requiring more than 300 clones, you can use TurboWarp to fix both of those issues either by disabling TurboWarp's clone limit or by using its compiler to run your Scratch project at much higher framerates.
Last edited by MiniCoder11 (May 9, 2021 04:11:40)
- Discussion Forums
- » Help with Scripts
-
» The Scratch Clone Limit