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

#51 2009-01-03 13:33:44

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

Re: Need help reducing lag in project

Nick60 wrote:

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.

I can program in java. However, that code wasn't syntactically correct, I know this. I took a course in Java programming at school. Obviously I didn't meant to apply this code because I was referring to scratch code.

I meant it to be a sort of pseudo code


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

 

#52 2009-01-03 13:35:16

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

Re: Need help reducing lag in project

Lucario621 wrote:

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

== is the proper way to check for equality in several programming languages.

= only sets a value


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

 

#53 2009-01-03 15:22:37

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

Re: Need help reducing lag in project

archmage wrote:

Lucario621 wrote:

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

== is the proper way to check for equality in several programming languages.

= only sets a value

Lol I know that because I looked at a newgrounds tutorial collab 07 I think. I mean I'd love to try out flash, but right now my computers are slow, so I'm going to wait till I get my own laptop.


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

Offline

 

#54 2009-01-03 20:23:57

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

Re: Need help reducing lag in project

To prove I know java here is one of my programing assignments from last year. It is pretty simple, you enter a value and it says if it finds the value in an array.
http://rapidshare.com/files/179541889/Array_Prog5_9.java.html

Also lucario621, you should try Greenfoot.
It has its own website not unlike scratch
http://greenfootgallery.org/

The actual program uses Java so you get real programing experience. It also has all the features and power you will need.


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

 

#55 2009-01-03 20:26:34

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

Re: Need help reducing lag in project

I made some tutorials related to Java.  Such as Arrays, Static Methods, Integers (and how to declare/apply), booleans and switch statements.  Anyways back on topic. ;D


Let's  Be Blue!

Offline

 

#56 2009-01-03 20:32:27

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

Re: Need help reducing lag in project

Nick60 wrote:

I made some tutorials related to Java.  Such as Arrays, Static Methods, Integers (and how to declare/apply), booleans and switch statements.  Anyways back on topic. ;D

Ah yes  wink
I learned about those things in my classes. All those things are pretty basic though.

Anyways, I will do a small test to see if my lag reduction idea works and if it does I will apply it to all of the scripts.

Last edited by archmage (2009-01-03 20:37:58)


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

 

#57 2009-01-03 23:47:24

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

Re: Need help reducing lag in project

Ok, this is a small test to see if splitting up the code works will reducing lag. This only runs the needed animation scripts.
http://scratch.mit.edu/projects/archtest/370843


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

 

#58 2009-01-04 19:04:07

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

Re: Need help reducing lag in project

Ok, splitting up the parts didn't work as well as I though. The one thing that is causing problems is one of the most  important parts of the project. Each character has 17 if blocks to check when stance it is in. This is no way around using the if blocks. I am just going to use the code I already have and hope that most systems can run it  sad


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

 

#59 2009-01-04 19:11:50

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

Re: Need help reducing lag in project

archmage wrote:

Ok, splitting up the parts didn't work as well as I though. The one thing that is causing problems is one of the most  important parts of the project. Each character has 17 if blocks to check when stance it is in. This is no way around using the if blocks. I am just going to use the code I already have and hope that most systems can run it  sad

Oh well...to me the thing that counts is that it works offline.


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

Offline

 

#60 2009-01-04 19:41:48

TheSaint
Scratcher
Registered: 2008-11-04
Posts: 1000+

Re: Need help reducing lag in project

IS java like scratch with its own running program window or like HTML where it is coded on a word document? I just would like to learn how to use it.  smile  Sorry for the OffTopicness.

Offline

 

#61 2009-01-04 20:09:19

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

Re: Need help reducing lag in project

Scratch is not like Java.  (Infact, the only things pretty much that you could learn from Scratch and apply it to Java is ' if ' and variables. 

Although Java can be coded in special programs (called Java IDE's) you can pretty much do it in a text document.  You'll also need some other various tools such as JDK and a compiler.  (A compiler turns the files into classes which aren't readable.)

Last edited by Nick60 (2009-01-04 20:10:01)


Let's  Be Blue!

Offline

 

#62 2009-01-04 20:31:10

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

Re: Need help reducing lag in project

TheSaint, you could try greenfoot
http://www.greenfoot.org/

It uses java to program games and simulations.


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

 

#63 2009-01-05 06:17:24

TheSaint
Scratcher
Registered: 2008-11-04
Posts: 1000+

Re: Need help reducing lag in project

Thanks for the info! I am not sure, but I think I am going to take a Java Class next year was just wondering if I could get some practice.

Offline

 

#64 2009-01-05 13:26:44

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

Re: Need help reducing lag in project

TheSaint wrote:

Thanks for the info! I am not sure, but I think I am going to take a Java Class next year was just wondering if I could get some practice.

I have took a java class last year. If you can become good with greenfoot you will have no problem with your java class. Its a lot to learn, but it will be worth it.

Your java classes will probably be more boring than making greenfoot games. You will probably be making calculators, and programs designed to train you to use a certain feature or command.


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

 

#65 2009-01-05 16:39:21

illusionist
Retired Community Moderator
Registered: 2008-07-02
Posts: 1000+

Re: Need help reducing lag in project

archmage wrote:

http://scratch.mit.edu/projects/archmage/358968

This is the project I want to run faster. Only essential scripts are running and I want to know if there is a way to reduce lag without changing the way the project preforms.

Any help is appreciated  big_smile

I am having a very similar problem. My game 'Black Light' (which i removed from the website to try to fix) does not start at all online. It is a VERY good game when downloaded and ran in presentation mode, but people are too lazy to download. All of the comments said things like "this sucks" or "doesn't start". I tried simplifying the script and taking out some features, but it still doesn't work.

If anyone has a solution, please tell me.

Thanks,  smile

Last edited by illusionist (2009-01-05 16:41:29)


http://i.imgur.com/8LX1NrV.png

Offline

 

#66 2009-01-05 16:54:10

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

Re: Need help reducing lag in project

illusionist wrote:

archmage wrote:

http://scratch.mit.edu/projects/archmage/358968

This is the project I want to run faster. Only essential scripts are running and I want to know if there is a way to reduce lag without changing the way the project preforms.

Any help is appreciated  big_smile

I am having a very similar problem. My game 'Black Light' (which i removed from the website to try to fix) does not start at all online. It is a VERY good game when downloaded and ran in presentation mode, but people are too lazy to download. All of the comments said things like "this sucks" or "doesn't start". I tried simplifying the script and taking out some features, but it still doesn't work.

If anyone has a solution, please tell me.

Thanks,  smile

I think that the only solution would be for the scratch team to fix the player or the program itself.

And now for some observations on my game.

On my one computer it runs flawlessly when downloaded.

Here are its stats

2.4 ghz processor (it probably won't work well on processors below 2 ghz)
1 GB of ram ( 512mb should also be fine)


Now when running online it runs very differently.

It requires a much more powerful CPU 3.0 ghz, I would assume, but it would be great if someone could test this for me.

It uses quite a bit more ram but 512 mb should still be fine, just as long as nothing else is sucking back ram. Programs such as virus and spyware defenders suck back huge amounts of ram so I recommend disabling them for a little bit, even for the offline version if you pc isn't that great.

So in conclusion, the project is fantastic only when played offline.

Making this online scratch player as fast as the player in the scratch program should be the team's number 1 priority I think.


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

 

#67 2009-01-05 17:19:26

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

Re: Need help reducing lag in project

archmage wrote:

Making this online scratch player as fast as the player in the scratch program should be the team's number 1 priority I think.

You can say that again!


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

Offline

 

Board footer