views:

312

answers:

8

I absolutely love good defender games (e.g. Gemcraft, Protector: reclaiming the throne) as they can be intellectually quite challenging; it's like playing chess but a little less thinking and a bit more action. Sadly, there are not that many good ones out there and I thought I would create one myself and share it with the rest of the world by making it available on-line.

I have never worked with ActionScript but when it comes to on-line games, this is the main choice. I have tried to find a decent 2D game in the form of a Java applet but to no avail. Why is this so? I could write the game, most comfortably, in Delphi for Win32 but then people would need to download the executable, which could deter some form downloading it, and also it would only work on Windows. I am also familiar with Java, having worked with Java for the last four years or so; although, I don't have much experience with games programming.

Should I not be deterred by the fact that all on-line games are written for in Flash and create my defender game as a Java applet, or should I consider learning ActionScript and games development for the ActionScript Virtual Machine (AS3 looks very much like Java... but still, it's an entirely new technology to me and I might never use it professionally.)

Could you, please, just answer the the question in the title? Why Flash, not Java applets? Is it only 'politics'?

A: 

A lot of flash developers are designers who have crossed over into making games. They used flash as a design tool before a programming tool.

Plus it seems to be something of a precedent now for online games to be written in flash so I guess people do not want to deviate from "the norm"

Chris
+1  A: 

Flash has a much wider install base, that can be the only reason. I personally don't install Java on my machines....flash, of course.

Why write something for a far smaller audience? I'm not saying it's wrong to, but that's usually the reason when you're making games for a profit.

Think of this equivalent with consoles, with the second generation playstation there were hardware add-ons available...but they were useless unless the games used them. You had 3 options as a game developer, package it with your product - driving the price up, assume they have it - smaller audience, or assume they don't - maximum audience, maximum profit. The result is the hardware never really sold much because as a game developer you had to assume they didn't have it.

For me, that equates that to Java vs Flash, if I have to install it, the price for me accessing it goes up...assuming they have the most common thing and you're safe, minimum cost of entry, maximum audience.

However, if you have a great game, I could be convinced to install :)

Nick Craver
+6  A: 

Flash provides a fully-built graphics and sound engine that will handle separate objects ("sprites") on paths and animation.

In Java those features would need to be provided by third-party library. Java does provides the necessary building stones to build such an engine, however.

JavaFX might change this, however.

Joachim Sauer
+2  A: 

Simple answer: the flash player is installed in almost all of PCs, but JRE isn't.

grayger
Your answer is almost good. I almost upvote you.
Ricket
+10  A: 

Flash is more popular since its penetration rate is huge.

Flash is also more powerful when it comes to create and integrate graphics assets (since Flash CS* is also a vector animation editor). It's also very easy to embed sounds and fonts assets, to play with bitmap effects, without using any aditional library.

And last but not least, there's a lot of sites who offers ActionScript APIs in order to earn money with your games by adding various ads in it (such as MochiMedia, Kongregate...)

Zed-K
some penetration rates. wow.
Peter Perháč
Although, Silverlight is gaining ground quickly: http://www.riastats.com/
Spencer Ruport
When trying to use Java games on a Mac, I've often found it necessary to do a bit of work to convince Java games to work, especially Java 1.6. This is rarely the case with Flash.
Brian
This looks like a pretty definitive answer. You can do it in Java, but I won't play it. If you do it in flash and I can simply open it in my browser then I might play it. That's what it comes down to.Also: learn AS3. It's very similar to Java and it's really kinda powerful. Worth knowing at any rate, and learning a new language will always help you to become a better coder in general.
Myk
Keep in mind the penetration rates are straight from Adobe. How did they measure that? @Myk: you do know about applets right? Java applets are right in the browser too.
Ricket
P.S. here are stats on Java http://www.statowl.com/java.php and the same source's stats on Flash http://www.statowl.com/flash.php
Ricket
Of course you can't totally believe Adobe's numbers. But how many people you know are using YouTube? And how many are using Java applets? I can't even think of a website using Java right now (well, probably Processing website, I've got one =p)
Zed-K
The penetration rates on statOwl show a difference of 15% between Flash and Java, in favor of Flash. It also proves that there are less disparities in plugin versions on the Flash side. But we have to keep it mind that this might change (very?) soon with HTML5 coming.
Zed-K
HTML5 is interesting, but hardly geared to become an industry standard any time soon. How many clients still require support for IE6?Re: Java Applets - sure, I guess you can put it in a Java Applet. But nobody uses those anymore, not in 10 years. It might work but you'd need a pretty good reason to deviate from Flash, which is the industry standard for stuff like this. Flash works on most mobiles going forward, too - another consideration.
Myk
+4  A: 

I can provide a little insight on the Java side: Early in the history of Java, Sun tried to push Java applets as the new way to display dynamic content in a browser. This attempt was doomed to failure by the combination of the following factors:

  • Java had (and still has) a lengthy load time for the (JRE) runtime;
  • Java originally had only AWT as a GUI toolkit, and AWT is limited and really ugly;
  • Java used to be a lot slower before the advent of faster CPUs and JIT compiling;
  • Java was (many think intentionally) supported very half-heartedly by Microsoft in IE, so it wasn't well integrated and ran poorly.

All this gave Java (deservedly) a horrible reputation, from which desktop and browser Java have still not recovered. To most people, Java stands for ugly, slow and often not working applications. It still suffers from this stigma today.

While both Java and Flash are Turing complete programmng environments, Java is more universal, with a bigger set of libraries for all kinds of different purposes. Sun strove to have the Java environment be universal among platforms, so browser-side Java includes a lot of libraries that are usually not needed. Again, more load time.

Carl Smotricz
If you look at Flash before Java introduced Swing, it wasn't very impressive. Of course, pre-Swing "Java" lived on due to MSJVM.
Tom Hawtin - tackline
+1  A: 

Flash typically performs better at the kind of drawing, animation and video features that games require, since that's what it was originally designed for. In addition, the strict-OO nature of the Java language does not lend itself well to the kind of ad-hoc rapid development environment that is common for games.

More importantly from an author's point of views, Flash is by far the more commonly-deployed browser plugin. Java just doesn't have the penetration on the desktop. Applets were historically despised for their instability and poor performance (particularly slow startup); whilst that has improved somewhat, Sun are continuing to undermine what user acceptance they have left with their obnoxious bundling updater. It is a brave company that develops anything much for desktop Java these days.

should I consider learning ActionScript and games development for the ActionScript Virtual Machine

It's definitely worth learning JavaScript/ActionScript. (They're almost the same language, sharing a standardised common core.) Then you can apply your Flash scripting knowledge to browser scripting. You can even consider implementing games in JavaScript/HTML itself!

AS3 looks very much like Java...

In as much as it's a C-like-language, yes. However the concepts and practice are very different; you'll have difficulty if you try to write JS/AS like Java.

bobince
are you sure it performs better? At least Java+PulpCore library performs far better than Flash (on my machine, that is...), compared using http://bubblemark.com
Tedil
Actually, AS2 is pretty similar to JavaScript, but AS3 is far more similar to Java (its syntax, but also the notions of packages, namespaces, garbage collector...). AS2 and AS3 doesn't implement the same ECMAScript standard version, and are very different. I love AS3 as much as I hate coding in AS2 or JavaScript.
Zed-K
Flash performs reasonably well when doing vector graphics, but you are surely mistaken if you think that this is the kind of drawing, animation and video features that games require. ;)
Rune Braathen
A: 

Future Flash CS5 could creates iPhone applications directly, so you'll be creating games for 2 platform at the same time.

Hwang