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

#26 2009-01-02 19:29:56

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Need help reducing lag in project

Anyway about the lag problem, I still have no ideas about the animation delay stuff, but I have one idea which I don't think will help, but its to get rid of the "attacking" variable and on the sandbag you know it'll sence as long as the costume isn't blah blah blah, etc. you know the rest I know its a bad idea I'm just getting crazy and I know it.

P.S. When on your forum sig it says "Update: Now play as blah blah blah", when archmage is in the game, it should say "UPDATE: Now play as the teenage bearded scratcher, archmage!" lol

Last edited by Lucario621 (2009-01-02 19:32:29)


http://i.imgur.com/WBkM2QQ.png

Offline

 

#27 2009-01-02 19:32:32

Zelda123
Scratcher
Registered: 2007-11-21
Posts: 1000+

Re: Need help reducing lag in project

Do you think splitting up some of the big, long scripts will help? It may make it a bigger size but it may run faster in normal mode.

Offline

 

#28 2009-01-02 19:35:55

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Need help reducing lag in project

Zelda123 wrote:

Do you think splitting up some of the big, long scripts will help? It may make it a bigger size but it may run faster in normal mode.

Hmmmmm, you may have something there. I will try splitting up the animation scripts and see what happens.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#29 2009-01-02 19:37:27

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Need help reducing lag in project

Lucario621 wrote:

Anyway about the lag problem, I still have no ideas about the animation delay stuff, but I have one idea which I don't think will help, but its to get rid of the "attacking" variable and on the sandbag you know it'll sence as long as the costume isn't blah blah blah, etc. you know the rest I know its a bad idea I'm just getting crazy and I know it.

P.S. When on your forum sig it says "Update: Now play as blah blah blah", when archmage is in the game, it should say "UPDATE: Now play as the teenage bearded scratcher, archmage!" lol

No, I don't have a beard.

It will probably be along the lines of

UPDATE: The character roster is finally complete! Now play as me, the Archmage.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#30 2009-01-02 19:38:41

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Need help reducing lag in project

Zelda123 wrote:

Do you think splitting up some of the big, long scripts will help? It may make it a bigger size but it may run faster in normal mode.

Well theres about 1 script for every character + 4 or 5


http://i.imgur.com/WBkM2QQ.png

Offline

 

#31 2009-01-02 19:41:35

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Need help reducing lag in project

Lucario621 wrote:

Zelda123 wrote:

Do you think splitting up some of the big, long scripts will help? It may make it a bigger size but it may run faster in normal mode.

Well theres about 1 script for every character + 4 or 5

1 long script per character and 3 more for controls. I will try splitting them up later.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#32 2009-01-02 19:41:44

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Need help reducing lag in project

archmage wrote:

Zelda123 wrote:

Do you think splitting up some of the big, long scripts will help? It may make it a bigger size but it may run faster in normal mode.

Hmmmmm, you may have something there. I will try splitting up the animation scripts and see what happens.

Hmmmmm, something about this sounds crazy. 18 stances/animation scripts X 8 characters + 5 other scripts =  149 scripts....yeah thats reasonable enough for me =P


http://i.imgur.com/WBkM2QQ.png

Offline

 

#33 2009-01-02 19:43:04

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Need help reducing lag in project

Lucario621 wrote:

archmage wrote:

Zelda123 wrote:

Do you think splitting up some of the big, long scripts will help? It may make it a bigger size but it may run faster in normal mode.

Hmmmmm, you may have something there. I will try splitting up the animation scripts and see what happens.

Hmmmmm, something about this sounds crazy. 18 stances/animation scripts X 8 characters + 5 other scripts =  149 scripts....yeah thats reasonable enough for me =P

It isn't crazy if if it is purposeful.  wink


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#34 2009-01-02 19:45:30

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Need help reducing lag in project

Hey I just realized something super-awesomely-amazing! Your not working on Pheonix Wright! Partey yeah! Shake your bootay yeah....


http://i.imgur.com/WBkM2QQ.png

Offline

 

#35 2009-01-02 19:49:30

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Need help reducing lag in project

Well I'm testing your purposeful idea with just mario and I'll upload it, and see if theres any difference....its a long process though.


http://i.imgur.com/WBkM2QQ.png

Offline

 

#36 2009-01-02 19:50:59

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Need help reducing lag in project

Lucario621 wrote:

Hey I just realized something super-awesomely-amazing! Your not working on Pheonix Wright! Partey yeah! Shake your bootay yeah....

I told my brother that he has to finish Phoenix Wright 2 before I continue to code his game. He hasn't beat it yet.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#37 2009-01-02 19:53:43

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Need help reducing lag in project

archmage wrote:

Lucario621 wrote:

Hey I just realized something super-awesomely-amazing! Your not working on Pheonix Wright! Partey yeah! Shake your bootay yeah....

I told my brother that he has to finish Phoenix Wright 2 before I continue to code his game. He hasn't beat it yet.

Lol I like the idea. I'll hope that doesn't happen though.


http://i.imgur.com/WBkM2QQ.png

Offline

 

#38 2009-01-02 20:04:05

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Need help reducing lag in project

(after doing that idea and making the game into 30 scripts) Well I tested it, and I can tell its faster, but has more glitches. Apparently, it seems that because it only changes the stance for less than a second and then back to fall or standing quickly, its only the new stance for that amount of time. Should I upload it?

Last edited by Lucario621 (2009-01-02 20:05:55)


http://i.imgur.com/WBkM2QQ.png

Offline

 

#39 2009-01-02 20:25:40

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Need help reducing lag in project

Though for some reason the standard p and the standard o work perfectly. And they all do damage, eventhough you do the attack for only half a second.

Last edited by Lucario621 (2009-01-02 20:27:23)


http://i.imgur.com/WBkM2QQ.png

Offline

 

#40 2009-01-02 20:29:14

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Need help reducing lag in project

Lucario621 wrote:

(after doing that idea and making the game into 30 scripts) Well I tested it, and I can tell its faster, but has more glitches. Apparently, it seems that because it only changes the stance for less than a second and then back to fall or standing quickly, its only the new stance for that amount of time. Should I upload it?

You are getting problems because it it trying to get out of a repeat loop animation.

All that really matters is that it goes faster while playing in the online player. Upload it and see if it runs better online, I can fix all the bugs later.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#41 2009-01-02 20:30:35

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Need help reducing lag in project

archmage wrote:

Lucario621 wrote:

(after doing that idea and making the game into 30 scripts) Well I tested it, and I can tell its faster, but has more glitches. Apparently, it seems that because it only changes the stance for less than a second and then back to fall or standing quickly, its only the new stance for that amount of time. Should I upload it?

You are getting problems because it it trying to get out of a repeat loop animation.

All that really matters is that it goes faster while playing in the online player. Upload it and see if it runs better online, I can fix all the bugs later.

Well I can't really test it if only a projectile and one punch attack works...though I'll try.

Last edited by Lucario621 (2009-01-02 20:31:13)


http://i.imgur.com/WBkM2QQ.png

Offline

 

#42 2009-01-02 20:32:27

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Need help reducing lag in project

Lucario621 wrote:

archmage wrote:

Lucario621 wrote:

(after doing that idea and making the game into 30 scripts) Well I tested it, and I can tell its faster, but has more glitches. Apparently, it seems that because it only changes the stance for less than a second and then back to fall or standing quickly, its only the new stance for that amount of time. Should I upload it?

You are getting problems because it it trying to get out of a repeat loop animation.

All that really matters is that it goes faster while playing in the online player. Upload it and see if it runs better online, I can fix all the bugs later.

Well I can't really test it if only a projectile and one punch attack works...though I'll try.

That isn't important. What is important is that it moves without lag in the online player. It should look like it is switching between different costumes strangely but that is ok.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#43 2009-01-02 20:38:55

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Need help reducing lag in project

archmage wrote:

Lucario621 wrote:

archmage wrote:


You are getting problems because it it trying to get out of a repeat loop animation.

All that really matters is that it goes faster while playing in the online player. Upload it and see if it runs better online, I can fix all the bugs later.

Well I can't really test it if only a projectile and one punch attack works...though I'll try.

That isn't important. What is important is that it moves without lag in the online player. It should look like it is switching between different costumes strangely but that is ok.

I'll try out mine once it finishes uploading, though the odds are it will definately be better because if I can atleast LOAD mine, then it'll be better, because for me, if I goto your ssbb roster thing, it won't load, it practically freezes.


http://i.imgur.com/WBkM2QQ.png

Offline

 

#44 2009-01-02 20:52:07

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Need help reducing lag in project

