This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-04-18 04:58:02

Shruikan42
Scratcher
Registered: 2007-10-26
Posts: 23

Problem with lag

I have a problem with lag in Scratch which I don't think has appeared in the forums. Here goes:
!!!!!
EDIT: problem solved. Scroll down a few posts to read how.
!!!!!
I'm creating a game with lots of variables(that is, 40+). The problem is, whenever I show 6 particular variables, the game lags horribly, in presentation mode and out. The 6 variables shouldn't cause a lot of lag; there aren't many scripts attached to them and there are many other variables in the game which are more often used, but showing ANY ONE of them will cause the game to lag a bit more; the six being shown together make the game nearly unplayable. I even have an earlier version of the game (called Maple Defence, you can play it if you want) with the same amount of variables and 4 out of the 6 mentioned variables in the game. It works fine and lags less despite being smaller with all of those 4 variables showing. Is there any reason why the variables are causing so much lag? The new version of the game has 24 variables showing, 30 with the offending 6 variables, and the old version has 24. However, I am certain the number of variables showing isn't the problems.

I can tell you more if needed or even upload the project.

Thank you for your time.

P.S. I'm not sure if this belongs in the troubleshooting section, you can move it if you want.

Last edited by Shruikan42 (2009-04-22 12:25:35)


http://scratch.mit.edu/users/Shruikan42 <Go on, click the pretty link, I know it's tempting!

Offline

 

#2 2009-04-18 13:07:41

hmnwilson
Scratcher
Registered: 2007-07-04
Posts: 1000+

Re: Problem with lag

Variables make projects lag a lot because it has to update the display all the time. I don't think there's a way around it yet, but you could try turning on single stepping to turbo (shift-click on Extras, select set single stepping, and then turbo speed), but it also makes the game run a lot faster.


I'm taking a break from Scratch until 2.0 comes out. Any messages sent between then and now probably won't be read - sorry.
(Oct. 20, 2011)

Offline

 

#3 2009-04-18 14:02:10

Shruikan42
Scratcher
Registered: 2007-10-26
Posts: 23

Re: Problem with lag

What's weird about this project is that 6 particular variables with no special traits make it lag. Never knew about turbo speed though, thanks for the help  smile


Edit: This didn't solve my problems (the game still lags) but it did teach me more about Scratch. Thanks!

Last edited by Shruikan42 (2009-04-18 15:37:29)


http://scratch.mit.edu/users/Shruikan42 <Go on, click the pretty link, I know it's tempting!

Offline

 

#4 2009-04-18 15:44:48

Shruikan42
Scratcher
Registered: 2007-10-26
Posts: 23

Re: Problem with lag

Now I've replaced the offending variables with new ones and the lag persists. The only way to stop the lag is to hide the variables. But they're essential to the game... I guess I'll mess around with some of the scripts containing those variables.


http://scratch.mit.edu/users/Shruikan42 <Go on, click the pretty link, I know it's tempting!

Offline

 

#5 2009-04-22 12:24:06

Shruikan42
Scratcher
Registered: 2007-10-26
Posts: 23

Re: Problem with lag

YES!!! I KNOW WHY!

Long story short:
NORMAL READOUT causes Scratch to lag. I am certain now; I discovered this while fiddling around with variables and I have tested it. The variables which were causing the lag were the only ones shown in normal readout. That's why they lagged the game so badly.

So if you're making a large project that's likely to lag, DON'T SHOW VARIABLES IN NORMAL READOUT!


http://scratch.mit.edu/users/Shruikan42 <Go on, click the pretty link, I know it's tempting!

Offline

 

#6 2009-04-22 17:00:41

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Problem with lag

Shruikan42 wrote:

YES!!! I KNOW WHY!

Long story short:
NORMAL READOUT causes Scratch to lag. I am certain now; I discovered this while fiddling around with variables and I have tested it. The variables which were causing the lag were the only ones shown in normal readout. That's why they lagged the game so badly.

So if you're making a large project that's likely to lag, DON'T SHOW VARIABLES IN NORMAL READOUT!

Interesting!  So large format or slider format is preferable to normal format?


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#7 2009-04-23 12:30:51

Shruikan42
Scratcher
Registered: 2007-10-26
Posts: 23

Re: Problem with lag

Paddle2See wrote:

Shruikan42 wrote:

YES!!! I KNOW WHY!

Long story short:
NORMAL READOUT causes Scratch to lag. I am certain now; I discovered this while fiddling around with variables and I have tested it. The variables which were causing the lag were the only ones shown in normal readout. That's why they lagged the game so badly.

So if you're making a large project that's likely to lag, DON'T SHOW VARIABLES IN NORMAL READOUT!

Interesting!  So large format or slider format is preferable to normal format?

I've never used slider, but I've used large. It is preferable to normal format. Even showing 2 variables in normal format makes a difference.


http://scratch.mit.edu/users/Shruikan42 <Go on, click the pretty link, I know it's tempting!

Offline

 

Board footer