So I've been working on a project for about 2 years now, which means yes, I started with the first public version of Scratch. Anyway, when I try to play it, it runs really slowly. I was wondering if there was some sort of strategy on how to optimize scripts.
I'm really hoping for a response, as this would be another huge motivator to finally finish this project.

Offline
boinoinoi wrote:
So I've been working on a project for about 2 years now, which means yes, I started with the first public version of Scratch. Anyway, when I try to play it, it runs really slowly. I was wondering if there was some sort of strategy on how to optimize scripts.
I'm really hoping for a response, as this would be another huge motivator to finally finish this project.
Compress sound and Images. Remove ineccesary music and large images. So on... Hope that helps!
Offline
Tag4eva wrote:
boinoinoi wrote:
So I've been working on a project for about 2 years now, which means yes, I started with the first public version of Scratch. Anyway, when I try to play it, it runs really slowly. I was wondering if there was some sort of strategy on how to optimize scripts.
I'm really hoping for a response, as this would be another huge motivator to finally finish this project.Compress sound and Images. Remove ineccesary music and large images. So on... Hope that helps!
![]()
Boinoinoi has been with us for a very lon time and i think he knows that...anyways if you read the post carefully he specificly is talking about how to make the scripts not interfer with the game and make it not lag
Offline
SpriteX wrote:
Tag4eva wrote:
boinoinoi wrote:
So I've been working on a project for about 2 years now, which means yes, I started with the first public version of Scratch. Anyway, when I try to play it, it runs really slowly. I was wondering if there was some sort of strategy on how to optimize scripts.
I'm really hoping for a response, as this would be another huge motivator to finally finish this project.Compress sound and Images. Remove ineccesary music and large images. So on... Hope that helps!
![]()
Boinoinoi has been with us for a very lon time and i think he knows that...anyways if you read the post carefully he specificly is talking about how to make the scripts not interfer with the game and make it not lag
I didn't try to say that boinoinoi didn't know what I said but I was just trying to help. That actually hurt my feelings that you would think my comment was useless.
Offline
Tag4eva wrote:
SpriteX wrote:
Tag4eva wrote:
Compress sound and Images. Remove ineccesary music and large images. So on... Hope that helps!![]()
Boinoinoi has been with us for a very lon time and i think he knows that...anyways if you read the post carefully he specificly is talking about how to make the scripts not interfer with the game and make it not lag
I didn't try to say that boinoinoi didn't know what I said but I was just trying to help. That actually hurt my feelings that you would think my comment was useless.
well i am sorry if my post hurt your feelings but read my post again please. i was just Correcting you....also NOWHERE in my post said that your post was useless and i was just informing you ABOUT Boinoinoi. Also it sounds like you are trying to make me feel bad and i know you are trying to help. Sorry for any misunderstanding and Scratch-On! Hope you understand what i was trying to say.
Offline
SpriteX wrote:
Tag4eva wrote:
SpriteX wrote:
Boinoinoi has been with us for a very lon time and i think he knows that...anyways if you read the post carefully he specificly is talking about how to make the scripts not interfer with the game and make it not lagI didn't try to say that boinoinoi didn't know what I said but I was just trying to help. That actually hurt my feelings that you would think my comment was useless.
well i am sorry if my post hurt your feelings but read my post again please. i was just Correcting you....also NOWHERE in my post said that your post was useless and i was just informing you ABOUT Boinoinoi. Also it sounds like you are trying to make me feel bad and i know you are trying to help. Sorry for any misunderstanding and Scratch-On! Hope you understand what i was trying to say.
It's ok, I'll forgive you! Are we friends again? Well, I am!
Offline
Tag4eva wrote:
SpriteX wrote:
Tag4eva wrote:
I didn't try to say that boinoinoi didn't know what I said but I was just trying to help. That actually hurt my feelings that you would think my comment was useless.
well i am sorry if my post hurt your feelings but read my post again please. i was just Correcting you....also NOWHERE in my post said that your post was useless and i was just informing you ABOUT Boinoinoi. Also it sounds like you are trying to make me feel bad and i know you are trying to help. Sorry for any misunderstanding and Scratch-On! Hope you understand what i was trying to say.
It's ok, I'll forgive you! Are we friends again? Well, I am!
![]()
Yes we are and lets get back to topic!
Offline
fruit wrote:
Lawl, flame wars all over the place lately.
ok fruit...it is not a FLAME WAR...a FLAME WAR is if we called eachothers names like idiot or make fun of them...have i said any of thse things? No i haven't. All i have done is correct people that is it..So would you refer this as a Correct War?lolz
Offline
Okay, the little tiff between Tag4Eva and SpriteX has been resolved, no need to discuss that any further.
Anyway, back on topic:
I've heard that using Scratch's variable display can make a project sluggish. If you have variable displays showing and don't need the variable displays showing, have then hidden.
Other than that and what's given in other posts above, I can't think of anything else, except for perhaps rewriting the code for optimal use.

