Slashdot Mirror


Is JavaScript Ready For Creating Quality Games?

kumpetan writes "After seeing so many games built with JavaScript, and considering the applications it powers and the use of Ajax, it seems like web developers are now in the game development pot. It is getting easier and more popular with libraries like jQuery, MooTools, Prototype, etc. There are even libraries like Game JS, GameQuery or JavaScript GameLib, specifically for this purpose. So, will we start to see more ambitious game projects arise using these tools?"

35 of 165 comments (clear)

  1. java != javascript by QuantumG · · Score: 3, Informative

    javascript is more like scheme with a C syntax (the one and only syntax, all hail!)

    http://www.quantumg.net/tetris.php

    Enjoy.

    --
    How we know is more important than what we know.
    1. Re:java != javascript by ChienAndalu · · Score: 2, Insightful

      Presses 'down' key on keyboard

      Seeing page scrolling down

      Is JavaScript Ready For Creating Quality Games? NO

    2. Re:java != javascript by QuantumG · · Score: 4, Funny

      That's a feature.

      --
      How we know is more important than what we know.
    3. Re:java != javascript by Jamie's+Nightmare · · Score: 2, Interesting

      Not exactly breathtaking. Tetris hasn't been cool since the original game boy. Why not interact with an Italian plumber instead?

      --
      "When you see a unixer brainwashed beyond saving, kick him out of the door." - Xah Lee
    4. Re:java != javascript by QuantumG · · Score: 3, Insightful

      Because, for some ungodly reason, everyone still uses keyboards that put the cursor keys on the same side as the mouse. Surfing the web is all about the freakin' mouse.. so making a web game that requires you to take your hand off the mouse is a bit silly.

      --
      How we know is more important than what we know.
    5. Re:java != javascript by AKAImBatman · · Score: 3, Informative

      http://www.quantumg.net/tetris.php

      Needs work. Here's my version, complete with an adapter for Internet Exploder:

      http://java.dnsalias.com/tetris/ie

      (Mine is based on the NES version rather than the more modern Tetris versions, so use UP to rotate, DOWN to make it drop faster, LEFT/RIGHT to reposition the piece. If you use IE, click outside the block-drop area to make sure that it has proper focus as I have not finished the adapter.)

      While not as pretty, there's also an online multiplayer version written in Javascript here:

      http://www.wiicade.com/gameDetail.aspx?gameID=1063

      That one is not mine, though the programmer did use my network technology. ;-)

  2. Easier? by Psychotria · · Score: 4, Insightful

    It is getting easier and more popular with libraries like jQuery, MooTools, Prototype, etc

    What does "easiness" (of programming) have to do with the end quality of the game? It could probably be argued that "easiness" (fancy API's etc) actually reduce the quality of games by giving tools to people who do not know how to wield them properly. This is obviously not true for all games; there are simple games that can be adequately programmed in lots of languages. Addictive, puzzle-like, entertaining games. Then there are other games that push the envelope of what is possible. Pushing the envelope does not make a good game though so I digress.

    To cut a long story short I don't think the availability of libraries etc to do the grunt work of games will improves things. In fact, I think it may result in an influx of poorly programmed/poorly thought-out games written by people who know enough to program a web page or move a LOGO turtle. It may of course be great for prototyping.

    Note to QuantumG: Exclude your tetris implementation from the above comments. Nice work.

    1. Re:Easier? by Xest · · Score: 3, Interesting

      It's because most game developers wont want to pratt about for weeks trying to get the core Javascript stuff done, they'll want to write games.

      The availability of these libraries mean they can do that.

      There's the argument that developers always used to have to write their own driver layer and such in the DOS days and then build a graphics engine on top of that so it's not like game developers didn't used to have this barrier and yet still did well. The problem with that argument is back then, everyone had to do that, nowadays people could just go build something with Flash or just do a non-web game with XNA or something instead.

      The importance of good and easy to use libraries means Javascript has a more level playing field with other technologies that currently attract game developers.

      Messing around developing the underlying APIs, framework and such detracts from the important part of developing games- developing the game itself. The more time that can be spent actually developing games, the more potential there is for the games to be better because more time can be spent on the actual gameplay.

    2. Re:Easier? by Psychotria · · Score: 2, Interesting

      Well, I agree with most of what you say. However, judging by the quality of several recent games that I presume were written in C++ using frameworks that I assume were also written using C, C++ or (parts) ASM, I can't assert that I believe that the framework being available to JS developers would have improved the situation. The guys doing stuff in c/c++/asm are not doing everything themselves... they use lots of libraries. What makes you think that the same libraries being made available to JS programmers would improve the situation? Wouldn't it make the situation worse?

    3. Re:Easier? by Xest · · Score: 2, Interesting

      I don't think we'll ever eliminate bad games on some specific platform no matter how easy we make it to make games for that platform.

      What we will see is an overall increase in games, and with that an increase in good games. It may be that we only get 1 good game for every 100 crap games, but I don't see that as a problem because people will play the good games and ignore the crap ones- as long as there are more good ones out there than that's what we want. Easy to use libraries allow for that, they allow 100 more crap games to be made, but with it they bring 1 good game and again, that's what we want- more good games.

      We've seen this happen before with mobile phone games, with flash games and to an extent we're seeing it now with XBox 360 community games and to a point we're seeing it with the Wii, where many games make use of the new control scheme but most are crap, however it's made worth it by the few that are good.

      The problem is if you don't have an easy to use platform for creating games in the first place you wont even get most the crap games, let alone the good ones.

      There are exceptions to every rule certainly, someone will always go that extra mile and slug their arse off to make a game on an obscure gaming platform (I'd argue Tribal Trouble did this somewhat with the Java platform) but that in itself will lead to creation of easy to use libraries. Some of Popcap's games and games like Fantastic Contraption (There's always going to be bad developers and bad games, this will always be a problem.

      Easier to use libraries wont even increase the amount of good games in relation to the amount of bad games.

      What it will do though is open the door for a few good developers/innovators that will produce good stuff. I'm not so fussed about quantity, like you I want quality, but they go hand in hand with this sort of thing to an extent, that to have any quality titles you need some amount of quantity, that is, for every 100 crap titles, you might find 1 good one, but it's that 1 good one I'll bother with and the others that I'll ignore. If we only have a 1 in 100 chance of a Javascript game being good and we only have 20 Javascript games out there then there isn't the greatest of chances that any of them will be any good.

      I've noticed the same with XNA community games on the XBox 360, there is so much crap on there, but amongst it all there are a couple of gems and to me, they make it all worthwhile.

      We can't ever expect every game for a specific technology to be good, no matter what we do this will never happen, but we certainly can start opening up more platforms to game developers and over time things will improve. We've seen this happen before with Flash games and Mobile phone games, we're seeing it happen now with XNA community games on the 360. For all the flash crap there is out there, we eventually end up with excellent games like Fantastic contraption (fantasticcontraption.com) are a testament to the good games that can exist once the tools are available (although in Popcap's case, they made a lot of the tools).

      I've recently even seen some games made on the likes of XNA by people who weren't previously programmers, this in no way means they're incapable of making a good game, some of their ideas are great and the ease of XNA (or even other engines, such as Torque Game Builder) have allowed them to realise those ideas. It's the ease of use of the tools that made these, previously non-programmers, produce better games than the guy who can write a full blown engine + game on top of raw Javascript.

      In a way, I'm not even sure that production of massive amount of crap is even a bad thing, after all most this crap is produced by teens experimenting with the tools and these teens maybe your John Carmack's of tommorrow, making sure the tools are available again in this case is surely only a good thing.

      I think the fundamental point I'm getting at is this- bad games, released free don't actually hurt anyone, there's no downside to having lots of bad games out there, but there are upsides- such as allowing people to learn to make better games.

  3. Re:There are Java games, so why not JScript? by farnsworth · · Score: 3, Informative

    I very seriously doubt the designers of Java would have envisioned someone making a couple of FPS out of their creation.

    Java was originally designed to be a multi-media platform for televisions. It's 2d and 3d APIs are, although simple, pretty good. Actual functionality was bolted on later (see ya Vector!).

    --

    There aint no pancake so thin it doesn't have two sides.

  4. Yes. See Flash. by naz404 · · Score: 3, Insightful

    it seems like web developers are now in the game development pot

    Flash was the realm of web designers/web developers and is now one of the most widespread game development platforms.

    Moreover, Flash's scripting language, Actionscript is based on ECMAScript which is in turn based on JavaScript, so Flash game developers have in fact been creating games in Javascript for some time now.

    Flash Actionscript = JavaScript (although Actionscript 3.0 now resembles Java more)

    So yes, Javascript is not just ready, but has in fact been one of the de facto languages for creating quality (fun and addicting!) (Flash) games in the past few years.

  5. The keyword, however, is "quality" by RLiegh · · Score: 2, Insightful

    I'll be the first to admit that my knowledge of flash-based games is quite limited; but just because java script can do most of what flash can do doesn't mean that it's ready to do quality games.

    1. Re:The keyword, however, is "quality" by oliderid · · Score: 4, Insightful

      Javascript can't. The biggest problem imho is animation and vectors. You can't really use formats like SVG which is poorly supported by most browsers (if not all). So if you plan a 100% javascript+html+css, you have to stick to bitmap sprites and even there, there are some issues (slow, browser compatibility, etc.).

    2. Re:The keyword, however, is "quality" by h4rm0ny · · Score: 2, Interesting


      But SVG *is* XML-based and can be manipulated as a DOM. We're really 2/3rds of the way there in terms of manipulating it with Javascript. And if we get that, all we have to do is prise streaming video away from FLASH, and we're from FLASH at last!

      --

      Aide-toi, le Ciel t'aidera - Jeanne D'Arc.
    3. Re:The keyword, however, is "quality" by aliquis · · Score: 4, Insightful

      Safari, Opera and Firefox already have support for embedded videos thru HTML 5. So we're already there.

      All I want for christmas is YouTube, DAP- and game-reviewing sites to start using it instead of flash. Probably won't happen until Microsoft has managed to drag their balls out of their ass and manage to pull IE8 out at the same time (and way ..)

      If only atleast Google had some balls big enough to say "oh well, YouTube requires a decent browser!", or they could just check with JavaScript if the browser is new enough to have HTML5 video support and fall back on Flash if it's not.

    4. Re:The keyword, however, is "quality" by dreemernj · · Score: 2, Interesting

      Widespread use of the video tag probably won't become too common until there is a specific codec or group of codecs that are specified to go with it.

      The tag spec just says it'll load a video, but doesn't specify what kind of video. Safari does quicktime and installed codecs. Firefox and Opera I believe do OGG Vorbis/Theora. If IE added it I would guess they'd do WMV.

      The video tag is not done yet. So its not going to get much use.

      --
      1 (short ton / firkin) = 89.1432354 slugs / keg
    5. Re:The keyword, however, is "quality" by aliquis · · Score: 2, Interesting

      I assumed all of them would support whatever codecs you had installed? If Firefox and Opera don't that suck.

      I see no problem with using mixed video codecs for the videos as long as every browser support the codecs you have installed. My Quicktime can probably play most stuff anyway, and obviously my VLC/mplayer classic would to if I had ran Windows, or mplayer in BSD or whatever.

    6. Re:The keyword, however, is "quality" by dreemernj · · Score: 2, Interesting

      We already have what you are describing. MOV, AVI, MPG, WMV, they can all be embedded in all the major browsers right now.

      One of the reasons flash is so popular amongst the folks embedding video in sites is that its become a platform for video thats extremely common on the web. It has a standard format.

      Until the video tag spec has a viable video format to go with it, its meaningless. It just means we would use a video tag instead of embed/object/whatever to add the video to the site.

      If FireFox and Opera choose OGG (Vorbis/Theora) and don't use other formats, I believe they'll have made the right choice. Until there is a standard, its just more of the sort of stuff we've been using for years.

      --
      1 (short ton / firkin) = 89.1432354 slugs / keg
  6. short answer: yes by El_Muerte_TDS · · Score: 4, Insightful

    There is no reason why you can't use JavaScript as the script engine for your game engine. Just like you could use lua or python.

    If the question is if JavaScript + WebBrowser is ready for games? Yes, has been for quite some time. With improving javascript interpreter speed and better webbrowser functionality (i.e. "canvas") element you can even create graphic intensive games. But javascript based sudoku, tetris, sokoban, etc. games have been possible for over 10 years.

  7. No, of course not! by Lorens · · Score: 2, Funny

    As you say it's getting easier and more popular, and bandwidth is getting better, but I can't for the life of me see why people already writing browser games would try to use that to write *better* browser games... can you? You'd better ask slashdot!

  8. Re:Actionscript by Achoi77 · · Score: 2, Informative

    I assumed the problem with using javascript was the inability to manipulate images at the bit level with relative ease. People have made some successful projects using the canvas object to handle their 'blitting,' but do all browsers even support it (shifting eyes at IE)?

    Another (rather unrelated) issue would be the lack of a mature way to communicate between server and client - cheaply that is. If someone is going to make their own browser based graphic mud, that means they are going to have to write their own comet app. Not a lot of ppl are willing to write their own server. You can't really control how you want your game to do socked based communication.

    But the main issue is the lack of ability to be able to program close enough to the 'metal.' That means no native support to take advantage of things like the video card for 3D, or sound card or what have you. Nor the fact that you can't simply plug in a gamepad controller and just playing your javascript game (at least, not without doing some config work on your gamepad prior).

    Most games are (relatively) graphic intensive, and the people that code them want to have the freedom to be able to access the power of the computer that is running them. With different browsers having different javascript engines, you're going to end up with very inconsistent results when playing a game on IE compared to FF compared to Safari compared to Chrome. *shrug* I don't know, it just seems too much of a pain to take into account all those factors when trying to come up with consistent gaming experiences, at least with flash or java you can (somewhat) expect to have a common platform to develop on, considering the trouble people are having with cross-browser compatability when simply making web pages. (just being snarky) :-P

  9. Quality? Games? by sweet_petunias_full_ · · Score: 5, Insightful

    How about we start with some quality... webpages?

    You know, the type that worked reliably with just about any browser, the way it used to in Web 1.0 before web standards became a marketshare battleground?

    Lately, websites have become picky about which browser you use for just this reason. The AJAX monster they're trying to get everyone to use is just too unwieldy and expensive to maintain in terms of programmer time if they actually have to support all of the browser versions. The outstanding bug count is too much even for some of the big players in this space, I dare say.

    I'm sorry, but I'm just not that optimistic that games will be very well supported across browser versions to think that it will result in "quality". Instead I have a sneaky suspicion that someone will try to use some slick game that works on a couple of browsers to pull marketshare over to its cloud, but all the while dictating to people which browser they must waste their time upgrading in order to participate in the hypefest. Then, a few browser versions later, the game won't work anymore.

    --
    You can't send a takedown notice to an already printed newspaper.
    1. Re:Quality? Games? by sakdoctor · · Score: 2, Insightful

      You must have been on different internet tubes from me.
      For me "Web 1.0" was riddled with badly written copy/paste JavaScript, IE only sites, punchable monkeys, doubleclick cookies, dancing hamster gifs and pop-ups that you couldn't block.

      How can the vast progress we've made not make you optimistic?

    2. Re:Quality? Games? by Anonymous Coward · · Score: 2, Insightful

      Part of the reason people use libraries like Dojo, Mootools, etc is because they solve a lot of the cross browser woes. I've been developing in dojo for over 2 years now and I rarely have browser compatibility problems, except with older IE which I'm lucky not to support.

      I do think certain goals would be idiotic to even attempt outside of the Canvas element, and if you are working in the DOM, you most likely would like transparent PNG support because most games that aren't text based have some form of image composition going on.

      That said, if you are requiring canvas xor png32, you already have reasonably high requirements on what browsers can be used. You won't be worrying about IE6 flaws.

  10. Blame CSS, HTML and IE by Nicolas+MONNET · · Score: 4, Interesting

    HTML+CSS (current versions) is inadequate for most of what it's used for (user interfaces), as opposed to what it's meant for (documents). Add to the mix the monster that is IE, and you need javascript to make it bearable.

  11. Define "ready" by Kjella · · Score: 5, Interesting

    Q: Is JavaScript Ready For Creating Quality Games?

    A: No, but it's happening anyway.

    People build quality games out of the wierdest languages, for example Transport Tycoon Deluxe was built in assembler around 1995. I have no doubt you can write quality games in javascript. I don't think it's the easiest or best way, but it's not really my concern. If they cna make it happen, more power to them.

    --
    Live today, because you never know what tomorrow brings
  12. Why? by TheSpoom · · Score: 2, Informative

    Hasn't anyone heard of "the right tool for the right job"?

    Sure, you might be able to force JavaScript into displaying graphics and sound with some crazy tricks or frameworks, but why bother when you can do the same thing much easier and with many fewer browser or speed issues in Flash?

    --
    It's better to vote for what you want and not get it than to vote for what you don't want and get it.
    - E. Debs
  13. Hmm... by Canazza · · Score: 2, Informative

    The main problem - as far as I can see - with Javascript based programming is that by using a plugin, such as Firebug - one can effectivly go into Debug mode, set breakpoints, changing variables and all sorts of stuff in the client-side Javascript, opening up a whole world of possibilities for hacking, so unless you want to handle changing score, state or whatever server-side (which would require a rather good server to handle that) you're going to be left with a game where you can never be sure that the outcome is a result of the game logic and not someone's poking around.
    Think about a high-score table for example, I could easilly modify whatever variable holds my score and then end the game with a massive score.
    Javascript games will be a novelty, no more, I don't see it becoming anything mainstream (definitly not rivialing Flash or Java) mainly because anything sensitive will be wide open to hacks and work arounds.

    --
    It pays to be obvious, especially if you have a reputation for being subtle.
  14. Interesting Turn Of Events by Jekler · · Score: 3, Insightful

    I find it interesting that we're still figuring out how to implement games on a 32/64-bit 2+ gigahertz computer that barely rival games we previously implemented on an 8-bit 2 megahertz platform (NES). I would have imagined that even in a worst case scenario, emulation of an NES system in JavaScript would be trivial just by throwing more processor cycles at it, but the games people are creating in ActionScript and JavaScript are closer to Atari 2600 games than anything else. The games that are more complex tax a modern computer as much as the latest 3D games.

  15. Re:breakout by AKAImBatman · · Score: 2, Interesting

    Like this? Breakout is a fairly simple game that requires only minimal animation. That makes it relatively easy to program. That doesn't mean it can't be done better. The breakout example I linked to it pretty choppy once you slow it down to a reasonable speed.

    I wrote a DHTML version of Pong a while back that is far superior. Here's a link. The underlying architecture was very primitive when I wrote it, not having features like the Canvas tag available. And yet it is one of the better Pong variations on the net. (If you don't mind my saying so.) The reason for its superiority is simple: 95% of people who write a game don't understand what makes games interesting.

    In the case of Pong, nearly all variations are too slow and the AI consists of stupidly following the ball. Well, that's not very fun. The ball should bounce fairly quickly and the AI should respond like a human. How do you make AI respond like a human, though? Simple: It should not act robotic and it should make mistakes.

    The AI for Pong stops moving the paddle when the ball is traveling in the opposite direction. This helps remove the "robot" feel of the opponent. Next, the computer is limited to the same rate of movement as the player. This gives the player a chance to sneak one by the computer. (Since the ball is faster than the paddle.) Finally, the AI has a bit of jitter in its algorithm. Rather than moving with the ball, it computes where the ball is expected to be. A random amount of jitter is then added to the computation so that the computer has the possibility of "misjudging" where the ball will actually arrive. By adjusting the jitter, the game can be made to play on easy, normal, or hard. (Use the options menu to set the difficulty. Though for some reason, the menu doesn't work on Chrome. So just be aware of that issue.)

    Another game that is rarely done right is Tetris. Take the Jetris game in the "GameJS" link. It's a nice tech demo, but it's a sub-par game. And not because the game is of the "classic" Tetris variety. (My own Tetris game was of the same variety.) It at least gets the coloring right in that each piece is a specific color. (Though adhering to the Tetris standards for coloring would have been an improvement.) That's a good first step. The bigger issue is that the piece selection does not have a very good distribution of pieces. I regularly get three or four of the same piece in a row. That should never happen in a good Tetris game. Programmers need to take steps to ensure that the player will never get more than two of the same piece in a row. The Tetris "Bag" algorithm is a good solution to this that makes the game more fun. Another good trick is to ensure that pieces always arrive in the default rotation.

    Anyway, the point of my rant is that the technology is rarely the problem. A good game programmer can make a fun game out of nearly any technology. An inexperienced game programmer with no understanding of what is "fun" can make any technology look like the problem.

  16. Why, should it? by token0 · · Score: 2, Funny

    In related stories:
    Is bash ready for creating quality databases?
    Are homing pigeons ready for creating quality mobile phone networks?
    Is brainfuck ready for creating anything (quality)?

  17. Why not stick with flash? by merreborn · · Score: 2, Insightful

    Even as a huge fan of AJAX web applications and javascript libraries, I don't understand why'd you'd pick javscript over flash for developing anything any more complex than tetris.

    Anything javascript can do, flash can do better and faster. And the number of flash-capable browsers out there is almost as high as the number of javascript-capable browsers. Flash gives you far, far better image handling capabilities, and more.

    Other than the "haha, I did X on a platform that isn't really meant for it" factor, why would any serious game developer choose the javascript-in-a-browser platform?

  18. Re:breakout by Annymouse+Cowherd · · Score: 3, Interesting

    Another great one is DHTML Lemmings

  19. Re:IE is still the supermajority browser by tepples · · Score: 2, Interesting

    There is little work in making Javascript be to SVG what Action Script is to FLASH.

    There's still a lot of work. The SWF player is installed on PCs before people buy them, unlike the SVG player. SWF supports audio; SVG does not, and no web browser that I'm aware of supports SMIL.