Sign in to follow this  
0x6719

[web] So... flash or javascript?

Recommended Posts

0x6719    100
No doubt both are very amazing, but I'm stuck in a dilemma on which should I build my new game on?

I know flash is very good for animations and with ActionScript3, the programtical side of flash games have become a lot better as well. But the problem being that it is horrible for accessibility users, and the change in different flash versions I heard is also a bad issue.

javascript on the other hand, is very accessible and doesn't depend on anything but the browser (+ javascript being on). It is also really fast in the majority of browsers (excluding IE < 8). And when based off a library like jQuery, it has a pretty damn good chance of working the same on most browsers. But the problem with JS is that it is much easier to find and exploit bugs, "cracked", (especially with editing JS on the fly) + not the best for various animations (ex: random smoke).

So as you may see by now, they both have pros and cons, but I don't know which one will cause more problems in the future.

I'm going to be a building an isometric game, the basic concept will be: building blocks, various objects moving across the grid, and several animations.

Share this post


Link to post
Share on other sites
ZeRaW    384
if you are talking about HTML5 canvas then it is only available in modern browsers.
If you are animating using pure javascript vs flash it is like comparing a software renderer vs a hardware renderer.

even HTML5 canvas is still buggy on some browsers.

with flash AS3 you can pick it up and deliver something in less time.

the drawback is that you cannot have anything that can run on ipad/iphone

Share this post


Link to post
Share on other sites
jujunosuke    188
seriously, what game can you do in javascript ?
Flash is not horrible for accessibility users.

If we believe what Adobe say : 98% of penetration for Flash Player 10.

So, just make your game in Flash 7,8 or 9 to be sure to have the max possible accessibility.

I don't understand why change in different Flash version is a bad issue.
With the latest Flash player you can still read content of the older versions...

Maybe the only weakness of Flash right now is mobile device, smart phones etc.
Other than that, i will recommend you Flash !

But also depends on your skills on both languages ?

Share this post


Link to post
Share on other sites
PaulCesar    524
IMHO HTML5 is not ready for prime time just yet for GAMES. Market saturation is still quite slow. In many cases people are more hesitant to upgrade their browsers then upgrade flash. However, anyone who plays games online is going to have flash. Or frankly they are not going to be playing games online in the first place. The primary rule of business is to cater to your demographic. Your demographic in this case is more likely to have flash than it is to have HTML5 support (at least for now).

In addition to this, javascript (in the browser) like you stated is slow or buggy for many things. Sure, with some of the cross platform high performance extension libraries available, you COULD build a game in it. However you can build the same game just as easily in flash AS3 (AS3 is based on a draft spec of what was going to be the next incarnation of javascript, you can even find versions of jQuery and such for it!). Your animations will run smoother. You can take full advantage of opacity. You have a wide range of media support, etc

And just to remove some of the hesitation caused by the (most likely unintentional) deceptive explanation by earlier posters, flash (10+) will perform loads better than javascript on two of the largest smartphone operating systems(iOS, android). While some will argue that flash does not exist on the iOS, and that is partially true, flash actually has the ability to compile directly down and run natively on the iphone, ipad, etc. So the point is mute.

And nothing is stopping you from using both either (mind you, you will then be increasing the lowest common denominator, though I would gather not by much). Many flash apps I have written for clients communicate with the host page via ordinary javascript. I use this quite often for integrating micro transaction systems for social apps, various ajax overlays, and allowing my apps on various domains to communicate with eachother (using cross-domain javascript)

Share this post


Link to post
Share on other sites
simono    100
Quote:
Original post by jujunosuke
seriously, what game can you do in javascript ?
Flash is not horrible for accessibility users.


the biggest problem with javascript/Canvas development is InternetExplorer. if you ignore it, you can do everything in JS you can do in Flash (probably more).

e.g., http://www.phoboslab.org/biolab/

but JS development is free and flash developer costs.. how much?

also a good place to pimp my framework :) http://gamejs.org

Share this post


Link to post
Share on other sites
simono    100
Quote:
Original post by PaulCesar
flash actually has the ability to compile directly down and run natively on the iphone, ipad, etc. So the point is mute.


?? how is this done. afaik this kind of thing is now forbidden by apple. see:

http://daringfireball.net/2010/04/iphone_agreement_bans_flash_compiler

