Doom Ported To the Web
kripkenstein writes "Ever since Id Software released the Doom source code under the GPL, it's been ported to platform after platform. Now, you can play Doom compiled to JavaScript on the web, using standard web technologies like Canvas and without any plugins. If your browser has trouble running it, here's a screencast."
The translation was accomplished using Emscripten, a Javascript backend for LLVM. As per the GPL, full source code is available. Pretty neat.
8 fps, and that's on an older work laptop without a fancy graphics card and loaded with lots of crap in the background.
It seems pretty damn impressive that web browsers are as powerful as an entire computer with the specs required to play Doom back in the day. And it's reporting about 35 FPS, too (FF 4.0.1 with a 1.8 GHz dual-core processor and 1 GB of RAM, for what that's worth).
I've always wanted to be able to play Doom at 5 fps, with periodic second-long delays while the JS engine garbage collects, and having to close the browser and restart when the memory leaks get too bad.
34FPS on average. The only problem is the sound quality is really bad. Like, really, really bad.
And it only took 18 years for us to get there (the graphics, that is; sound isn't working very well).
*surprised nobody beat me to the punch on this one*
And it almost gets 30 FPS too completely pegging one of my two cores on a 2.4 ghz proccessor! I understand (hope?) that this isn't supposed to be a serious tech demo, but honestly, if Javascript is (at least one of the parts of) the platform of the future we are seriously fucked. State of the art dynamic recompiling VMs and this is the best we can do for performance? It's time people started realizing that Javascript as a language is fundamentally broken and needs to be replaced.
So instead of a 40MHz 486 and 8MiB of EDO RAM, we now require at least a 2,5GHz dual core with 1GiB of DDR3 SDRAM to accomplish the same thing on a web page.
Screencast isn't a word.
While this is impressive, it has been done before (and better): GWT Quake
It seems pretty damn impressive that web browsers are as powerful as an entire computer ...
I think it has more to do with the power/stability/impressiveness of the JavaScript engines and implementations of standardized ECMAScript specifications. I had submitted a story about Fabrice Bellard emulating a very basic (even primitive) computer and then running Linux in it. But that got rejected.
Developers are slowly coming full circle and using JavaScript a client side application. As the performance cost of emulation and virtualization are outweighed by better machines and as HTML5 become more solid and supported, expect some pretty crazy awesome demos to be seen and maybe a handful of them turning into something generalized and really useful (like the mentioned Emscripten).
My work here is dung.
doesn't work on a year old integrated graphics card (even with an i3 processor). What do you have to have to run it?
GPU: GTX275 NVidia
CPU: E8400 Core2Duo @ 3GHZ
I'm getting 5-7fps. Is this down to me still using Firefox 3.6?
So... no music, and the sound effects are like a half second delayed from the action, AND they sound really REALLY bad. I guess it's impressive what you can do visually with Javascript these days, but at least on my setup, the sound is just.... no where near as mature. That's probably not a huge problem for many people, but personally sound is a huge part of any experience for me, and I find the web constantly disappoints. Except, generally for Flash animation/Flash games which seem to have at least gotten THAT... well, MORE right.
It sure would be nice if we could use languages other than JavaScript in our browser. Not that JavaScript isn't a nice language, but not all problems fit into all languages comfortably. It's cool to see that programs in other languages can be converted into JavaScript, but then, unfortunately, they must be interpreted to be executed.
Not really that impressed in honesty especially since quake online has been about quite a while and works a lot better.
It's also available for PalmOS (ZdoomZ)
"When information is power, privacy is freedom" - Jah-Wren Ryel
Here's the link: http://www.newgrounds.com/portal/view/470460, plus: it does run with a higher framerate.
For those of you who aren't familiar with Javascript for the web for that matter, JS efficiency is somewhat dependent on the browser. Chrome and Safari should be able to handle it just fine.
I mean, it's a cool accomplishment in terms of implementation and all, but...
Ughhhhhhhhhh.
I'm sorry to ruin everyone's fun but this is full of visual glitches.
Port the iOS APIs and run apps from any webhost. Obviously there would be limitations but I wonder what Apple could do about it.
"Just because you can, doesn't mean you should"
Feed the need: Digitaladdiction.net
What am I missing? I tried it in FF 4.01, IE 8 somethingorther and latest chrome, it didn't work in either, chrome at least flored a CPU and sucked up hundreds of MB of memory the others did nothing!? I've got a decent core2duo with Nvidia discrete chip of some kind laptop...
Flash handles this just fine on my MacBook Pro(Core 2 9600m) full screen(1920x1200) using about 25%, where as this JavaScript version crashed Chrome at 100% CPU, then under FireFox sucked up 60% of my CPU for a little 640x480 box that could barely maintain 17fps... And the sound was completely jacked.
Never the less, a cool show and they can say they've done it, but thankfully this isn't our only only option.
This is one of those, "Just because you can, doesn't mean you should" kind of things.
Seriously, many Doom sourceports are doing it wrong, including this one. The thing is, Doom used fixed point math to simulate floating point -- now our on-chip float calculations are way faster than the code required to emulate them (that Doom uses).
Additionally: JS does not have any numbers except 64 bit floats! Bitwise math works on the lower 32 bits of the 52 bits of precision that the floats have available, and results are stored in -- FLOATS. So, using floats to emulate Doom's fixed point math (to emulate floats) is RETARDED (in every sense of the word).
Additionally -- the look up tables Doom uses for "speed" are very slow in JS -- a dynamic object property lookup -- Actually doing a Math.sin(), cos(), or acos() call would be a HELL of a lot faster.
P.S. So fucking what! You can compile just about anything into javascript now that we have a compiler for it. The compiler was impressive, the old programs were impressive in their time. You want a cookie for being able to compile something? Too bad, I'm fresh out.
And that version runs faster, renders better, and has better sound.... AND it doesn't make every fan in my computer speed up to the point where I think I'm playing doom on a jet engine. Still not perfect (Gosh, native code runs better than code through a browser, who'd have thought?) but it's better than the JS version by leaps and bounds. Or it would be if you could jump in Doom.
I'd go so far to say that this was unplayable due to the following major flaws:
Despite 30+fps rating on my laptop ...
Sound way out of sync -- (Extreme delay)
Sound caused high-pitched (anti-teenager?) whine from speakers -- Which I can hear despite my >35 age.
Enemies are not visible until you are right on top of them (they disappear from view when within shooting range)
Alt (strafe) key seems to have meaning to firefox -- works as a toggle? I don't remember this in the old Doom.
What took em so long??
you had me at #!
Error: R_DrawColumn: 265 to 275 at 17 FAILURE in loop iteration: SDL_Quit! Fun while it lasted.
"Just because you can, doesn't mean you should"
I was about to port Firefox 4 to run under Javascript using HTML canvas and a web-service backend. Spoilsport!
I am a raging fan of Doom (which I keep playing via source ports to this date), and this is a great experiment, however...the sound is abysmal, and I am too used to modern controls to go back to arrow keys :P
The FPS was OK for me, 20-30, but the sounds....sounded like...flatulence and a 2yo kid with very deep voice being recorded right next to the microphone.
Doom is not terribly complex by modern standards, but the browser struggles to get it moving (probably because of video rendering, not sure if webGL can do much about that, probably does help) and uses a lot of memory moving it. However, if this keeps advancing (most probably will) the web will become more interesting to this indie game developer, even if just for the ease of deployment (relatively speaking).
Despite not being so visually good, I have found the recent nettiles mode of Dungeon Crawl to be quite a surprisingly nice web interface to a game. (link : https://tiles.crawl.develz.org/ )
It uses no visible CPU and almost no network power at all in my computer and is very responsive, and is a novel interface to play a roguelike in a shared server (including spectators and messaging) without having to use putty or cope with the ASCII interface.
Is there any directory of comprehensive game-oriented documentation for simple 2D "webgame" development? I am quite intrigued about building a 7DRL for the browser using some cutesy tiles and some core basics like dungeon generator and item generator. Lua is my fetish language but I certainly could try some browser magic.
I loaded this up on my home server and tried it from two different systems.
System 1 - RHEL5 8 cpu 48g RAM - Java(TM) Plug-in 1.6.0_20 - 7-8fps
System 2 - WinXP 1 C2D cpu, 4g RAM - Java(TM) Platform SE 6 U22 - 35-45fps
System 2 wins. Graphics card unimportant as this isn't a 3D accellerated application. Not sure why the discrepancy is what it is, but whatever.
Sound does suck.
Wow, it's not often that you find a script that will not only crash every open tab in Firefox but also take down every other instance as well.
Around 5 fps and no sound at all... I'm left wondering what exactly is the point of this kind of thing? Other than to demonstrate quite conclusively that this kind of thing is best left to Flash, it's just embarrassing.
Sorry to say but the other day there was a story of someone getting Doom running on a TI Calculator - and from the footage it worked a lot better than this travesty.
This is better http://www.youtube.com/watch?v=cwLFAOqTPSs
Link
Agreed. Much better version (in terms of playability), with more controls. Still, the sound was delayed for me.
The next version of Flash will have 3d accelerated by the gpu and test versions (molehill) have the q3d engine running at very respectable frame rates.
see http://www.youtube.com/watch?v=usL0wTAbQig
As if Flash gaming isn't dominating enough - imagine what the huge community of devs will be able to do, combining this kind of power with the home-grown creativity and inspiration that deserted the games industry years ago!
I thought Doom was the #2 port to a new architecture, right after Linux.
Strangely, nobody bothers to port MS Bob anywhere...
the preceding comment is my own and in no way reflects the opinion of the Joint Chiefs of Staff
The problem with this is that the javascript doesn't run the same in all browsers. I think what is needed is to write a a tool which could be used to create the proper javascript for each browser. That probably wouldn't solve all the compatibility issues, but it would come close. To get even better, maybe the the tool could be written in an interpreted language which could be sandboxed to run inside a vm that would be implemented in javascript optimized for each browser?
Not working in IE8... Can someone tell me why? *ducks*
No Commodore 64.
Not enough memory for the code, obscenely crappy video hardware, and even if you could it would likely take up to a half minute to render a horrendously colour glitched frame.
Or NES.
The snes port required a 21mhz superfx chip inside the cartridge that did all of the 3d transforms etc and had it's own ram on cart, it basically dma'd rendered tiles to the video processor (snes could do 256 colour suiting original content just fine). Also the machine had 128k of ram no chance in hell on a nes
Or Sega Genesis? That last one is a surprise since the Amiga version should be able to run on the Genesis with some simple modification.
Amiga had far better video hardware present, as well as faster processor and an order of magnitude more ram. The mega drive could only handle 16 colours on screen at a time without some serious hacks.
So will WebGL.
Dilbert RSS feed
I get about 35 fps under Safari on my late 2009 MacBook Pro 17" (Core 2 2.8Ghz with a 9600m) with my CPU usage pegged at about 97%. The game window is only 640x480.
Now on the other hand, the Flash port of Doom runs noticeably better and only uses about 25% CPU when running full screen at 1920x1200 on my Mac.
I want to see someone do a modern take on the old Descent game for a current platform. That game was amazing. It would be super cool on a mobile device with motion\touch\gyro controls setup.
Confirmed. Just upgraded the work computer here: Firefox 3.6 to 4.0. On a Pentium dual 2140. Went from 4 fps to 33 fps.
Probably wont get much work done today...
damaged by dogma
I tried to run it loading the webpage on Firefox 4.0.1 with no luck.
Guess it must be using some sort of plugins after all.
If Google really cared they would fix Android Chrome to reflow text, instead of discriminating
On the basis of what everyone has seen here today, it is pretty clear that Html5 is several years away - the problem is that it probably always will be.
... is that IDDQD and IDKFA still work. :-)
Dear Slashdot: next time you want to mess with the site, add a rich-text editor for comments.
I think that you'll find that merely talking about it, and then actually doing it, is going to be 2 different things entirely. If you have the skills to do that which you speak of in a rewrite, a better one than this one is? Go for it. Talk's cheap though. Good luck if you do decide to do it.
...get the real DOS version to play on Win 7 with joystick support? I dual-boot XP just so I can still play this game on occasion as I can't get it to see the joystick under 7.
Mouse input doesn't work for me (Firefox 4), is that just not implemented or am I encountering a bug?
Also, zooming out (+) doesn't work, but you can zoom in with "Insert" and there is no way to zoom out.
super great..
i m running ff5 in winxp in vbox 4 which is hosted in F14
i got 36.x FPS....
Still a little boring - flash games have been around for ages. We're talking about in-browser JS, plugin-free. With luck (I highly doubt it though), this same code could run in many browsers. I don't buy into a lot of JS hype, but that's pretty cool. Certainly cooler than a proprietary extension. Heck, you could make an activex extension to play doom too - but that's not useful to anyone.
It was awesome until the game crashed in level 2 on me:
Error: R_DrawColumn: 201 to 205 at 58 :-(
FAILURE in loop iteration: SDL_Quit!
Can't even load my savegame. But thanks for the nostalgic glimpse into old times. Ahh, those were the days...
what are we supposed to understand from "Ughhhhhhhhhhh"? were you having liver pain?
So.... this used the Mozilla direct-to-soundbuffer experimental API? Or was it using audio tags?
Where's it gone? Mozilla has pulled Doom. Was it overloading their servers? Were there licensing issues? Does anyone have a mirror? Did anyone keep a copy of the code?