Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Is there any way to reduce lag further?
- Malicondi
-
Scratcher
1000+ posts
Is there any way to reduce lag further?
Currently, I'm making a 100% pen game, and before you ask, yes i use custom blocks with minimal code. But i still have over 900 blocks and starting to experience lag. Is there any (effective) way to reduce lag?
my project
my project
Last edited by Malicondi (Feb. 6, 2024 15:08:49)
- EDawg2011
-
Scratcher
1000+ posts
Is there any way to reduce lag further?
Please share the project and give us the link so that we can help better. 

- Malicondi
-
Scratcher
1000+ posts
Is there any way to reduce lag further?
Please share the project and give us the link so that we can help better.im just looking for general tips, rather than code optimization, for now.
- EDawg2011
-
Scratcher
1000+ posts
Is there any way to reduce lag further?
But it's hard to give you much help without the project.Please share the project and give us the link so that we can help better.im just looking for general tips, rather than code optimization, for now.
“Sorry, you have to wait 60 seconds between posts.”
- Malicondi
-
Scratcher
1000+ posts
Is there any way to reduce lag further?
my code may be a little messy but heres the project: https://scratch.mit.edu/projects/961633917/But it's hard to give you much help without the project.Please share the project and give us the link so that we can help better.im just looking for general tips, rather than code optimization, for now.
“Sorry, you have to wait 60 seconds between posts.”
- ProfessorUelf
-
Scratcher
100+ posts
Is there any way to reduce lag further?
It is not shared. A project shouldn't lag already at 900 blocks.my code may be a little messy but heres the project: https://scratch.mit.edu/projects/961633917/But it's hard to give you much help without the project.Please share the project and give us the link so that we can help better.im just looking for general tips, rather than code optimization, for now.
“Sorry, you have to wait 60 seconds between posts.”
- Cool_Dude2022
-
Scratcher
500+ posts
Is there any way to reduce lag further?
Currently, I'm making a 100% pen game, and before you ask, yes i use custom blocks with minimal code. But i still have over 900 blocks and starting to experience lag. Is there any (effective) way to reduce lag?The project is unshared. This lag could be due to the amount of clones, variables, or even using the pen's “stamp” feature can cause this.
my project
- Malicondi
-
Scratcher
1000+ posts
Is there any way to reduce lag further?
i have 0 costumes, and 1 sprite and only 17 variables, with 0 clones, also screen is cleared every tick so theres no pen build up.Currently, I'm making a 100% pen game, and before you ask, yes i use custom blocks with minimal code. But i still have over 900 blocks and starting to experience lag. Is there any (effective) way to reduce lag?The project is unshared. This lag could be due to the amount of clones, variables, or even using the pen's “stamp” feature can cause this.
my project
also i did share the project let me see if i gave the wrong link.
link: https://scratch.mit.edu/projects/961633917/
maybe its just me or my operating system, but it's laggy.
Last edited by Malicondi (Feb. 6, 2024 15:09:36)
- Jareddddddd
-
Scratcher
1000+ posts
Is there any way to reduce lag further?
Normally in pen projects, the main source of lag comes from the amount of moves that the renderer moves. An average computer can run anywhere from 2000 to 5000 moves in a frame.
Now I can't do much without Turbowarp's features regarding specifically this project, but I can suggest a few changes
1 - Use an engine
Now I know some people don't like the idea of using someone else's code, but in cases such as yours, an extremely optimized engine such as this tris filler by @MentalBox. I know there's a better engine by someone named @Rex or something, but I can't find it.
2 - Using stamping to replace movement
Many simple lines or boxes can be replaced by a well-placed stamp. This can reduce the moves needed by about 1 or 2, but this adds up real quickly.
3 - Minimize loops
A static screen can be optimized to run only once. In your example, instead of redrawing the “Loading” text fully for the 3 dots, draw it once, and only reset it once you need to.
Now I can't do much without Turbowarp's features regarding specifically this project, but I can suggest a few changes
1 - Use an engine
Now I know some people don't like the idea of using someone else's code, but in cases such as yours, an extremely optimized engine such as this tris filler by @MentalBox. I know there's a better engine by someone named @Rex or something, but I can't find it.
2 - Using stamping to replace movement
Many simple lines or boxes can be replaced by a well-placed stamp. This can reduce the moves needed by about 1 or 2, but this adds up real quickly.
3 - Minimize loops
A static screen can be optimized to run only once. In your example, instead of redrawing the “Loading” text fully for the 3 dots, draw it once, and only reset it once you need to.
- Malicondi
-
Scratcher
1000+ posts
Is there any way to reduce lag further?
Thanks for the help everyone!
- Discussion Forums
- » Help with Scripts
-
» Is there any way to reduce lag further?