Share this post


Link to post
Share on other sites
ZeRaW    384
@ simono your link is outdated. flash apps are supported now 100% on iphone.
http://www.adobe.com/devnet/logged_in/abansod_iphone.html

the only problem is that I did some tests and it is as slow as hell even for basic animations on a 3GS.

For flash vs JS, flash is easier to maintain, and you can develop for free (check flashdevelop and flex SDK).

In terms of animations, you would be re-inventing the wheel if you go with JS. You have a large set of 2D and 3D libraries for flash.

Share this post


Link to post
Share on other sites
WillPash    211
Quote:
Original post by simono

but JS development is free and flash developer costs.. how much?


If you use Adobe Flex SDK as the main codebase and use FlashDevelop (Windows only) as the IDE, which you can code, compile, debug and build your Flash application without the need for the full Adobe Flash suite for FREE. As long as you are happy to code everything, you cannot go wrong with both tools. HTML5 is a great technology (especailly when WebGL is fully implemented), but it is at its infancy. And not all game players will be warm with HTML5+javascript, as they are so used to playing Flash games. Remember think like an typical non-technical game developer. Are they really going to break their sweat to update to the latest web browser (in some cases beta). I have to admit, using the Free Flash tools i mentioned with Papervision3D and Jiglibflash is a good start, as I enjoy writing games in these technologies. I am also starting a HTML5+javascript project. I tried some case studies, and some browsers (firefox, safari, chrome, opera) have differing qualities in render. Some browsers render faster than others, so writing games in HTML5+JS is a shot in the dark at this current stage. Warning as well, JQuery is excellent for nice interfaces, but DONT try it to build games, it is so slow and cumbersome in performance, as remember it is another abstraction layer, which will slow down, or even crash your game if you go over-ambitious.

Share this post


Link to post
Share on other sites
simono    100
Quote:
Original post by ZeRaW
@ simono your link is outdated. flash apps are supported now 100% on iphone.
http://www.adobe.com/devnet/logged_in/abansod_iphone.html



ah, thanks for that link! of course *that* didn't make the news ;)

Quote:

For flash vs JS, flash is easier to maintain, and you can develop for free (check flashdevelop and flex SDK).


can you sell programs done with the free version? i'd assume there must be some difference, else everyone would use the free version.

regarding maintainability i'm not sure what you mean - JS IDEs might not be on par with flash IDEs but few languages have such specialized IDEs built just for them.

Quote:

In terms of animations, you would be re-inventing the wheel if you go with JS. You have a large set of 2D and 3D libraries for flash.


sure, it would be a bit like re-inventing the wheel. flash = ECMAScript + nice IDE + very good libraries. nothing we can't do without adobe. i just don't like flash and the fact that there's still people advertising it - it *is* practical, i admit that too.

Share this post


Link to post
Share on other sites
simono    100
Quote:
Original post by WillPash

HTML5 is a great technology (especailly when WebGL is fully implemented), but it is at its infancy. And not all game players will be warm with HTML5+javascript, as they are so used to playing Flash games. Remember think like an typical non-technical game developer. Are they really going to break their sweat to update to the latest web browser (in some cases beta).


I admit it's harder to do and still has it problems. I'm just very unhappy when everyone seems to instantly disregard JS game development as "no can't be done, it's slow & impossible".. that's not true.

it takes a bit more dedication but imo the result is worth it - you're not dependent on development tools by one company.

Share this post


Link to post
Share on other sites
0x6719    100
I'm more experienced in JS and know basic AS3 but hell, I don't mind learning new languages - its not hard for me to adapt to one.

As for the JS game, I wasn't going to use a canvas. I'm already aware that canvas is still not suitable for a wide targeted audience, I was going to build it inside div containers. The animations I can't really think of generating dynamically (like moving limbs - generating smoke) in JS, which is a pretty good drawback from what I want to make.

After reading through though, I'm probably going to settle for flash until a year or two when canvas will be a lot more stable and joins majority :)

Thanks guys, valuable input.

Share this post


Link to post
Share on other sites
Neeneko    100
Quote:
Original post by simono
can you sell programs done with the free version? i'd assume there must be some difference, else everyone would use the free version.


As someone who is in the process of learning them, I can chime in here.