Lucario621 wrote:

archmage wrote:

Lucario621 wrote:


Well I can't really test it if only a projectile and one punch attack works...though I'll try.

That isn't important. What is important is that it moves without lag in the online player. It should look like it is switching between different costumes strangely but that is ok.

I'll try out mine once it finishes uploading, though the odds are it will definately be better because if I can atleast LOAD mine, then it'll be better, because for me, if I goto your ssbb roster thing, it won't load, it practically freezes.

If you can't get past the loading screen then you need to fix your java player.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#45 2009-01-02 20:52:52

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Need help reducing lag in project

...this is so stupid. *sigh* it won't even upload, thats why I hate this computer...this is so annoying.


http://i.imgur.com/WBkM2QQ.png

Offline

 

#46 2009-01-02 21:02:06

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Need help reducing lag in project

Look whatever I closed all my stuff, you can easily do it, cuz I can but can't upload sry.


http://i.imgur.com/WBkM2QQ.png

Offline

 

#47 2009-01-02 21:12:25

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Need help reducing lag in project

Lag is the dark side, me being Chewbacca can't defeat it, only you Luke Skywalker, can defeat it Archmage,


http://i.imgur.com/WBkM2QQ.png

Offline

 

#48 2009-01-03 11:18:26

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Need help reducing lag in project

Ok I think I figured out a way to fix the lag issue and make it quite fast, but it will require me to break up my beautiful code in to many man y pieces  sad

Each character has about 17 stances which include running, standing, attacking, ect.

So right now I have the code set up like this.

When I recieve charselect
forever
if (charselect==1)  //1 is mario by the way
if(stance==1)
//code to stand
}
if (stance==2)
//code to jump
}
//Repeat this 15 more times

What I think is slowing everything down is that scratch has to go through my large pile of if statements to get to the if statement it has to run. So the code it is running shouldn't be the problem but rather the other if blocks it has to test for are causing problems.

I will try to arange the code like this now

when I recieve stancechange  //I'll make to put in some new broadcasts
if (char==1 && spriteActive)  //The sprite active variable says if it is already running an animation
if (stance==1)
//code to stand
}
else{
end script
}
else{
end script
}

EDIT: Please don't bug me about the syntax of this "script"
It is just meant to show the general operation of my scratch scripts.

And I have to do this for every stance of every character which would result in about 17*8 more scripts in the project. (I've already put so much time into this that making those scripts won't even be that big of a deal.)

Now in theory this should work out because now only a very small animation script will be running at a time. I will do tests to see if this works.

Last edited by archmage (2009-01-03 13:36:25)


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#49 2009-01-03 11:56:09

Nick60
Scratcher
Registered: 2007-06-17
Posts: 100+

Re: Need help reducing lag in project

Archmage this is just a random question.  Have you ever really coded Java?  I'm guessing probably not because what you wrote wouldn't be correct if you applied it.

Last edited by Nick60 (2009-01-03 11:57:31)


Let's  Be Blue!

Offline

 

#50 2009-01-03 12:21:20

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Need help reducing lag in project

archmage wrote:

Ok I think I figured out a way to fix the lag issue and make it quite fast, but it will require me to break up my beautiful code in to many man y pieces  sad

Each character has about 17 stances which include running, standing, attacking, ect.

So right now I have the code set up like this.

When I recieve charselect
forever
if (charselect==1)  //1 is mario by the way
if(stance==1)
//code to stand
}
if (stance==2)
//code to jump
}
//Repeat this 15 more times

What I think is slowing everything down is that scratch has to go through my large pile of if statements to get to the if statement it has to run. So the code it is running shouldn't be the problem but rather the other if blocks it has to test for are causing problems.

I will try to arange the code like this now

when I recieve stancechange  //I'll make to put in some new broadcasts
if (char==1 && spriteActive)  //The sprite active variable says if it is already running an animation
if (stance==1)
//code to stand
}
else{
end script
}
else{
end script
}

And I have to do this for every stance of every character which would result in about 17*8 more scripts in the project. (I've already put so much time into this that making those scripts won't even be that big of a deal.)

Now in theory this should work out because now only a very small animation script will be running at a time. I will do tests to see if this works.

...Yeah you sure don't lie when you say actionscripting is your thing. You use == all the time =P


http://i.imgur.com/WBkM2QQ.png

Offline

 

Board footer