Tangible problem with Flash vs. Java

Ok, this one may start a bit of fighting discussion, but I thought I would post it anyway :slight_smile: I was trying to articulate why most Flash games feel “weird” to me. So, I searched for some good examples, based on classic goodness, to illustrate a point.

So, here are two Pac-Man clones, one in Java and one in Flash.

Java: http://www.bennychow.com/index.shtml

Flash: http://www.thepcmanwebsite.com/media/pacman_flash/

Some observations:

  1. The Flash version kind of feels like paper cutouts moving about a Pac-Man maze. The Java version feels authentic.
  2. The collision detection on the Java version is accurate and the Flash is not.
  3. The Flash version runs MUCH slower than the Java version
  4. The Java version was programmed in 2000 and still works today, flawlessly across 3 browsers on 2 desktops I tried. Flash Pac-Man is a more recent app.

Yes, I know that Director rocks, but I feel that the Java versions of many of these kinds of games are just, truly, better. The Flash versions all seem to have that same “feel”, regardless of the game.

Java…Flash…BATTTTLLLLEEE!!!

To me, the problem with Flash games seems to be not that Java is necessarily more capable of quality than Flash (it probably is, but for a game like Pac Man you’re not really pushing the limits of either platform), but that the people making Flash games are more prone to just hack something together and get it out, spending more time on the art assets than on the game itself. Largely this is because of Flash’s success - you can score a quick half grand for a medium quality Flash game as long as you’re a decent artist and have a few days to make the crappy game seem polished (which is easy to do just by tweaking your art and sounds), whereas with Java it’s just about impossible to sell a browser game of any sort. Best case scenario, you’ll make a quarter of what you would get if it was Flash.

So the people doing Java games tend to care about making the games, not about the money they expect to receive as a result. As a general rule this will bump the quality of games up quite a bit. To be fair, there are some truly awful Java games out there; I would even say that the worst Java games can in some cases beat the worst Flash ones as far as puke factor goes. Still, usually they are at least truly awful games with a bit of care taken in their construction, which is more than can be said of most of the crap up at Newgrounds and other Flash shovelware sites.

On a total aside, while we’re talking about half-baked implementations of classic games, has anyone ever played a decent free online Tetris? Every single one I’ve ever seen just downright sucks, usually to the point of unplayability.

Gotta play Devil’s advocate here, but the top tier Flash games are impressive and have the results to show (2+ million plays in 1 month). I can’t think of any browser-based Java games that have hit that level of popularity for a long time, Runescape excepted.

Another problem is that making games the old way takes far too long. Sure, the results are fantastic (Kevin’s stuff is all like that), but even a fast programmer like him will take at least several days to make anything playable, and that’s with the help of his frameworks whereas in Flash, you have a full toolchain already there. This lowers the bar to entry and lets in a lot of low quality content, but statistically speaking, the more you lower the bar the higher chance you get at getting those home run games.

[quote=“ChrisM,post:1,topic:31642”]
HORRIBLE choice!
I could make a Pac-Man clone in flash that looks, plays and runs better than that java clone in about a day.
If you want to prove that java is better than flash, please don’t pick the stuff that flash can do much better than java.

Just because the code and art in the flash example you happened to find were sub-par, it doesn’t mean the language itself is horrible.
Besides, exactly the same thing could be said about C[++] vs Java… For every well produced game you show me made in Java, I can show you ten made in C[++]… it says nothing.

Don’t get me wrong, though… I love Java. =) It’s by far my favorite language to code in.

Agreed, poor choices. However, I still think Flash (most things with a toolset) have one large disadvantage. The games all come out feeling the same. A collegue remarked to me a few years ago that he could spot a Kev game miles away (of course I assumed he meant buggy and incomplete ;)). What he was getting at is that game developers start to produce things that are signature to them, thats why indie game dev is so interesting, there is so much of the author in every game. Another great example, look at Cas’s games, Alien Flux showed a certain style emerging - as the catalog has gone on the style has become more and more refined - puppy games creations now have a very strong flavour.

In contrast Flash games (and Game Maker games, and RPG Maker games…etc…etc) all come out with a very similar style. In takes a great deal more effort and time to push out something unique in flash than it does when you’re that much closer to the code. Obviously it’s possible, there are some great examples around (flow was flash wasn’t it?), but in most cases the soul of the game is lost entirely in a smacking of generic feeling graphic style and over played geometry based animation.

So it’s comes up to weighing up what you need, like most things. If you need to produce some generic game that soccer mom’s everywhere are going to play and accept as the same as everything else they’ve ever played, i.e. you’re just looking to make money in casual games - Flash is your winner.

If you want to create something special or unique, use something with more control - Java isn’t a bad fit for that (though I understand there are other options ;))

As to what I producing games quickly, I think the bulk of game development isn’t in the implementation - it’s in the design, testing, resource creation and balancing. Resource creation and management in Flash is great, but again it seems awfully generic.

Kev

I agree that most flash games have a generic feel to them.
Come to think of it, although Director maybe rocks, maybe it’s also one of the primary reasons flash games feel so generic?

'Tis true that most Flash games generally tend to feel pretty much identical. At least some of the reason is for the following reasons:

  1. Generally they run at 30 fps, deliberately. That’s the first cardinal sin as far as I care :slight_smile: 60fps FTW baby!
  2. Generally they also run at pretty high CPU load especially on older machines
  3. On the occasions they try to do anything that involves full screen updating (eg. scrolling), it all begins to look pretty awful.
  4. Effects are basically limited to varying scale, rotation, and alpha transparency. At least that’s generally all I’ve seen

