Discuss Scratch

MaxSalow
Scratcher
12 posts

How do I remove lag from my game?

I am having serious lag issues with my game and I am looking for anyone that can help me out! All help is appreciated! Thank you!
https://scratch.mit.edu/projects/138656053/#editor
WolfCat67
Scratcher
1000+ posts

How do I remove lag from my game?

Odds are, the vast amount of sprites, variables, and HUGE character list are what's causing the game to lag. Scratch doesn't have the beefiest or fastest servers, so it won't handle something that big too well.
I don't know how you'd be able to fix it; a lot of the sprites seem to have VERY similar programming, so maybe you could condense them into one sprite and make them clones?

Last edited by WolfCat67 (Jan. 19, 2017 01:31:52)

Despicable_Dad
Scratcher
500+ posts

How do I remove lag from my game?

Haven't looked at it in detail, but it might help to use IF then ELSE for your right-arrow / left-arrow presse and similar mutually exclusive (to all intents and purposes) situations.

Main thing: You're detecting touching scroll in two separate loops. Similar solution to above. One detects NOT, so perhaps put all that stuff after an ELSE in the other loop.

Not sure whether this suggestion is appropriate to your game, as I have only glanced at it, but could you use one sprite cloning all those Scrolls, so thast you're only having to test for IF touching a single thing.

Last edited by Despicable_Dad (Jan. 19, 2017 01:34:45)

MaxSalow
Scratcher
12 posts

How do I remove lag from my game?

Despicable_Dad wrote:

Haven't looked at it in detail, but it might help to use IF then ELSE for your right-arrow / left-arrow presse and similar mutually exclusive (to all intents and purposes) situations.

Main thing: You're detecting touching scroll in two separate loops. Similar solution to above. One detects NOT, so perhaps put all that stuff after an ELSE in the other loop.

Not sure whether this suggestion is appropriate to your game, as I have only glanced at it, but could you use one sprite cloning all those Scrolls, so thast you're only having to test for IF touching a single thing.
Ya but the thing is the not is for my costume change and the other is for my movement…

Last edited by MaxSalow (Jan. 19, 2017 01:42:22)

Despicable_Dad
Scratcher
500+ posts

How do I remove lag from my game?

MaxSalow wrote:

Ya but the thing is the not is for my costume change and the other is for my movement…

If I understand it right, you have one test that says basically…

IF touching things
THEN move

and another test that says

IF NOT touching things
THEN change costume.

Rearranging that to be:

IF touching things
THEN move
ELSE change costume

would surely reduce lag, especially given that nightmare of ORs.

Last edited by Despicable_Dad (Jan. 19, 2017 01:49:09)

MaxSalow
Scratcher
12 posts

How do I remove lag from my game?

Despicable_Dad wrote:

MaxSalow wrote:

Ya but the thing is the not is for my costume change and the other is for my movement…

If I understand it right, you have one test that says basically…

IF touching things
THEN move

and another test that says

IF NOT touching things
THEN change costume.

Rearranging that to be:

IF touching things
THEN move
ELSE change costume

would surely reduce lag, especially given that nightmare of ORs.
Ok i'll try it. Thank you!
MaxSalow
Scratcher
12 posts

How do I remove lag from my game?

WolfCat67 wrote:

Odds are, the vast amount of sprites, variables, and HUGE character list are what's causing the game to lag. Scratch doesn't have the beefiest or fastest servers, so it won't handle something that big too well.
I don't know how you'd be able to fix it; a lot of the sprites seem to have VERY similar programming, so maybe you could condense them into one sprite and make them clones?
I'm going to test out condensing all my scroll sprites into one sprite! Wish me luck and Thank you so much for helping!!

Last edited by MaxSalow (Jan. 19, 2017 01:53:18)

MaxSalow
Scratcher
12 posts

How do I remove lag from my game?

Despicable_Dad wrote:

Haven't looked at it in detail, but it might help to use IF then ELSE for your right-arrow / left-arrow presse and similar mutually exclusive (to all intents and purposes) situations.

Main thing: You're detecting touching scroll in two separate loops. Similar solution to above. One detects NOT, so perhaps put all that stuff after an ELSE in the other loop.

Not sure whether this suggestion is appropriate to your game, as I have only glanced at it, but could you use one sprite cloning all those Scrolls, so thast you're only having to test for IF touching a single thing.
Ok so now i changed the scrolling sprites to be all in the same sprite using stamps but now my scroll layer isnt showing up because the background layer is also using stamps please help!

Powered by DjangoBB