Sign in to follow this  
Aezon

Java vs Flash(Web gaming)

Recommended Posts

Aezon    106
I googled this and came up with nothing, so I have come here: What are the pros and cons of game development in Java and Flash and how do they compare to each other? FYI this is mainly for web development, with a possibility of making a stand-alone EXE for offline play. Edit: I am more experienced in java than Actionscript, but for game development specifically, I have more experience in Flash. I decided to throw this in if experience effects anything.

Share this post


Link to post
Share on other sites
Programmer One    746
On the surface, Java is a lot more powerful than Flash. Flash, on the other hand, may be easier on beginners.

Java Pros:
- A powerful programming language and VM environment.
- Arguably faster rendering vs. Flash.
- Threading support.
- Excellent documentation (compared to Flash, imho).

Java Cons:
- Performance on some systems/browsers isn't that great always.
- More dangerous (and treated as such by browsers).
- You really need to be a programmer to use it.
- You need a lot more "framework" to get rendering/input going.

Flash Pros:
- Designed specifically for graphics output (animations, movies, etc).
- Easy for beginners to venture into making games.
- Development-time visualization (time-line based development).
- Built-in, simple, resource management.
- AS3 :D
- Supports 3D rendering (Flash Player 10+)

Flash Cons:
- Single threaded. No support for multithreading.
- Performance problems (inherent to Flash).
- Lackluster documentation.
- Terrible code editor (Adobe Flash CSx)
- Terrible debugging (Adobe Flash CSx)
- AS2. 'nuff said.
- 3D Support is...wonky...
- A lot of quirks you need to get used to.

From a programmer's perspective, I like Java better. From a designer's perspective, I like Flash better. Personally, I hate both. [grin]

Share this post


Link to post
Share on other sites
justkevin    252
Some corrections/additions to Programmer One's comments:

Nobody should be using the Flash IDE for writing AS3 code. Flex Builder is a great IDE, and Flash Develop is a good free one. Both are based on Eclipse. Flex Builder has good debugging-- you can set break points, explore properties, profile memory and cpu usage, etc., generally seems about the same as Eclipse for Java. Flash Develop has poor debugging.

Additional pros to Flash:

Adobe seems to have done a good job creating a player that runs basically the same everywhere and integrates smoothly with few surprises.

There's huge infrastructure on the web for Flash game distribution. If you write a fun, addictive Flash game, you can be almost guaranteed to reach millions of players with minimal marketing.

Flash apps load quickly and support preloaders.

Additional cons to Flash:

Flash only currently supports TCP/IP for networking, which may be important if you want to do multiplayer.

AS3 in general has been conspicuously made simpler at the expense of some language features: multithreading, generics (besides the new Vector class), fewer numeric primitives.

Doesn't really support a right-click control scheme.

In conclusion, I would still recommend Flash for browser based games UNLESS you have a specific requirement that you know requires Java.

Share this post


Link to post
Share on other sites
Aezon    106
Thanks for the help, but I have an addendum to my questions:

Which is better for security, and efficiency? Also, can you use openGL and Java in a web browser?

Share this post


Link to post
Share on other sites
nobodynews    3126
Quote:
Original post by Aezon
Thanks for the help, but I have an addendum to my questions:

Which is better for security, and efficiency? Also, can you use openGL and Java in a web browser?

I'm assuming that if this game can do it then you can do it.

Share this post


Link to post
Share on other sites
Momoko_Fan    100
Java supports OpenGL through LWJGL or JOGL libraries, there are game engines taht use those also.
If you're planning on having hardware accelerated 3D graphics, then Flash is not really an option for you.

Share this post


Link to post
Share on other sites
lightbringer    1070
Yeah, you can take advantage of hardware acceleration with Java 2D (or JOGL, or LWJGL, but those require your users to download 400k+ of jars), something I don't think is possible in Flash. Unfortunately, it comes down to this: Flash plugin is almost everywhere, Java plugin is not. Java is only now slowly getting over its bad rep (which by now is undeserved, but memories linger longer). In addition, Java plugin was significantly improved in Java 6u10, but you'll probably have to be lucky to get that on the target browser. Most portals for web games also do not accept applets. So even though Java is technically superior, if you want to make money off browser games, you'll almost certainly have to go with Flash.

Do a thread search over at javagaming.org, this topic comes up there pretty often.

Share this post