Offline
cheddargirl wrote:
Okay, the little tiff between Tag4Eva and SpriteX has been resolved, no need to discuss that any further.
Anyway, back on topic:
I've heard that using Scratch's variable display can make a project sluggish. If you have variable displays showing and don't need the variable displays showing, have then hidden.
Other than that and what's given in other posts above, I can't think of anything else, except for perhaps rewriting the code for optimal use.![]()
Great tips! Maybe you can ask Archmage for some tips since he is optimising Super Smash Scratch?
Offline
So... Here it goes:
• Make sure you hide all variable displays - they can in some cases slow down projects with 50%. You could use health bars etc instead.
• Try to avoid one of the following blocks in a forever loop:
[blocks]
<set[ ]effect to(
<change[ ]effect by(
<hide>
<show>
[/blocks]
Hide/Show blocks should only be run once, so, say you want to hide a sprite when it touches another sprite; you could do this:
When GF clicked
forever
if touching sprite1
hide
else
show
---
which slows down a project a lot, since you keep "activating" hide or show. Use this instead:
When GF clicked
forever
wait until touching sprite1
hide
wait until not touching sprite1
show
---
• Split up your scripts in different parts as much as you can - scripts work perfetly parallel but long scripts run really slow. If you are using a long calculation in your scripts, you could for example take it out and put it into another script (or even sprite!)
• When you need to do a whole bunch of calculations, put them on a different sprite and hide it.
Maybe you could upload your project and we can try to make it faster? I understand if you don't want to, I also have those 2yrs projects and in myn case, I'd like to finish them on my own xD
Offline
boinoinoi wrote:
So I've been working on a project for about 2 years now, which means yes, I started with the first public version of Scratch. Anyway, when I try to play it, it runs really slowly. I was wondering if there was some sort of strategy on how to optimize scripts.
I'm really hoping for a response, as this would be another huge motivator to finally finish this project.
Instead of 40 variables use 1 list with 40 items. Use replace item (number) blocks instead of add and set to blocks. You may need to write down what number each variable is but I believe this will speed up the project...
This is 1.3 and beyond. There are no lists before that.
Offline
juststickman wrote:
boinoinoi wrote:
So I've been working on a project for about 2 years now, which means yes, I started with the first public version of Scratch. Anyway, when I try to play it, it runs really slowly. I was wondering if there was some sort of strategy on how to optimize scripts.
I'm really hoping for a response, as this would be another huge motivator to finally finish this project.Instead of 40 variables use 1 list with 40 items. Use replace item (number) blocks instead of add and set to blocks. You may need to write down what number each variable is but I believe this will speed up the project...
This is 1.3 and beyond. There are no lists before that.
Only problem with this is you can't really display... But like cheddagirl said, that will slow things down.
Offline
JSO wrote:
• Split up your scripts in different parts as much as you can - scripts work perfetly parallel but long scripts run really slow. If you are using a long calculation in your scripts, you could for example take it out and put it into another script (or even sprite!)
That strikes me as somewhat funny, since I had been putting the scripts into single long scripts. Time to take 'em apart XD
juststickman wrote:
Instead of 40 variables use 1 list with 40 items. Use replace item (number) blocks instead of add and set to blocks. You may need to write down what number each variable is but I believe this will speed up the project...
This is 1.3 and beyond. There are no lists before that.
I'm not sure whether that would help or not. I have about 20 variables, all used extensively, and redoing them all would be a real pain. What would help would be a make-your-own-boolean.
Tag4eva wrote:
boinoinoi wrote:
So I've been working on a project for about 2 years now, which means yes, I started with the first public version of Scratch. Anyway, when I try to play it, it runs really slowly. I was wondering if there was some sort of strategy on how to optimize scripts.
I'm really hoping for a response, as this would be another huge motivator to finally finish this project.Compress sound and Images. Remove ineccesary music and large images. So on... Hope that helps!
![]()
Haha, you actually have a point. For the last few versions, I've had WAY too much music.
JSO wrote:
Maybe you could upload your project and we can try to make it faster? I understand if you don't want to, I also have those 2yrs projects and in myn case, I'd like to finish them on my own xD
There have been 7 versions I've put up already, but the current one is a lot different and is saved in 1.4... So even if I DID share it, only a select few would be able to help me.
Anyways, more help is always appreciated, and this is serving as a great distraction for my term paper. Don't think that you can't still help.
Last edited by boinoinoi (2009-06-07 12:42:42)

Offline
this is where the difference comes between a good programmer, and a really good programmer. Basicly, its all about the details. Every block that you use, but don't need is a waste of space and will slow everything down. Loops must be used with care, if you dont need it, once again, dont use it. go through everything, and make sure that you cant think of a better way to calculate something using less (maybe more complex) scripts. Good luck optimizing
. One day i will check to see which work better, built in scratch blocks V more basic blocks to acomplish the same task as the built in (using sine/cosine instead of move X blocks, and so on...)
Offline
boinoinoi wrote:
JSO wrote:
• Split up your scripts in different parts as much as you can - scripts work perfetly parallel but long scripts run really slow. If you are using a long calculation in your scripts, you could for example take it out and put it into another script (or even sprite!)
That strikes me as somewhat funny, since I had been putting the scripts into single long scripts. Time to take 'em apart XD
juststickman wrote:
Instead of 40 variables use 1 list with 40 items. Use replace item (number) blocks instead of add and set to blocks. You may need to write down what number each variable is but I believe this will speed up the project...
This is 1.3 and beyond. There are no lists before that.I'm not sure whether that would help or not. I have about 20 variables, all used extensively, and redoing them all would be a real pain. What would help would be a make-your-own-boolean.
Tag4eva wrote:
boinoinoi wrote:
So I've been working on a project for about 2 years now, which means yes, I started with the first public version of Scratch. Anyway, when I try to play it, it runs really slowly. I was wondering if there was some sort of strategy on how to optimize scripts.
I'm really hoping for a response, as this would be another huge motivator to finally finish this project.Compress sound and Images. Remove ineccesary music and large images. So on... Hope that helps!
![]()
Haha, you actually have a point. For the last few versions, I've had WAY too much music.
JSO wrote:
Maybe you could upload your project and we can try to make it faster? I understand if you don't want to, I also have those 2yrs projects and in myn case, I'd like to finish them on my own xD
There have been 7 versions I've put up already, but the current one is a lot different and is saved in 1.4... So even if I DID share it, only a select few would be able to help me.
Anyways, more help is always appreciated, and this is serving as a great distraction for my term paper. Don't think that you can't still help.
I can help, I got 1.4
Offline
What is it? If it has choices to choose different sprites, make those sprites one. THIS IS MY 50'th POST! YAY!
Offline