Actually, this discussion is worth a new topic.
In the "Variable sensing thread" a discussion emerged about the use of Flash. We have already seen the problems with the java engine. Memory loss, browser crashing and incompatibility issues between the Scratch graphics engine and the Java graphics engine (Not to mention sound issues)
I explored the link to Flash Animator http://www.3dfa.com/ and had a play with it. I think it is possible to generate action script code using scratch projects. Added advantage would be the fact that the flash player in the IDE would be the same as the one in the browser so no more unexpected incompatibility issues.
Flash games can be scaled better, run faster, look better and are able to leverage more features such as 3D effects.
I am sure the scratch team has considered the use of Flash. I would like to know why Java has been used in favour of Flash?
Offline
I am not too sure my self but it may be because flash uses vectors instead of bitmaps. But I guess they just chose to go with java because it is easier to implement.
Offline
Flash uses vector graphics, bitmaps are applied to a 4 sided shape. Performance was an issue but since version 8 they cache bitmaps and the speed has improved. This document is an interesting read http://www.drizzle.com/~scottb/gdc/flash-paper.htm
Offline
Archmage is right.
Also, Scratch is strongly a 2D environment. The way the Scratch app works, it would be hard to put into flash. Java is the logical choice.
Also, I believe Flash is only Windows/MacOSX
Last edited by relyt12101 (2007-09-15 07:59:12)
Offline
relyt12101 wrote:
Archmage is right.
Also, Scratch is strongly a 3D environment. The way the Scratch app works, it would be hard to put into flash. Java is the logical choice.
Also, I believe Flash is only Windows/MacOSX
I disagree. While I was playing with Flash Animator I found it easy to import a bitmap and animate it. In fact most things are very similar to Scratch. And it should be because the Action Script language is based on java.
Not sure what you mean by Scratch being 3D. I assume you are talking about the layers.
As far as cross platform compatibility goes. I doubt there are many kids that care about their creation not running under Linux. I know nothing about Linux but are you saying there is no Flash player for Linux? If so then their browsing experience will be rather frustrating at times.
Since the Java graphics engine is very different from the graphics engine used in the Scratch IDE I suggest that Java is a bad choice. Currently the java engine leaks memory like there is no tomorrow. The Firefox browsers on all PC's I have tested on failed after running a few games.
Offline
The discussion of Flash v. Java has been an active discussion within the Scratch team for the past months.
There are good and bad things about both of them.
These are the reasons why I think a Scratch player made in Flash is better than in Java:
1. Applet is sluggish.
2. It takes a while to open the JVM.
3. More people have Flash than Java.
4. Websites such as MySpace and Facebook do not allow embedding Java applets but they do allow embedding Flash.
Reasons why Java is a better choice than Flash
1.Using Flash means that we will depend on Adobe, which seems reluctant to give away control of Flash. On the other hand Java seems to be moving more and more towards open source.
2. At the time we made the decision (and maybe even now). Flash could not implement efficiently the image effects we have such as swirl and fisheye. Maybe this is still true. Also, I believe Flash didn't have MIDI support.
3. A Java player for the web helps a bit in creating a Java player for J2ME devices (cell phones).
4. Java has all the advantages of a high-level programming language which made it easier to implement a Scratch virtual machine in Java.
5. Even though Java is not as widespread as Flash, still close to 99% of the visitors of this site have Java enabled browsers according to Google Analytics.
Conclusion:
I would love to have a Flash player, maybe some of the limitations that were present a year ago are not longer there. I guess we don't have enough man power right now to implement a Flash version. In addition, implementing a Flash version doesn't seem to address any critical problem right now.
P.S. Apologies if I missed something here. I am basically summarizing the opinion of multiple people and covering some technical details that I am not sure I am covering well.
Offline
Great to see you guys have seriously considered the pro's and con's.
Personally I favor flash games over java games as they tend to be richer and offer smoother graphics and alpha transparency.
Some arguments against flash don't seem so strong to me. I think the image effects in Scratch are features looking for a problem to solve. Changing color yes very handy but twirl and fisheye? well it goes back to the intense discussion you have had about the "if on edge bouce" block. Flash may not implement these features. If this is the case then I don't consider that an issue. Lack of midi support...maybe but if so it is a small problem. We live in the MP3 age now and even kids demand quality sound.
But, indeed flash is propriety technology and they do call the shots. Then again, there are many commercial applications based around flash and none of them seem to suffer from this fact.
There is a very strong argument against java as it stands now. The Java VM leaks heaps of memory and kills the firefox browser after running a few games. The browser will crash and fail to start again because the process remains in the task list.
The online java engine behaves differently than the Scratch IDE so programs tested suddenly fail when on-line. Especially the graphics engine has issues.
The Java engine fails to reproduce all the sounds while the game plays the sounds just fine in the Scratch IDE. ( See MadPong http://scratch.mit.edu/projects/dinther/34610 where sounds should be played when you score)
Some of these issues could be resolved by using the same Java engine in the Scratch IDE or switch to flash and use flash in the IDE as well as on-line.
Flash will also open the door to richer graphics and 3D but as I said, I need to learn more about flash.
Offline
Just did some research Flash versus Java and foudn this page http://www.realchat.com/blog/java-vs-flash/
More interesting are the statistics they claim which are very different from the ones you have experienced on your web-site:
Unique Visitors: 3314
Flash enabled: 95,75%
Java enabled: 56,43%
Offline
I see some advantages to a translator from scratch to flash, even if it is not complete.
It would provide scratch programmers with a an easy path to transition to flash if they want to.
If flash really lacks MIDI support, that is a strong minus, as most of the music programs in scratch rely heavily on the MIDI commands. (The difference is between playing a music instrument and just playing a recording of someone else's music.)
Offline
3D Flash Animator does not have any MIDI support (at least that I can find). I did find this thread with a search of the support forum: http://board.flashkit.com/board/showthread.php?t=518638&highlight=MIDI.
Sounds like it should work but haven't tried it. Also, probably a lot of latency issues, etc. with single notes. My gut feeling is that Scratch is generally working fine - why make a major change. I would like a "a translator from Scratch to Flash, even if it is not complete" as Kevin suggests
Final comment. What disturbs me most about the fact that the Java VM "leaks heaps of memory" is that the problem has been around for a while (at least a year and a half that I personally know of - and I suspect much longer) and there doesn't seem to be any progress towards a fix as far as I can tell. This is a non-trivial issue - try and use Photoshop on a large image without rebooting after a major "memory leak" and you suddenly find basically nothing works - and no obvious clue as to what the problem is.
Offline
Well as a flash developer, I have to say, that after playing with Scratch the only thing that i saw that can't be done with Flash is the midi support. I would say that with the improvements in Flash Player 9, and AS3, Scatch would be a better product if built in Flash.
IMHO.
Offline
andresmh wrote:
The discussion of Flash v. Java has been an active discussion within the Scratch team for the past months.
There are good and bad things about both of them.
These are the reasons why I think a Scratch player made in Flash is better than in Java:
1. Applet is sluggish.
2. It takes a while to open the JVM.
3. More people have Flash than Java.
4. Websites such as MySpace and Facebook do not allow embedding Java applets but they do allow embedding Flash.
Reasons why Java is a better choice than Flash
1.Using Flash means that we will depend on Adobe, which seems reluctant to give away control of Flash. On the other hand Java seems to be moving more and more towards open source.
2. At the time we made the decision (and maybe even now). Flash could not implement efficiently the image effects we have such as swirl and fisheye. Maybe this is still true. Also, I believe Flash didn't have MIDI support.
3. A Java player for the web helps a bit in creating a Java player for J2ME devices (cell phones).
4. Java has all the advantages of a high-level programming language which made it easier to implement a Scratch virtual machine in Java.
5. Even though Java is not as widespread as Flash, still close to 99% of the visitors of this site have Java enabled browsers according to Google Analytics.
Conclusion:
I would love to have a Flash player, maybe some of the limitations that were present a year ago are not longer there. I guess we don't have enough man power right now to implement a Flash version. In addition, implementing a Flash version doesn't seem to address any critical problem right now.
P.S. Apologies if I missed something here. I am basically summarizing the opinion of multiple people and covering some technical details that I am not sure I am covering well.
yes, it takes FOREVER for java to load on my computer
Offline
It is very logic that visitors of this site have Java enabled. I don't think this site is interesting without the scratch programs on it... You need java to run this site.
I've created a few games in flash, and it works much better.
The java virtual machine crashes in FireFox (i have firefox installed on another pc), but you really don't want to know what happens with the java engine in Internet Explorer 7... The memory problem is enourmous. The only option is that big button on your PC, power off... So the next part is waiting until winXP has checked all the drives on failures....
Currently, i can't run any scratch games, because the JVM is fully crashed. It just doesn't starts anymore. And it does not contain a "shut down" option, even not in the console...
I also think the scaling of flash would be a very good thing. It contains a fullscreen option, so people can run games in full screen, in normal speed, on the web...
Flash also does supports bitmaps, but vector spares a lot of disk space. Maybe it is an idea to (yes i know its a mayor change) implement bitmaps AND vectors in scratch. It would spare a lot of disk space of the user, and a lot of space on your servers...
It all are only suggestions...
my oppinion: Flash? Yes
Offline
Which java virtual machine are your running and which version of Windows? We've had no problems with the JVM on either Mac OS X machines or old Windows machines. From all reports I've heard, IE7 is not a piece of software you want to run on any machine. Firefox is safer.
Flash is a good next animation language after scratch, but making a scratch interpreter in flash or a translator from scratch to flash is not an easy task.
Offline
Java only crashes depending on your computer. Maybe it is old?
I have Firefox and JVM only crashes when I open, like, 20 projects at the same time.
Offline
I don't think my computer is so slow:
(ok it's not new anymore, but...)
Microsoft Windows XP Professional version 2002
Service Pack 2
Intel pentium 4 CPU, 1.80 Ghz
512 MP of RAM
It runs the heavy 3D games prefectly, so i think an internet browser should have to work too
Last edited by JSO (2007-12-18 08:48:19)
Offline
Hi, all.
A Flash player for Scratch could mean two different things:
1. a Scratch-like way to program Flash, as an alternative to writing ActionScript
2. a Flash-based player for Scratch that supports exactly the Scratch feature set
Those willing to give up some Scratch features (e.g. note/drum) to adapt to what Flash can do are actually advocating (1), although they may not realize it. I certainly agree that (1) would be useful--Actionscript is much harder to learn than Scratch and that limits most people's ability to use Flash in the most creative and interactive ways. However, Adobe is the logical organization to create such a product. That way they can ensure that the language stays in synch with the underlying Flash engine over time.
As for (2), Andres did a great job of summing up the pros and cons of creating a Flash version of the Scratch player. One thing about Flash has changed since we created the Java player: Flash 9 has a *much* faster ActionScript engine. It is still not as fast as Java, but it is probably fast enough to implement the Scratch image filters. According to the Flash website, the Flash 9 player is not yet as widespread as earlier versions, but it will get there. (Although it may take a while for the open source community to create a Flash player with Flash 9 performance for Linux.)
The biggest problem is the difficulty in supporting the Scratch note and drum commands on Flash. Flash does not provide access to a MIDI synthesizer. I've read about a "Flash Plugin" you can install that adds MIDI support, but using that extension would require an additional download and installation by a system administrator. Requiring any such installation would severely limit our potential target audience; the beauty of both Flash and Java is they are already installed on so many machines. As an alternative to installing a Flash extension, we could create our own synthesizer in ActionScript. The way I read about was a hack and could have latency issues. But even if those were solved, creating a full MIDI soundbank would be a formidable task. So at the moment, there seems to be no feasible way to support the Scratch note and drum commands. I am hoping that Adobe will include access to a MIDI synthesizer in Flash 10...
-- John
Last edited by johnm (2007-12-19 12:16:57)
Offline
Hi, all.
About the Java storage leak...
Believe me, I would love to fix this problem. I've actually spent several full days trying to solve it. My hypothesis is that it is caused by a bug in Java related to BufferedImages not being properly garbage collected. The Java player for Scratch generates a lot of BufferedImages; every time you rotate a sprite or change an image effect, a new BufferedImage is created. However, I cannot prove that this is the problem. I've even written programs that allocated lots of BufferedImages to try to tickle the bug, and they did not. So perhaps that hypothesis is wrong.
If anyone wants to help, it would be extremely helpful to have a reliable and repeatable way for us to reproduce the problem. The recipe could be something like: using a specific version of Windows, a browser, and Java, visit this project page a certain number of times. Many people have encountered this problem but no one, even within the Scratch group, has yet been able to reproduce it reliably. Or if you've observed certain patterns that seem to lead to a Java crash, that data could be useful. Any leads would be greatly appreciated.
When looking for patterns, one thing to consider is your browsing habits. Do you tend to open many windows or tabs on Scratch projects at the same time? Do you use the back button a lot? Do you usually let an entire project load or go to a different page before it has finished loading? This does problem does seem to hit some users harder than others. That suggests that the problem could be dependent on their configuration, but it might also depend on their usage patterns.
-- John
Last edited by johnm (2007-12-19 12:49:03)
Offline
I think the only problem with flash is the MIDI support. But I'd say flash has WAY more features than java.
Java sometimes makes my browser (Safari) either freeze or completely crash, which has never happened before in flash. And sometimes I have to download projects to play them because 30 minutes go by and the red bar in the java loading screen doesn't move... *waits* Anyway, I'd say flash should replace java.
Offline
JSO wrote:
It is very logic that visitors of this site have Java enabled. I don't think this site is interesting without the scratch programs on it... You need java to run this site.
I've created a few games in flash, and it works much better.
The java virtual machine crashes in FireFox (i have firefox installed on another pc), but you really don't want to know what happens with the java engine in Internet Explorer 7... The memory problem is enourmous. The only option is that big button on your PC, power off... So the next part is waiting until winXP has checked all the drives on failures....
Currently, i can't run any scratch games, because the JVM is fully crashed. It just doesn't starts anymore. And it does not contain a "shut down" option, even not in the console...
I also think the scaling of flash would be a very good thing. It contains a fullscreen option, so people can run games in full screen, in normal speed, on the web...
Flash also does supports bitmaps, but vector spares a lot of disk space. Maybe it is an idea to (yes i know its a mayor change) implement bitmaps AND vectors in scratch. It would spare a lot of disk space of the user, and a lot of space on your servers...
It all are only suggestions...
my oppinion: Flash? Yes
I haven't had any problems with the java virtual machine in Firefox or IE7. I have had problems with Flash in IE7.
my opinion
flash no
java yes
Last edited by pasta3049 (2007-12-20 11:22:16)
Offline
When you skip loading a project (by using the back button) the JVM crashes at my PC. Sometimes i don't want to wait until 10Mb is downloaded, when the servers are too slow...
I only use one tab on the scratch project pages, to avoid more problems (I do use more tabs on the forums, but that's no problem).
Flash can't change the java engine until it has MIDI support.
Offline
I have used Linux for over 3 years now and there JOLLY WELL IS a flash player for Linux. I usually use Windows but my family server is Linux. (Actually I have two, one is Ubuntu and the other Puppy Linux. No, you probably won't have heard of Puppy Linux before. www.puppylinux.org)
I strongly agree that we should have Flash over Java. On YouTube, they use Flash to display uploaded videos and you can go in to a fullscreen mode on that. So an added bonus is, that if Flash was used, you'd be able to play fullscreen games online.
Offline