Link to post
Share on other sites
Aezon    106
Thank you for that link, lightbringer. I imagine it will be quite helpful in my studies.


So, am I correct in assuming that my premise is that of requiring a bit of reputation as a game developer in order to have a successful java gaming site?

Share this post


Link to post
Share on other sites
lightbringer    1070
Quote:
Original post by Aezon
So, am I correct in assuming that my premise is that of requiring a bit of reputation as a game developer in order to have a successful java gaming site?


I'm not sure what you mean. You don't need reputation to develop games in Java, only skill, like in any other language. The barrier to entry is the consumer mistrust of Java and the proliferation of Flash as the accepted browser game medium among portals. You can certainly develop and host the applet on your own webpage, the question is how to drive enough traffic there (and get a high enough conversion rate) to make it profitable. If you want to make and sell games in Java, you could look at the mobile market and JavaME. You won't get rich, but chances are probably better than with web, because Java is very widespread on mobile phones. If you're just in it for the love of making games, by all means, go with what you feel most comfortable with :)

Share this post


Link to post
Share on other sites
Aezon    106
I meant that, in order for people to trust your java games, would you have to have a reputation for producing quality games in a more popular medium, such as flash?

Share this post


Link to post
Share on other sites
lightbringer    1070
I dunno, I think it's Java in general that's the problem. People either don't have it, won't install it, have an old version, or don't know what it is. It's also a big download (70-80 MB or so?) just to play a game. Well, if you sign your applet with an untrusted certificate you'll also get a security popup, but you don't have to sign unless you want OpenGL to run for instance (and I think JOGL binaries are signed by Sun).

But we as Java users and develops are not in a good position to judge this objectively. You could always try a survey among your non-programmer friends as to whether they know what Java is, or what applets are, or if they ever used an applet :D

Share this post


Link to post
Share on other sites
jackolantern1    158
Another Java con, but for the user-end, is that the JVM can be quite annoying when it comes to updating. It seems like I will install an update, and by the next time Java loads up, it is popping up in my tray that it wants to update again. This could drive away potential audience, because your average internet user doesn't have to have Java installed, and more casual users may be making the decision to not get it again due to annoying experiences.

However, another pro for Java is the price. Everything you need to develop Java games for either desktop or the web are free. While Flash has free development tools, if you want to get serious, those Flash CS4 tools can get pricey.

Share this post


Link to post
Share on other sites
Captain P    1092
Quote:
Original post by lightbringer
If you want to make and sell games in Java, you could look at the mobile market and JavaME. You won't get rich, but chances are probably better than with web, because Java is very widespread on mobile phones.

I built a few mobile games some three years ago, and let me tell you, it was horrible. Compile once, debug everywhere. Every phone has it's own quirks, bugs and specifications.

Quote:
I dunno, I think it's Java in general that's the problem. People either don't have it, won't install it, have an old version, or don't know what it is.

Or they dislike it because it's slower to load than Flash, or whatever other reason. I don't think the general public really cares what's driving your game, as long as it works well and loads fast. For the more heavy kind of games, some loading time is expected, so if I would build a 3D game, I'd consider Java (but I'd also look into Flash 10 and the 3D engines available for that, building some stress-tests first). For most other games, I think Flash is the more natural choice these days.

Quote:
Original post by jackolantern1
However, another pro for Java is the price. Everything you need to develop Java games for either desktop or the web are free. While Flash has free development tools, if you want to get serious, those Flash CS4 tools can get pricey.

I think the main reason to buy CS4 would be the graphics authoring tools. What free equivalent tool is there for Java? And what would prevent you from using such tools for Flash?

Share this post


Link to post
Share on other sites
Aezon    106
Quote:
Original post by lightbringer
I dunno, I think it's Java in general that's the problem. People either don't have it, won't install it, have an old version, or don't know what it is. It's also a big download (70-80 MB or so?) just to play a game. Well, if you sign your applet with an untrusted certificate you'll also get a security popup, but you don't have to sign unless you want OpenGL to run for instance (and I think JOGL binaries are signed by Sun).

But we as Java users and develops are not in a good position to judge this objectively. You could always try a survey among your non-programmer friends as to whether they know what Java is, or what applets are, or if they ever used an applet :D


I don't recall having to download a 70-80mb file just to play...say Runescape. Or are you referring to stand-alone games?


You have a point in that last part.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this