You can indeed sell programs produced with the free version. When you get the 'paid' version what you are really paying for is a nice development environment. If you are happy working with VI and make (as I am doing) then the Flex SDK works just fine. If you are someone who works best in a nice integrated environment then you would find it lacking. Given that most people prefer IDEs, people are generally willing to pay the price to use one, esp since it is only an one time up front cost rather then a per-unit fee.

Share this post


Link to post
Share on other sites
Ravyne    14300
So, I did some experimenting a couple months ago to create a simple, real-time game in HTML5, using the new Canvas (2D) and Sound elements.

The first thing to realize is that ActionScript (the Flash Programming language) and javascript are both implementations of ECMA-Script. In Flash, code tends to take a form that looks more object-oriented, while in javascript you tend to implement OO patterns like encapsulation through Closures or other language features (for all its detractors and flaws, there exists a subset of javascript which is actually a really nice language) -- basically, javascript can be just as Object-Oriented, but you accomplish it in a different way. I'm not sure if this is more a matter of tradition or if common javascript implementations aren't as up-to-date with ECMA-Script as Flash is, but it is what it is. I have also read that Mozilla is working to unify their javascript engine with ActionScript and I imagine that everyone but IE (perhaps IE even) will follow suit.

For me, I found that the biggest bump in the road is support for Sound in HTML5. the Sound element is there, but its not really designed for low-latency delivery and there's no real "sound mixer" to speak of -- basically you get load, start, pause, stop, volume control and (IIRC) basic stereo panning. Since this model doesn't separate the concept of sound "samples" from "sources" you have to create a sound element for each and every single sound that might be emitted by each and every thing that might emit them -- in other words, if you have 5 baddies that all make the same 5 sounds, then you need 25 Sound tags. Its note entirely clear whether browsers are smart enough to coalesce these sound resources and mix them internally, and if they do then this is not much of an issue aside from being an awkward model, programatically speaking, but I imagine that the actual behavior depends on which browser is in use.

If you can deal with that, and/or your game doesn't have a ton of sound effects, then the rest of HTML5 + javascript is there and quite capable. There was a user here awhile ago that had implemented a Quake 3 map viewer with collision around the time I was doing my experiments. The only other issue is really distribution, because there simply aren't portal sites for HTML5 games like there are for flash. I firmly believe that these issues will be resolved in time, as everyone but Adobe has a vested interest in weening off flash. Google especially has a vested interest in Web applications, and have just today announced the Chrome Store which will be online before the new year, which is a venue for selling HTML5 applications ranging from productivity apps to games.

Ultimately, I think the question is "Do I want a proven-but-closed, full-stack platform today (flash) or do I bet on an unproven but well-backed and more open platform that doesn't provide all the pieces of the puzzle today?" Neither one is right, it just depends on your need and outlook.

Share this post


Link to post
Share on other sites
Neeneko    100
Quote:
Original post by Ravyne
Ultimately, I think the question is "Do I want a proven-but-closed, full-stack platform today (flash) or do I bet on an unproven but well-backed and more open platform that doesn't provide all the pieces of the puzzle today?" Neither one is right, it just depends on your need and outlook.


I think there is one other question to ask... do you want to integrate the app with the web page, or have it self contained?

That is the biggest difference I have found so far... HTML5 Canvas can access and alter the page it is on and interface with other dynamic elements, so it is a real part of the page.

Flash/Flex on the other hand is a self contained module with strict boundaries between it and the rest of the server. It can also easily create self contained stand alone modules that can be downloaded and executed, which can be nice.

Share this post


Link to post
Share on other sites
nimbus    100
Quote:
Original post by NeenekoThat is the biggest difference I have found so far... HTML5 Canvas can access and alter the page it is on and interface with other dynamic elements, so it is a real part of the page.


You can execute javascript from within a swf. And receive callbacks.

Honestly, bluntly, html5 is just no substitute for high quality multimedia content. It's a flash video player replacement, not a flash player replacement.

Share this post


Link to post
Share on other sites
Neeneko    100
Quote:
Original post by nimbus

You can execute javascript from within a swf. And receive callbacks.

Honestly, bluntly, html5 is just no substitute for high quality multimedia content. It's a flash video player replacement, not a flash player replacement.


Interesting, I have not seen that mentioned yet. I guess another thing to look forward to figuring out how to do ^_^

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