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?"
I always thought the break out games written in java script were good quality games and they been around for years...
Since Flash's Actionscript and Javascript are basically identical, almost anything that can be done in one can be done in the other. The real limitation is DOM, which sucks compared to Flash.
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.
Since there are already games built on Java like Specforce I don't see why somebody wouldn't use JScript to build a game. And yes, I know there is a big difference between Java and JScript, I am simply pointing out that when Java came out I very seriously doubt the designers of Java would have envisioned someone making a couple of FPS out of their creation.
ACs don't waste your time replying, your posts are never seen by me.
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.
A small javascript game to waste time with.
http://fn.dy.fi/old/misc/matrix/index.pl
Matter of performance, not language capabilities.
Writing games in JS is rather easy, rather pleasant, rather fast. It's a nice language for the programmer, due to very flexible structure (override built-in methods? yay!) and has some great development tools (Firebug), and it's a nice language for the user, because everyone has a web browser, no installation required.
It's not nice for the machine. First, it's an interpreter. Second, due to this very extreme flexibility it won't ever be very efficient. It's sandboxed, meaning it can't run natively at full speed, every operation must be scrutinized security-wise. The rendering uses non-native extensions that lack in efficiency too. It's event-based meaning you shouldn't run a loop at full speed (or the user gets a requester "this page is running slow, should I stop the script?"), you need to create clock events to trigger each iteration. And you get a HUGE pile of compatibility issues.
Of course, if you create a faster computer, the Nature will create programmers writing the usual in slower programming languages.
45 5F E1 04 22 CA 29 C4 93 3F 95 05 2B 79 2A B2
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.
http://www.object404.com
It's definitely ready for card games, and probably some 2D tile-based type games. You know, like, say, [url=http://www.spiderwebsoftware.com/exile3/winexile3.html]Exile III[/url]. That was an excellent game, due mostly to its interesting writing and vast scope, because the graphics sure weren't carrying the day. You could probably put together a web-based version of that without too much trouble.
But nobody's going to be rewriting World of Warcraft for JS in the foreseeable future.
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.
You don't just build an ambitious game. You build up to it. Start with something simple. Increase complexity. Find the problems a few at a time rather than all at once.
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.
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!
There are a couple out there now. Vox Imperium is one I play pretty regularly. Its not all that great, but hey? Its Civish and doesn't require any plugins. All Ajax. Just don't use Lynx.
http://www.voximperium.com
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.
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.
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
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
It shouldn't be that difficult to make a JavaScript version of ADVENT ("Colossal Cave Adventure"). An Inform source to JS compiler... that might be harder, but not impossible.
I hope it is as I'm writing a Risk/Diplomacy type of game where the client is in pure js. It works, but is somewhat slow in IE 7 and does not work i IE 6.
There is no special IE version. The problem is getting nice grafiks, not the js language.
The Beta version can be found here (in Swedish)
http://warofhonor.se
and use the FORTRAN source to port to JS. Sure, it's like crayons and a big chief tablet, but IIRC that's what Colossal Cave was first coded in. I know I ran across a FTN version in 1979.
Pavlov wouldn't be so famous if he'd used a can opener instead of a bell.
Don't play bad games, just play the good games.
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.
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.
could you pick your nose with a monkey wrench?
yes, probably.
is it a good idea? might there be a better way?
almost certainly.
A friend of mine was bored at work and wrote a Mario Brothers side scroller in Javscript, which included simple a simply but accurate physics of when Mario jumps and falls, just like in the console version. He also wrote a multiplayer animated version of Monopoly in Javascript with the help of a back-end php script for connectivity.
The biggest hurdle in programming fun things in javascript is the browser the user is using(speed of execution issues) and the processing capabilities of their computer.
http://www.fdirep.com/tstubbs Breakout games were pretty cool.. If you really want to make money open your eyes and your mind. The internet is still a very untapped market. Itâ(TM)s easier in life to be dismissive and not try than to even try at all. http://www.getthebar.com/Default.aspx?mrid=Wmld6lnsL2a0qBQ7GOHgeA==/
Check out Unity 3D, a multi-platform 3D IDE focused on letting you use 1 of 3 languages (Javascript, C# or a Python variant) to do all the scripting of your game objects. It's extremely awesome and fun work and I've seen some great games created with it. It makes it all the better that they can run on Mac and Windows, on the desktop or via the browser. Sad for Linux folks who can't play their games yet though. http://www.unity3d.com/
I live life on the edge
I'm working on a game that will be purely HTML+CSS+JavaScript (PHP backend). It will be similar to Uplink and will include multiplayer. If you are interested in seeing a video just search for "uplink inspired multiplayer" (I don't know how Slashdot views self promotion).
I'm left-handed, you insensitive clod!
I'm always happy to see stories like this go by, because it gives me a chance to shamelessly plug my own webgame. ;)
In this case, PseudoQuest is a great example of some of the crazy stuff one can do when combining existing libraries (Prototype, Scriptaculous) with custom code.
Interesting bits relevant to the JS portion of this article include: realtime PvP combat, a spiffy windowing system, drag/drop quickbar, in-game chat, easy-to-use player housing customization interface (drag/drop), and - of course - a host of non-JS related features.
As a caveat, it's just me creating it, so I haven't had time to polish it in IE - it's best viewed in Firefox 3 or Opera 9.6.
I also maintain a development blog of sorts in the forums (under "Status Updates"), for those that might be interested in such a thing.
Enjoy!
http://www.pseudoquest.com/
That green slime had it coming.
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)?
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?
Back in the day I did a small racing game all in DHTML.
I even added a highscore table - too bad it got hijacked by spammers:(
TIE fighter space chase
Wireframe & filled z-buffering 3d engine
The toys page has more demos, and a link to some games too (try Robots).
I want to see Crysis written in JavaScript...
in chrome the javascript breakout game you linked runs too fast to humanly play.
Don't forget UNITY, the game dev environment complete with 3D graphics and Mono/NET framework.
You can use Javascript with it! It's awesome, and supports iPhone and Wii now.
www.unity3d.com
(dev platform is currently Mac but a windows version will be out mid 2009)
Super Mario, Mario Kart, WolfenFlickr 3D, 3D Chess: http://www.nihilogic.dk/labs/javascript-games/
Spacius: http://scriptnode.com/lab/spacius/
Space Invaders: http://www.rebelideas.co.uk/games/invamars/
JavaScript != Java != JScript.
All separate languages, but with the usual similarities you see between most languages.
I don't know much about JScript actually, i should look into it to see what differences there are.
Notice what happens if you rotate an L shaped piece into an already occupied position?
But is it any more odd than what happens in authentic Tetris games if you rotate a T shaped piece into an occupied position? What about what happens if you lay down a piece and keep spinning it? Not only are these behaviors not considered bugs, they're actually required by The Tetris Company in authentic Tetris products published on or after 2001.
but why bother when you can do the same thing much easier and with many fewer browser or speed issues in Flash?
Because not every budding game developer owns a copy of Flash CS3, nor (I presume) is TheSpoom ready to donate thousands of copies of Adobe software. To write JavaScript, you don't need anything more than the Notepad that came on your existing PC.
but the games people are creating in ActionScript and JavaScript are closer to Atari 2600 games than [NES games]
Video games in the Atari 2600 era were often developed entirely by one person. NES games might have had a team of three to twenty people.
But SVG *is* XML-based
Which means jack droppings if the web browser on the supermajority of your audience's computers doesn't understand the semantics behind the DTD. Or were you thinking of translating SVG on the server side, in much the same way that a lot of web sites to turn random XML into XHTML?
Of course it is not ready for creating quality games.
It is barely usable to create web pages with basic client side scripting (mostly because of Microsoft's humiliatingly embarrassing, and truly shitty implementation, their broken DOM, useless CSS, non-existent SVG, missing Canvas, etc.)
Inconsistent browser implementations, implicitly declared variables, lack of strong typing, all make for a truly horrible language. Forget about trying to use it, unless you are absolutely forced to for some web app.
the modern languages we're working with, like JavaScript and all C-style languages are working at a vastly higher level of abstraction than were available to work with for NES games. This should allow programmers to create far more complex systems with a lot less manpower to manage the complexity.
True, abstractions can reduce programming to 10 percent of game development. But you still need manpower to draw graphics, lay out maps, compose the soundtrack, and test it all. Even something as simplistic as Super Mario Bros. 3 has a 128x4096 pixel graphic bank. And with the higher resolutions and color depths of newer monitors (compare the 1280x720 of modern platforms to the NES's 256x224 pixels), you have to spend even more effort in getting graphics to look good.
I've made an AJAX/CSS Sprite browser game as well :
WMD Tank Battle http://wmdtb.com
Multiplayer map conquest, with real time (but slow) missile-command stuff on the world map.
In your pong game, how long do you typically have to wait before the ball is served? (I've been about ten minutes so far...)
I get it now. This version of pong being "far superior," it simply refuses to play with a hack like me.
Press the space bar.
Javascript + Nintendo DSi = DSiCade
DomainOfHeroes.com uses all javascript/ajax. It is an RPG.