However…

I’ve also noticed that Java applets tend to have the following characteristics:

  1. Incredibly long wait for startup with hideous grey square in the meantime
  2. …that is, if they work at all, instead of just displaying Invalid Bytecode, or throwing an NPE before initialisation even begins, or simply crashing the browser
  3. Then when they run the graphics are almost never antialiased and hence look at least 10 years out of date
  4. …and they also run at 30fps
  5. …and frequently have longish garbage collections

Plan to change that soon ish when all our mini games are turned into applets using LWJGL 2.0 8)

It has to be said that to beat Flash at its own game is going to take the widespread adoption of this Update N thing, and probably also a lot of people clicking Yes on an installation dialog for LWJGL or JOGL… unless … we could get Sun-certified for LWJGL and have Java automatically accept anything so signed by Sun…?

Cas :slight_smile:

Well, to be fair, I never stated that Flash stinks. I DO recognize it’s strengths. I have played through a ton of games on Kongregate and, while some are really fun, they all have the same “feel” to them. To Kev’s flOw example, it is exactly what I am talking about. The game, as you get deeper into the water, actually looks like square bits of paper being pushed around the screen. As well, I think Kev and ErikD ht the nail on the head. The result of a single tool being used to create many kinds of games means they all come out with similar feel. No different than any other engine I suppose.

Again, this is not a “Flash sucks” discussion, I am just remarking on how Flash games all “feel” the same.

Yup, I think that that single thing could do more for java in the war against flash than anything else at this point (or at least something OGL that works reliably in a browser without scary popups).

One can always dream :slight_smile:

Right!!! I have never seen a 3D game as good as Jake 2 written in Flash even though we have Gnash under Linux (Flash using OpenGL: Gnash uses OpenGL for rendering the graphics on the desktop).

Exactly right, particularly on 1) and 2) - without those, Java would be a much more viable platform for online games. It’s a large part of the reason even the shovelware sites don’t accept Java games - they don’t want their site to be associated with something that often makes your browser crash. Even I, as a Java developer, cringe every time I go to one of my own sites with an applet on it, because I know that it’s a roll of the dice as to whether my browser will respond once the site loads. Unfortunately these “bugs,” even though the Java game developer has no control over them, become the game’s, because the person coming to the site doesn’t know or care that it’s a buggy plugin causing the trouble, all they know is that the game doesn’t work.

That said, 3), 4) and 5) mostly are the developer’s fault. Even without OpenGL, you can handle all those things without too much effort if you know what you’re doing.

I would also add 6) …and never give back any of the resources they’ve taken when you leave the page. Or something. It’s not exactly clear to me what happens (and I actually leave the console open), but after opening several Java applets in a browser, I usually can not open any more without getting out of heap space errors even from the most trivial of applets.

FWIW, unless you’re really burning some serious processor power, you actually can achieve a Java feel in Flash and vice versa - I’ve done direct ports that behave almost identically between the two, and feel the same. It’s just that the easiest path to development is the standard Flash IDE in AS3, so people rarely write games from pure code there.

[quote]I would also add 6) …and never give back any of the resources they’ve taken when you leave the page. Or something. It’s not exactly clear to me what happens (and I actually leave the console open), but after opening several Java applets in a browser, I usually can not open any more without getting out of heap space errors even from the most trivial of applets.
[/quote]
Yes, that’s an absolute showstopper and one of the reasons why I don’t like doing applets. I mean, you can’t seriously ask your users to restart the whole browser, navigate back to your applet game again, while keeping a straight face >:(
If this problem would ever be solved, java applets could really shine with all singing and dancing 3D games that are impossible to do in flash, but until then such games will remain seriously bugged and the only option is scaling down to flash-scale games.

At least for the hanging of your applets i have a javascript workaround, on which i work these days to get perfect. It gets the job done in 99% percent of the time, which is due to the fact that the applet sometimes load between two async method-calls using setTimeout(…, ms).

So basicly it waits for the applet to load, with a certain timeout (and a nice flashy GIF animation) and removed the applet from the DOM-tree, and injects it again. It gets the situation acceptable, I guess - the company I work for now relies on it to get applets running on ‘newless cluebies’-like customers’ browsers.

the problem is solved with update 10 (try the builds) its even possible to request a new VM instance for your applet. The shared VM mode also improved.

I played with the scenegraph demos (6 at a time) and they require around 60 mb on start. The maximum after some reloads was somewhere around 90 mb until a full GC hits in and the memory consumtion was back at 60. Works fine for me.
https://scenegraph-demos.dev.java.net/demo-applets.html

Do you happen to know what the actual problem is when applets hang the browser? I wasn’t aware that JS stuff was even still running while the applet was loading, I always thought the plugin blocked everything else from happening until its work was done (and that this was Not A Bug).

I hope this stuff is better as of 6u10, as claimed - I see a bunch of applet bugs claimed fixed, so I’m hopeful. It seems like perhaps Sun is finally taking applet issues seriously, maybe? I can’t test right now as I’m on OS X and we’re not getting Java 6 for a while, but when I get to a Windows box I’ll try out an early build.

It is possible to get Java 1.6 through Apple ADC (my teacher did this to test my game or I would have got a pretty 0/20 for my semester project ;D).