Slashdot Mirror


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.

248 comments

  1. Not bad by Quiet_Desperation · · Score: 1

    8 fps, and that's on an older work laptop without a fancy graphics card and loaded with lots of crap in the background.

    1. Re:Not bad by JamesTRexx · · Score: 1

      4 to 5 fps ("full screen" with menu bar) on Intel 8400/nVidia 9800M GTS, Ubuntu 10.4.
      Mybe ripping Joe Jackson in the background slows things down. :-P

      --
      home
    2. Re:Not bad by basotl · · Score: 1

      Just was testing and that's about what I was getting on my NookColor. Though the lack of a physical keyboard was an issue... I just wanted to check if it would run at all.

      --
      HTC EVO 4G LTE w/ CM 10.2 | NookColor w/ CM 10.2 | Samsung Epic 4G w/ CM 10.1
    3. Re:Not bad by blair1q · · Score: 1

      I got 8 FPS on a rather well-dressed machine.

      JavaScript is nobody's first choice for code.

    4. Re:Not bad by elfprince13 · · Score: 1

      Can't be that well dressed. I'm getting 35.

    5. Re:Not bad by grub · · Score: 1

      30+ FPS in Firefox 4.0.1 on a fall 201 iMac.

      The sound was choppy but graphically it was buttery smooth.

      --
      Trolling is a art,
    6. Re:Not bad by SimonTheSoundMan · · Score: 1

      45fps on an almost 4 year old MacBook Pro with Core 2 Duo 2.4GHz.

      I'm not quite sure that Doom used 170MB of memory, which JS alone is using in the tab.

    7. Re:Not bad by stonedcat · · Score: 1

      40fps for me on an nvidia 430gt and an amd quad core while running desktop effects and xbmc on another screen.
      The sounds are fucking terrible however, the compression needs work for it to be playable my poor ears.

      --
      You can't take the sky from me.
    8. Re:Not bad by cranil · · Score: 0

      firefox 4? I got around 35 fps ATI 5740 Ubuntu 11.04 and Chromium 13 and firefox 4

    9. Re:Not bad by AliasMarlowe · · Score: 1

      On an 8-year-old laptop, with 1.6GHz Pentium M:
      Opera: 8fps
      Firefox: 4fps
      Chrome: unresponsive
      Mind you, these results were just for viewing the static slides of the introduction. The game refused to play, giving a perpetual message loop saying "Demo is from a different game version!". Clicking on the "NEW GAME" menu item had no discernible effect.

      --
      Those who can make you believe absurdities can make you commit atrocities. - Voltaire
    10. Re:Not bad by Anonymous Coward · · Score: 0

      0.9 fps om my iPhone

    11. Re:Not bad by anss123 · · Score: 1

      On My Win7box (with Firefox 4) I'm getting lots of gfx corruption and bad audio. Unplayable, though the framerate is better than what I got on my old Pentium 60.

    12. Re:Not bad by KiloByte · · Score: 4, Informative

      Video card hardly makes any difference, browser does. 35 fps full-screen on Firefox 7.0a1, 34 on Firefox 4.0, slideshow on Firefox 3.5. This is on a cheap-ass 2.8Ghz Phenom II. It uses no OpenGL, about any graphics card can handle shoving such bitmaps around. It's single-threaded, too, so what you're ripping on your other cores doesn't matter.

      However, without such basic controls as strafe, this demo is not playable. No mouse input hurts but DOS versions had unusable mouse anyway so it's just a throwback to the old times. I estimate I've clocked around 4000 hours those days so I'd cope :p Heck, even comma/dot might be acceptable if they don't want to allow redefining keys, although I'd really prefer a sane setup like Z/X=strafe, alt=fire, shift=run (assuming no autorun like in the original).

      --
      The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
    13. Re:Not bad by GameboyRMH · · Score: 3, Funny

      1.4fps on my N900! IN YOUR FACE!

      (Protip for N900 users: Use Firefox Mobile, if you try with MicroB it will just consume all your memory)

      --
      "When information is power, privacy is freedom" - Jah-Wren Ryel
    14. Re:Not bad by Windwraith · · Score: 1

      You are doing it wrong, it's not GZDoom.
      You just use the keyboard to pick stuff. Use the arrow keys to move, enter (control?) to accept, space to open doors, control to fire.

    15. Re:Not bad by Anonymous Coward · · Score: 0

      Nokia can go to hell... I lost ALOT of money today... they down 15%

    16. Re:Not bad by jon_doh2.0 · · Score: 1

      Getting around 23fps on my 6 year old laptop with 2.1GHZ Pentium M, with 2GB RAM under Debian and Firefox 4. Drops as low as 13fps under action.

      Totally playable (barring lack of strafe).

    17. Re:Not bad by GameboyRMH · · Score: 1

      You didn't dump your stock like a hot venom-filled potato the moment Microsoft bought them? I can't feel any pity for you...

      --
      "When information is power, privacy is freedom" - Jah-Wren Ryel
    18. Re:Not bad by GameboyRMH · · Score: 1

      Oh sorry, not "bought," but "partnered"...but you can understand how I could make that mixup...

      --
      "When information is power, privacy is freedom" - Jah-Wren Ryel
    19. Re:Not bad by asylumx · · Score: 1

      Hmm I'm pretty sure the original didn't have strafe, either.

    20. Re:Not bad by KiloByte · · Score: 1

      8 fps? Your phone is awesome then, I'm getting only 2.8 fps on mine. Oh, wait, you meant a regular computer?

      (2.8 fps in the start room of EP 1, in busy rooms it gets down to ~1.1 fps. And the sound, well, let's skip it.)

      --
      The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
    21. Re:Not bad by AliasMarlowe · · Score: 1

      You are doing it wrong, it's not GZDoom.
      You just use the keyboard to pick stuff. Use the arrow keys to move, enter (control?) to accept, space to open doors, control to fire.

      Thanks for the tip on keyboard use (wow, I'm not exactly a youngster and still only tried the mouse). I got 33-35fps in Opera 11.11 while running around shooting things. Of course, the game resolution sucks a little bit and looked small on my display, but it was actually sort-of playable on ancient hardware.

      Laptop: 8 year-old 1.6GHz Pentium M, with 1GB RAM and 1920x1200 Radeon 9600, running Lubuntu 10.04 LTS.

      --
      Those who can make you believe absurdities can make you commit atrocities. - Voltaire
    22. Re:Not bad by kripkenstein · · Score: 3, Informative

      However, without such basic controls as strafe, this demo is not playable.

      Actually strafe works, hold down alt.

    23. Re:Not bad by Hamsterdan · · Score: 1

      Since Doom ran in 4 MB, why 170MB? I expect some overhead, but not 166MB overhead :p

      --
      I've got better things to do tonight than die.
    24. Re:Not bad by KiloByte · · Score: 1

      Wolf3D didn't have dedicated keys for strafe (only Alt-direction), Doom had both dedicated and alt, bound to comma and dot by default. Since it is vital to be able to turn all the time, you can't afford to use alt strafe in a fight. It's only for abusing the double-strafe bug.

      --
      The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
    25. Re:Not bad by Dahamma · · Score: 1

      Yeah, that's a bit of a jump from the 4MB it required in 1994 :)

    26. Re:Not bad by amicusNYCL · · Score: 1

      8 FPS? Are you using IE? I was getting 30-40 FPS on a crappy years-old work laptop using Opera. The CPU was chugging and made all of the fans turn on, and some textures were flickering, but it ran smoothly the entire time. The menu was only running at about 5-6 FPS though.

      --
      "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
    27. Re:Not bad by demonbug · · Score: 1

      However, without such basic controls as strafe, this demo is not playable. No mouse input hurts but DOS versions had unusable mouse anyway so it's just a throwback to the old times. I estimate I've clocked around 4000 hours those days so I'd cope :p Heck, even comma/dot might be acceptable if they don't want to allow redefining keys, although I'd really prefer a sane setup like Z/X=strafe, alt=fire, shift=run (assuming no autorun like in the original).

      Alt=fire? You must have some strange, deformed hands. Clearly Ctrl should be fire.

      The rest is okay.

    28. Re:Not bad by SiMac · · Score: 1

      Graphics card doesn't make a difference because it presumably doesn't use WebGL. Browser makes a huge difference because Firefox 4+ has typed arrays, whereas Firefox 3.5 doesn't.

    29. Re:Not bad by tibit · · Score: 1

      For me, everything works at ~35fps on latest Safari on OS X. Strafe, running, jumping, automap, door opening, etc. Only thing that doesn't work is sound. Make sure you focus the canvas (just click on it).

      --
      A successful API design takes a mixture of software design and pedagogy.
    30. Re:Not bad by Anonymous Coward · · Score: 0

      Hmm I'm pretty sure the original didn't have strafe, either.

      Actually, it did.

    31. Re:Not bad by Surt · · Score: 1

      Your poor fps is almost certainly browser choice. Try a cutting edge release and see if you don't pick up a 5x improvement.

      --
      "Who is the Journal of Quantum Physics going to believe?" --Stephen Hawking
    32. Re:Not bad by blair1q · · Score: 1

      Probably this. I don't control the SW load on this box, so it's a rev or two behind on Firefox.

    33. Re:Not bad by Anonymous Coward · · Score: 0

      Just hold alt and press the left and right cursor keys to strafe

    34. Re:Not bad by Anonymous Coward · · Score: 0

      I wish I only had "only bought the stock"... I would be down only 15% then... I had a ton of options contracts... not cool

      business wise though Microsoft cant hurt them... they have alotta $$$$....

      Product wise diffrent story though....

    35. Re:Not bad by Anonymous Coward · · Score: 0

      You can't have lost something you didn't gain in the first place. Gain comes from selling, you plank.

    36. Re:Not bad by Anonymous Coward · · Score: 0

      Hmm I'm pretty sure the original didn't have strafe, either.

      You can strafe with the ALT key.

    37. Re:Not bad by Jarik+C-Bol · · Score: 1

      yeah, I got 30fps on a 2007 1.83 Ghz macbook using Safari. (integrated graphics 0.o) gotta love it.

      --
      I've decided to Diversify my Holdings. I've divided my cash between my left and right pockets, instead of all in one.
    38. Re:Not bad by Anonymous Coward · · Score: 0

      Yes it did. for strafe left and right, respectively.

      The default placement is dumb because you have to move your hand off of aiming or firing controls, but it was there.

    39. Re:Not bad by Anonymous Coward · · Score: 0

      Alt then left / right resulted in strafe for me.

    40. Re:Not bad by Anonymous Coward · · Score: 0

      Doom for sure had strafe. I know this because I rocked a Gravis Gamepad that had 4 buttons and my buttons were: run, use, strafe, and shoot! :)

      What Doom didn't have that Doom 2 did, was the Super Shotgun.

    41. Re:Not bad by Anonymous Coward · · Score: 0

      I can guarantee you that the video card does indeed make a difference.
      Try running this on a PCI GeForce 6200 verses their most recent model.

    42. Re:Not bad by Anonymous Coward · · Score: 0

      alt + arrow lets you strafe.

    43. Re:Not bad by Anonymous Coward · · Score: 0

      Video card hardly makes any difference, browser does. 35 fps full-screen on Firefox 7.0a1, 34 on Firefox 4.0, slideshow on Firefox 3.5. This is on a cheap-ass 2.8Ghz Phenom II. It uses no OpenGL, about any graphics card can handle shoving such bitmaps around. It's single-threaded, too, so what you're ripping on your other cores doesn't matter.

      However, without such basic controls as strafe, this demo is not playable. No mouse input hurts but DOS versions had unusable mouse anyway so it's just a throwback to the old times. I estimate I've clocked around 4000 hours those days so I'd cope :p Heck, even comma/dot might be acceptable if they don't want to allow redefining keys, although I'd really prefer a sane setup like Z/X=strafe, alt=fire, shift=run (assuming no autorun like in the original).

      Protip: press Alt to toggle strafe, if it doesn't work the first time, try again.

    44. Re:Not bad by Anonymous Coward · · Score: 0

      but DOS versions had unusable mouse anyway

      Here's the troubleshooting section for the mouse in DOS DOOM.
      http://www.gamers.org/docs/FAQ/doomfaq/sect4.html#19-1

    45. Re:Not bad by shmlco · · Score: 1

      What's next on your list? Adding RIM to your portfolio?

      --
      Any sect, cult, or religion will legislate its creed into law if it acquires the political power to do so.
    46. Re:Not bad by Anonymous Coward · · Score: 0

      Both the original and this version have strafing. Just hold alt while using left and right arrows.

    47. Re:Not bad by Anonymous Coward · · Score: 0

      Alt is strafe, just like in the original

    48. Re:Not bad by Anonymous Coward · · Score: 0

      Doom did have strafe. Press alt + left or alt + right.

    49. Re:Not bad by inject_hotmail.com · · Score: 1

      ...on a fall 201 iMac...

      Holy crap...dude...your computer is 1809 years old...I think it's time to upgrade.

    50. Re:Not bad by Anonymous Coward · · Score: 0

      Bah... 2010.

    51. Re:Not bad by Anonymous Coward · · Score: 0

      Hey planko, something you own can lose value, hence a loss. Plank it up, smartass

    52. Re:Not bad by semi-extrinsic · · Score: 1

      Well, I've got 12-18 fps on my four year old netbook, and it's definitely playable. Firefox 4 (on Linux) is unable to use the old Intel GPU because that just crashes the whole computer, this is all done by the CPU. So I guess the processor makes a difference, the video card not so much.

      --
      for i in `facebook friends "=bday" 2>/dev/null | cut -d " " -f 3-`; do facebook wallpost $i "Happy birthday!"; done
    53. Re:Not bad by Anonymous Coward · · Score: 0

      Impressive! Runs very smooth on FF 4.0 on my pc. The audio is flaky but the rest is smooth.

    54. Re:Not bad by kelemvor4 · · Score: 1

      No school like the old school I suppose.

    55. Re:Not bad by hajus · · Score: 1

      That doesn't work. I need to strafe and turn at the same time, like I used to do when I played doom back in the early 90s.

    56. Re:Not bad by Lanteran · · Score: 1

      30-40 on my 9600GT 512MB and Pentium D 2.8Ghz, arch linux.

      --
      "People don't want to learn linux" hasn't been a valid excuse since '03.
    57. Re:Not bad by hairyfeet · · Score: 1

      Same here, 40FPS on an AMD 925 quad and HD4850. Maybe they have it capped at 40FPS? Either way with no strafe and the horrible sound (I experienced this weird canned delay, as much as 3 to 4 seconds from the time I pulled the trigger to the time the sound played) with the most awful compression and video artifacts it was pretty unenjoyable.

      I'd say it is okay just to say they did it but frankly the original ran better on my Celeron 300A OC with my old Voodoo 1 than it did on a modern quad through the browser. pretty lame.

      --
      ACs don't waste your time replying, your posts are never seen by me.
    58. Re:Not bad by Anonymous Coward · · Score: 0

      Strafe indeed works -- I had to look up the key combo! The real problem is when you're holding down alt (or ctrl?), press an arrow key, and wind up triggering the 'back' button. Also, sound barely worked.

      Brought back some great memories, though!

    59. Re:Not bad by hjf · · Score: 1

      640K ought to be enough for everyone.

    60. Re:Not bad by Old+Wolf · · Score: 1

      You fail, DOOM had strafing. Circle-strafing was important in player-vs-player combat. You could either use the default setting of a strafe-toggle (which is just about unusable IMO), or actually bind keys to strafe-left and strafe-right.

    61. Re:Not bad by Billly+Gates · · Score: 1

      "Video card hardly makes any difference, browser does. 35 fps full-screen on Firefox 7.0a1, 34 on Firefox 4.0, slideshow on Firefox 3.5. This is on a cheap-ass 2.8Ghz Phenom II. It uses no OpenGL, about any graphics card can handle shoving such bitmaps around"

      The HUGE fps difference is because of accelerated video via DirectX as you must be on Vista or Windows 7 correct? Your cheap-ass card can do wonders with Direct2D which is what Firefox 4 for Windows renders compared to 3.6. This is why it sucks on Linux. Just because it can't run Crysis does not mean it can't render tens of millions of pixels a second.

      I got 35 fps on Firefox 4 with Windows 7 with an ATI 5750 which is a high end card. It wont work in Chrome or IE 9 as I tried.

      If anyone dual boots you will notice a big difference if you look on a page with graphics. The pics will chop of you move up and down. Under IE 9 (only stable browser with full hardware acceleration for all HTML and CSS) it will be smooth. I think Firefox 5 and later will have this as well.

    62. Re:Not bad by Billly+Gates · · Score: 1

      Try rebooting into Windows with Firefox 4. Hardware acceleration for non DirectX is an issue. I think OpenGL might work with a Mac. Firefox 5 or 6 will fix this for Ubuntu

    63. Re:Not bad by KiloByte · · Score: 2

      The HUGE fps difference is because of accelerated video via DirectX as you must be on Vista or Windows 7 correct?

      Cthulhu forbid, no!

      Your cheap-ass card can do wonders with Direct2D which is what Firefox 4 for Windows renders compared to 3.6.

      Comparing with nouveau, the speed decrease is small, roughly consistent with that on programs which don't do hardware rendering at all. I even doubt Firefox actually uses any hardware acceleration there.

      This is why it sucks on Linux.

      The same hardware, a Windows 7 partition (sad to break its 4 months non-uptime): 24 fps on FF4, XP: 27 fps. So no, not quite "sucks".

      --
      The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
    64. Re:Not bad by Anonymous Coward · · Score: 0

      Worked at first, but then it ceased working.

    65. Re:Not bad by amn108 · · Score: 1

      22 fps on a Pentium-M 2.0Ghz, Firefox 4, Ubuntu 10.04

    66. Re:Not bad by amn108 · · Score: 1

      Well-dressed in Abibas and Mike, it seems :P

    67. Re:Not bad by CronoCloud · · Score: 1

      Alt-key is strafe. I got some kind of weird graphic glitching with disappearing enemies and very bad sound.

    68. Re:Not bad by danieltdp · · Score: 1

      You really need to combine strafe and rotate do be effective at this game. Strafe Left and Right as separate keys from rotate left and rotate right are a must! (or should it be "is a must"?! -- dunno)

      --
      -- dnl
    69. Re:Not bad by danieltdp · · Score: 1

      The original had separate keys for strafe, besides the modifier. Its another game when you combina strafe and rotate. You can dodge fireballs without loosing your aim

      --
      -- dnl
    70. Re:Not bad by kalirion · · Score: 1

      Alt=fire? You must have some strange, deformed hands. Clearly Ctrl should be fire.

      I'm guessing he meant L-Alt and L-Shift, so the right hand would be delegated to just the arrow keys. Firing with the pinky just seems wrong.

    71. Re:Not bad by keeperofdakeys · · Score: 1

      It makes SO much difference when you can strafe AND turn at the same time, you can arc around your enemies while you fire at them. Although it would be possible to play without doing them at the same time, you would need to devote more thinking to maneuvering then to shooting hellspawn. You want to devote as much to shooting those demons.

    72. Re:Not bad by ginbot462 · · Score: 1

      Double strafing? Man, I never remember trying that. I played it a lot in my CS course in high school. ~1996. Quake was out, but the machines we had couldn't run it. Doom was the first and last LAN game I would ever play :{.

      --
      Atlas Shrugged : Thematic Story :: Battlefield Earth : Organized Religion
  2. Is it just me... by Anonymous Coward · · Score: 1

    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).

    1. Re:Is it just me... by VGPowerlord · · Score: 1, Insightful

      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).

      Considering that DOOM ran at, what, 60 FPS on a 486 SX 33Mhz with the DOOM graphics quality set to high and at the largest screen size it supported, it's not really that impressive.

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    2. Re:Is it just me... by Savantissimo · · Score: 1

      Hmm... the 386-40 with coprocessor wasn't much slower (~20%) than the 486SX-33 and it only got about 15-20 FPS.

      --
      "Is life so dear, or peace so sweet, as to be purchased at the price of chains and slavery?" - Patrick Henry
    3. Re:Is it just me... by NoOneInParticular · · Score: 1

      If find it truly depressing that after 16 years of hardware development, the most ubiquitous client-server architecture around actually runs slower than ever before. What the hell are we doing with those 8+ cycles of Moore's law? Treat Javascript as if it were assembler! The trick is nifty, in a "let's put the heating on because the air-conditioning is cooling the house too much" kind of way.

    4. Re:Is it just me... by Hamsterdan · · Score: 1

      A DX2-66 might have gotten 60FPS on a PCI or VLB videocard. I highly doubt a SX (no co-processor) could do it, since that kind of machine probably had an ISA videocard.

      --
      I've got better things to do tonight than die.
    5. Re:Is it just me... by anss123 · · Score: 1

      It depended a lot on the video card, but since the game was capped at 30 FPS (IIRC) 60 is out of the question for any 486.

    6. Re:Is it just me... by Nimey · · Score: 4, Informative

      No. My 486SX-25 would run Doom at 20-some FPS (mainly dependent on how many monsters were within visual/acting range), and after an upgrade to a DX2-50 Overdrive it would usually be 30-something -- and the original DOS executable had a hard limit of 35 FPS.

      Don't forget this is running as interpreted code in what amounts to a virtual machine.

      --
      Hail Eris, full of mischief...

      E pluribus sanguinem
    7. Re:Is it just me... by tibit · · Score: 1

      The code is not interpreted, not on any sane recent browser at least.. After a few seconds it's all JIT-compiled.

      --
      A successful API design takes a mixture of software design and pedagogy.
    8. Re:Is it just me... by Surt · · Score: 2

      I think it's actually depressing that web browser implementations are so poor that they can eat up the entirety of the significantly more than 50X improvement in processing power that has happened in the intervening time.

      --
      "Who is the Journal of Quantum Physics going to believe?" --Stephen Hawking
    9. Re:Is it just me... by VGPowerlord · · Score: 1

      A DX2-66 might have gotten 60FPS on a PCI or VLB videocard. I highly doubt a SX (no co-processor) could do it, since that kind of machine probably had an ISA videocard.

      You're probably right.

      This was 18 years ago, you can't expect me to remember everything about it. :P

      --
      GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
    10. Re:Is it just me... by Nimey · · Score: 1

      OK, bytecode, but still quite a bit slower than native.

      --
      Hail Eris, full of mischief...

      E pluribus sanguinem
    11. Re:Is it just me... by mobby_6kl · · Score: 1

      Yeah but it's 18 years later and we're using processors that are literally thousands of times faster than the original ones. In light of that, I think it's a rather pathetic achievement.

    12. Re:Is it just me... by shutdown+-p+now · · Score: 4, Informative

      No, it's not bytecode. Most (all) modern JS engines actually JIT-compile to native code.

      It's still slower than C version simply because native code doesn't mean fast - if it has to do dynamic dispatch over method names, for example (because the compiler couldn't infer types deep enough), it's still slower than a direct or virtual call.

    13. Re:Is it just me... by tibit · · Score: 2

      Couldn't agree more. Javascript is like early RISC chips. People joked that RISC meant 'relegate impossible stuff to the compiler'. We've since figured out how to handle RISC instruction sets well, but Javascript compilers are at the same early stage it seems. Javascript is an "impossible" language to compile into fast code. It requires significant advances in JIT type inference, whole program profile-guided optimization, etc. The theory for all that has been mostly worked out long ago, it's just a matter of efficient implementations that don't take 1GB to JIT a piece of 90s vintage cross-compiled C that used to run in 8MB and compiled in just as much... Javascript's architecture, unfortunately, requires very nontrivial code analysis. My expectation is that a well done Javascript engine will use more memory while JITting than the heap used by the target code itself. There's very little one can do to help in this department methinks.

      --
      A successful API design takes a mixture of software design and pedagogy.
    14. Re:Is it just me... by shutdown+-p+now · · Score: 1

      So isn't it the other way around - JS being more like a very, very overcomplicated CISC? I would rather have it be more RISCy in a sense of providing much more fundamental building blocks (goto, function pointers, strongly typed operations etc - basically something along the lines of LLVM) that are straightforward to efficiently translate to native code. And let the compilers handle everything above that, just as they do for C++. It would then also be possible to implement higher-level VMs - for Java, JS etc - on that foundation.

    15. Re:Is it just me... by tibit · · Score: 1

      I only compared the compiler-"unfriendliness" aspect, not any measure of complexity.

      --
      A successful API design takes a mixture of software design and pedagogy.
    16. Re:Is it just me... by MaDeR · · Score: 1

      Hundreds, not thousands.

      --
      What modern Obelix would say today? Of course, "Those crazy Americans!".
  3. Hooray by Anonymous Coward · · Score: 0

    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.

    1. Re:Hooray by Anonymous Coward · · Score: 0

      Yea, most of the rest of us have upgraded our computers since the time Doom originally came out.

    2. Re:Hooray by grub · · Score: 2


      Yea, most of the rest of us have upgraded our computers since the time Doom originally came out.

      Don't be too hard on the poor fellow, he's probably having a hard time finding a shop which sells the correct vacuum tubes.

      --
      Trolling is a art,
  4. Cool by Lord+Lode · · Score: 1

    34FPS on average. The only problem is the sound quality is really bad. Like, really, really bad.

    1. Re:Cool by lennier1 · · Score: 1

      Same here. And the canvas occasionally loses the focus, causing the browser to fal back to its regular behavior (e.g.space=scroll).

      But it's still an impressive demonstration.

    2. Re:Cool by PCM2 · · Score: 1

      The only problem is the sound quality is really bad. Like, really, really bad.

      Every once in a while I'll hear a sample trigger properly. As soon as the demo launches, though, I hear a faint high-pitched tone which very gradually increases in volume until the game starts. And when I say high-pitched I'm talking dog whistle, give-me-a-headache high.

      --
      Breakfast served all day!
    3. Re:Cool by Anonymous Coward · · Score: 0

      The "right" way to do it is to handle keypresses from the document level so the canvas doesn't need context, and then selectively abort the event handler to allow the browser to handle keystrokes you don't want to steal (e.g. F5, ctrl-pgup/pgdn, ... depending on whether you want to allow those to still work as expected).

  5. Wow by Anonymous Coward · · Score: 0

    And it only took 18 years for us to get there (the graphics, that is; sound isn't working very well).

    1. Re:Wow by XanC · · Score: 1

      I really doubt that Javascript itself is the bottleneck on this one. Much more likely to be the browser's ability to draw quickly.

    2. Re:Wow by empiricistrob · · Score: 2

      I agree that we should start considering replacing javascript as a language. Why not provide a strongly typed extension to javascript? Javascript would get a lost faster.

    3. Re:Wow by blair1q · · Score: 1

      People won't realize that until it stops doing stuff like this.

    4. Re:Wow by BZ · · Score: 1

      JS VMs are far from state of the art compared to, say, Java VMs. They're working on it, though...

    5. Re:Wow by Anonymous Coward · · Score: 0

      - Does not work on Chromium here (v12)
        - Only 40 fps in Fx4 (hey, this is doom)
        - Rendering glitches I never saw in any doom port (many sprites just disappear sometime, enemy sprites behind doors are shown through the door when opening it)
        - Sound is horrible

    6. Re:Wow by Necroman · · Score: 4, Informative

      If you want real graphics performance out of a browser, you should be using WebGL (assuming Flash is not an option). WebGL lets you execute OpenGL code on the video card of the machine, which will be a ton faster than Canvas.

      You have to remember that Canvas is just an image rendering platform. From my understand of Canvas in Firefox, it actually renders every frame as a PNG and displays it to the screen. There is no GPU acceleration. That's what WebGL is fore.

      --
      Its not what it is, its something else.
    7. Re:Wow by Anonymous Coward · · Score: 0
    8. Re:Wow by arth1 · · Score: 1

      Why not provide a strongly typed extension to javascript? Javascript would get a lost faster.

      I'm all for Javascript getting lost faster.

      What's needed is a strong sandbox for each browser instantiation to run binaries in, whether those be native or pre-compiled bytecode for a state machine. Not fettering developers to using a specific language that is interpreted or compiled from source.

      Java applets were a good idea, but was hampered by the sandbox being a pixel-boxed applet, not the browser, and also by being proprietary and single-language.

    9. Re:Wow by DrXym · · Score: 1

      How about recognize this sort of thing is happening a lot of late (GWT, NaCl and others) and design a proper low level runtime and API set to properly accommodate it.

    10. Re:Wow by parlancex · · Score: 2

      The original doom used software rendering which makes this a fair comparison actually, things like OpenGL and hardware accelerated 3D graphics certainly didn't exist (in the consumer realm) in 1993. Doom ran at full frames on 66 mhz Pentium processor. Loosely extrapolating, this means the Javascript version is about 200 to 300 times slower than the original.

    11. Re:Wow by Anonymous Coward · · Score: 0

      What's needed is a strong sandbox for each browser instantiation to run binaries in, whether those be native or pre-compiled bytecode for a state machine. Not fettering developers to using a specific language that is interpreted or compiled from source.

      Here you go: http://code.google.com/p/nativeclient/

    12. Re:Wow by h4rr4r · · Score: 1

      Not binaries, then we are again stuck with x86. I own many devices that are not x86 and even some workstations.

    13. Re:Wow by nschubach · · Score: 1

      It's one thing to generate a png for every frame you render and writing straight to (one of) the buffer(s) of the video card as they previously did.

      The only thing it points out (as far as JavaScript is concerned) is that they need a better way to render the canvas.

      --
      Every time I start to have faith in humanity, I ruin it by driving to work between 7 and 8 am.
    14. Re:Wow by Dahamma · · Score: 3, Informative

      This demo is rendering to an HTML5 *canvas* as a virtualized framebuffer in an interpreted language with no hardware support whatsoever. Are you *seriously* trying to use this as a complaint against Javascript? I remember back when "demo" just meant "write a cool app to show off"...

      Of course it's not the way someone would build a real app in Javascript, but it's an excellent demo to help people understand what the platform can do and how it might be improved. And for those of us who understand all of the tools that went into it, it's just pretty damn cool.

      A couple weeks ago a story was posted about a demo that booted a real 2.6 Linux kernel image with ramdisk entirely in Javascript: JSLinux.

      That takes a whole 6 seconds to boot to a bash prompt *in Javascript* on my machine. SO SLOOOW, Javascript sucks!!! ;)

    15. Re:Wow by Anonymous Coward · · Score: 0

      Why not provide a strongly typed extension to javascript? Javascript would get a lost faster.

      And javascript "programmers" would get a lost faster too.

    16. Re:Wow by roca · · Score: 1

      Your understanding is incorrect. Firefox's canvas implementation has nothing to do with PNGs. And on Windows Vista/7, and also Linux/X on some systems, the 2D canvas API makes heavy use of the GPU.

    17. Re:Wow by Gaygirlie · · Score: 3, Informative

      The original doom used software rendering which makes this a fair comparison actually, things like OpenGL and hardware accelerated 3D graphics certainly didn't exist (in the consumer realm) in 1993. Doom ran at full frames on 66 mhz Pentium processor. Loosely extrapolating, this means the Javascript version is about 200 to 300 times slower than the original.

      Indeed, it is a lot slower than the original. But the reasons for the slowness are quite clear: it's a byte-compiled language that must run in a VM, so that incurs already a lot of overhead; it cannot use any assembler tricks to speed the game up, it cannot align things in memory on double-word boundaries and so on. But then in addition to that it's running inside a web browser and renders every single frame as a PNG which involves first compressing the PNG and then decompressing it, just to display it.

      The original one of course was running on bare metal, having the CPU fully to itself, and VGA was actually very fast as a graphics card back in the day; you'd render an image, change a register or two on the VGA card to flip the buffer and voila, you got a picture on the screen. No need for compressions or decompressions or anything. Not to mention that it was all indexed 256-bit colour graphics which means that the entire screen only weighed in at 62.5Kb and you could modify the colour index table for fast special effects, no need to modify individual pixels as the hardware took care of displaying the appropriate colour!

      Comparing it straight-up to the JavaScript version simply isn't fair to either of them.

    18. Re:Wow by shutdown+-p+now · · Score: 1

      That's why he said "precompiled bytecode".

    19. Re:Wow by shutdown+-p+now · · Score: 1

      One nifty thing that Google is doing is "portable NaCl" - basically, they're using LLVM intermediate form for distribution, which is then compiled to native code by the browser, and validated/sandboxed by existing NaCl facilities. That's way better than JS - you get a really low-level instruction format that lets you implement practically any language efficiently, without losing portability.

    20. Re:Wow by icebraining · · Score: 1

      LLVM bytecode, maybe? It's independent from both the source language and final platform.

    21. Re:Wow by Gaygirlie · · Score: 1

      indexed 256-bit colour graphics

      Brainfart, just noticed it myself. I meant indexed 256-colour 8-bit graphics. Anywhoo.

  6. IE 9 is Doomed, I tell you, DOOMED! by Anonymous Coward · · Score: 0

    *surprised nobody beat me to the punch on this one*

  7. Wow by parlancex · · Score: 0

    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.

  8. Progress by Anonymous Coward · · Score: 5, Insightful

    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.

    1. Re:Progress by Anonymous Coward · · Score: 0

      Actually we fragged with FPM (uphill both ways) just fine.

      DOOM(TM) requires an IBM compatible 386 or better with 4 megs of RAM, a VGA graphics card, and a hard disk drive. A 486 or better, a Sound Blaster Pro(TM) or 100% compatible sound card is recommended. A network that uses the IPX protocol is required for network gameplay.

      ----
      "Retake the lawn!"

    2. Re:Progress by asdf7890 · · Score: 1

      Have you seen the specs required for the latest Worms game? See the bottom of http://store.steampowered.com/app/22600/ for the list. 1Gb RAM and a little over 2Gb of disk space required?! The backgrounds and sprites can't be *that* much more numerous and higher resolution can they? Needing a beefy machine to run Doom via C-compiled-to-JS-running-via-JIT-compile-bytecode doesn't seem so ridiculous when you consider that "Worms Reloaded" is running native.

    3. Re:Progress by Osgeld · · Score: 1

      yea, I have a 386 with 4 megs, it runs but in a postage stamp sized window at a framerate just tween jack and squat

    4. Re:Progress by luvirini · · Score: 1

      Yes, that is indeed called progress as defined by much of the software industry.

    5. Re:Progress by TD-Linux · · Score: 1

      Well, let's see: 640x480, 16bpp = 614 400 bytes of RAM 1680x1050, 32bpp = 7 056 000 bytes of RAM That's over a tenfold increase, not counting newer OSes which that spec usually does. Also don't forget music. The Worms CD games I have had 500MB of audio tracks on them - are you counting that?

    6. Re:Progress by datsa · · Score: 1
      Yes, it is progress. The original needed to do all sorts of memory and cpu hacks to barely run, and only worked on certain architectures and OS's.

      This one runs brute-force on any modern machine using software that can also be used to watch cute videos of cats.

    7. Re:Progress by w0mprat · · Score: 1

      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.

      Yes but try running a modern browser in that ammount of ram, and then load a modern web page. 8mb would let you load a couple of jpgs into memory for display thats about it. 40mhz would mean your waiting till the next ice age to load a Slashdot article and execute it's script heavy comment interface..

      --
      After logging in slashdot still does not take you back to the page you were on. It's been that way for 20 years.
    8. Re:Progress by Anonymous Coward · · Score: 0

      But the new one has awesome invisibility features!

      (The enemies turn invisible when you aren't in the same "room". Which means the enemy before the imp is invisible until you stand right in his face, the first imp is *always* invisible, and while you kill the second one, it comes and kills you.)

      Wake me up when we see Crysis in the browser. On a mobile phone!

    9. Re:Progress by Anonymous Coward · · Score: 0

      Why do comments like this get modded insightful? The fact that there are now extra layers such as a browser and javascript engine would require more resources to achieve the same effect. Can someone explain how mentioning this on a site that is supposedly top heavy with nerds demonstrates some sort of insight?

      This demo has absolutely nothing to do with running doom efficiently. It is about pushing the boundaries of what is possible on the web, while it is not ground breaking it is another small piece helping to move that technology forward (along with a few million other projects). So yes if your aim is simply to play Doom you might want to play it locally.

    10. Re:Progress by evilandi · · Score: 1

      > Yes but try running a modern browser in that
      > ammount of ram, and then load a modern web page.

      Er... I'm browsing Slashdot using Elinks right now, to post this very comment. It's consuming just under 5MB and, as you can see, it works just fine.

      --
      Andrew Oakley - www.aoakley.com
    11. Re:Progress by curtisk · · Score: 1

      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.

      Brilliantly said....its a neat tech demo, but really?

      --

      Sehr geehrter Toilettenbenutzer!

    12. Re:Progress by asdf7890 · · Score: 1

      Even counting "full HD" resolution (~8Mbyte per 32bit frame-buffer), the background actually being a couple of times larger than a full screen, and multiple levels of buffering for the active display, the game itself isn't going to need a lot of RAM by modern standards, though you are right in that most of that minimum spec RAM-wise is Windows' footprint.

      The cartoony images should compress well though, especially at larger sizes, so they shouldn't take a massive amount of disk space each. And the audio was CD quality in the original not for the sake of the quality but to save CPU resources and install space. Compression techniques as good as MP3 and the like were not around, and even if they were the original game ran nicely on (for instance) my old 386SX where the extra effort of decoding decent quality audio could have made a difference. Full CD quality sound was actually much easier (just play it direct off the CD to the sound card and the CPU need not be bothered by the process at all) and saved install adding even the compressed audio to the install-set. A modern game will have the audio in MP3 format or similar so unless there is a god few hours of it the total won't come to the amount of data in the uncompressed audio tracks on the original Worms CD.

      Maybe I'm just being old and moaning about lazy youngsters for the sake of it. In my day we had to rearrange large chunks of code to save a few bytes here or there, or we'd run out of the 20K of heap available after the screen memory and everything else had taken their cut...

  9. screencast by Anonymous Coward · · Score: 0

    Screencast isn't a word.

    1. Re:screencast by Anonymous Coward · · Score: 0

      Hey moron, this is slashdot. Do you really think we care about things like spelling and mechanics? English is a LIVING language. Here at slashdot, we invent words like atomsmasher and topscore because we are on the cutting edge and are so smart that we shall be deemed as the definitive languagemakers of our LIVING English language. So just go die in a fire because rules do not apply to us. We are simply too smart to let our efficiency of journalistic reporting be hampered with such inefficiencies of consistency and clarity. Amen.

    2. Re:screencast by jon_doh2.0 · · Score: 1

      Man, wouldv modded you up if you hadnt posted as AC, modding up an AC seems a bit of a waste generally.

      You're phrasing was somewhat hyperbolic, in the interests of humour, of course.

      Woke up to a tight arsed gr/sp nazi this morning and it really pissed me off, mainly because i lost my cool and kicked off.

      Why cant these lowlifes just let people be? They contribute nothing to the debate.

      From now on i will always post with my sig.

      Rant over.


      -- Grammar is effective when meaning is conveyed, and i balk at english spelling conventions. So, go suck a pee-pee.

  10. Not as cool as GWT Quake by empiricistrob · · Score: 2

    While this is impressive, it has been done before (and better): GWT Quake

    1. Re:Not as cool as GWT Quake by kripkenstein · · Score: 5, Informative

      While this is impressive, it has been done before (and better): GWT Quake

      I think that Quake demo is awesome! I'd just like to mention though that this Doom demo is very different from a technical standpoint, and I think both are interesting:

      • The Quake demo compiled Java to JavaScript using GWT, the Doom demo compiles C through LLVM into JavaScript using Emscripten.
      • The Quake demo uses WebGL to render, the Doom demo translates a 100% software renderer. It's much more challenging to get good performance with a software renderer in JS, especially given that the original renderer was heavily optimized for the CPUs of the day (for example, it uses fixed-point math).
      • The Quake demo was a major effort, with rewriting and fixing. The Doom demo is a straightforward port, no new code (only a few tiny tweaks), took only a week to do. (Btw, speaking of the timetable, sorry for the sound quality - I just spent a few hours on that part, and I had never used the Audio Data API before.)
    2. Re:Not as cool as GWT Quake by MobyDisk · · Score: 1

      Depends on how you define "cool" - this is very different from what GWT Quake did. GWT quake is port of Quake 2. This was created by recompiling the Doom source. Granted, Doom didn't originally use SDL, but I suspect it is much closer to the original source than what GWT Quake was. The ability to take unmodified C/C++ and compile it to Javascript is fundamentally amazing.

      Take a look at their how-to

    3. Re:Not as cool as GWT Quake by Anonymous Coward · · Score: 0

      it's a little bit ironic that the only way anyone can get to see this version of quake running is by watching a flash video, as it just won't really work on the web.

      desktop linux jokes aside, if this html5 whalesong isn't the biggest lost cause that you guys have gotten yourself behind then i would like to know what is?

  11. No, It's Not Just You, It's Just Developers by eldavojohn · · Score: 1

    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.
    1. Re:No, It's Not Just You, It's Just Developers by h4rr4r · · Score: 0, Troll

      My 21st century machine can now not play a game from 1993. Thanks jackasses who think javascript is a good idea.

    2. Re:No, It's Not Just You, It's Just Developers by Anonymous Coward · · Score: 0

      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.

      It was posted here.

    3. Re:No, It's Not Just You, It's Just Developers by Anonymous Coward · · Score: 3, Informative

      Javascript is fine. It's the 'running inside a browser' that kills performance by 99%, and makes this an impressive feat. If the Javascript engine was ripped out of Firefox 4 or Chrome, and given a decent graphics & sound API, it would have respectable performance (nowhere near C or C++, of course). When you're writing a graphics heavy app in a browser, though, it's like playing a song on a dot matrix printer. The fact it exists at all is the amazing thing.

    4. Re:No, It's Not Just You, It's Just Developers by pugugly · · Score: 1

      What I actually like better is this Java C64 emulator - {G}
      Uridium!

      Pug

      --
      An Invisible Entity of Vast Power whose existence must be taken on faith alone: Liberal Media
    5. Re:No, It's Not Just You, It's Just Developers by PRMan · · Score: 1

      I read the rejected story.... Weird.

      --
      Peter predicted that you would "deliberately forget" creation 2000 years ago...
  12. not here.. by thehodapp · · Score: 1

    doesn't work on a year old integrated graphics card (even with an i3 processor). What do you have to have to run it?

    1. Re:not here.. by mg127 · · Score: 1

      Macbook Pro (i7 w/ 4GB and Nvidia 330M) using Firefox 4 I get 37 fps. Neat demo, but I agree the sound is pretty awful.

    2. Re:not here.. by jon_doh2.0 · · Score: 1

      I have an Intel integrated Media Accelerator 900 graphics card (at least 6 years old) and a single core Pentium M, and it runs pretty well.

      What browser are you using?

    3. Re:not here.. by Arrepiadd · · Score: 1

      Try running on a more decent browser. Others suggest running on Firefox 3.5 sucks, but Firefox 4 is fine. I'm getting 33-35 fps on Firefox 5.

    4. Re:not here.. by thehodapp · · Score: 1

      Chromium bleeding edge.

    5. Re:not here.. by jon_doh2.0 · · Score: 1

      I too am using the bleeding edge release (nightly updates), under Debian Squeeze. To be honest, i was quite surprised at how well it worked, faster FPS than Firefox 4 for me. I wonder if its worth trying other browsers? I suppose you already have, any luck?

    6. Re:not here.. by thehodapp · · Score: 1

      Linux ftw. I had been on Win7 and it wasn't working on Chromium. Later I booted to Ubuntu and it worked fine on Chromium. No idea why.

    7. Re:not here.. by jon_doh2.0 · · Score: 1

      Perhaps some difference between the Win7 and Linux versions. The Chromium nightly i have found to be sometimes quite sketchy, even crashing, and usually an update fixes it within a day or so. I would guess that at any one time the two nightly versions might be quite different, as regards the implementations of new and existing features on the two operating systems.

  13. My performance by Anonymous Coward · · Score: 0

    GPU: GTX275 NVidia
    CPU: E8400 Core2Duo @ 3GHZ

    I'm getting 5-7fps. Is this down to me still using Firefox 3.6?

    1. Re:My performance by Anonymous Coward · · Score: 0

      For me it "worked" in Firefox 4.01 (bounced between 12 and 35 fps). Didn't do anything at all in Chrome or IE 9. Seems like a waste - even when it worked it was too slow to play and the sound was abysmal.

    2. Re:My performance by nogginthenog · · Score: 2

      CPU: Celeron Dual-Core @ 1.8Ghz
      Firefox 4.x gets around 30fps, so I guess the answer is yes.

  14. Sound is abysmal by kevinmenzel · · Score: 2

    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.

    1. Re:Sound is abysmal by maitai · · Score: 1

      I actually wanted to play it, but the sound completely killed it for me.

    2. Re:Sound is abysmal by kripkenstein · · Score: 4, Interesting

      So... no music, and the sound effects are like a half second delayed from the action, AND they sound really REALLY bad.

      I agree, the sound is terrible, sorry about that. I don't know much about how sound stuff works, that is the best I could do in a few hours of hacking something together with the Audio Data API.

    3. Re:Sound is abysmal by mcavic · · Score: 1

      I played it on mute. It's quaint, but not very useful because of the window size.

    4. Re:Sound is abysmal by danieltdp · · Score: 1
      So you are the guy behind it. Kudos!

      Please, give us separate strafe keys! ;-)

      --
      -- dnl
  15. Non-JavaScript browser languages by Anonymous Coward · · Score: 0

    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.

  16. Ironically crashes my Firefox by Teknikal69 · · Score: 1
    Just crashed my firefox install when I tried it, Had a bit better luck with safari but the sound never initialized.

    Not really that impressed in honesty especially since quake online has been about quite a while and works a lot better.

  17. Re:Every platform? by GameboyRMH · · Score: 1

    It's also available for PalmOS (ZdoomZ)

    --
    "When information is power, privacy is freedom" - Jah-Wren Ryel
  18. Come on, you could do this with flash 2 years ago by Anonymous Coward · · Score: 2, Interesting

    Here's the link: http://www.newgrounds.com/portal/view/470460, plus: it does run with a higher framerate.

  19. sigh by Anonymous Coward · · Score: 0

    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.

  20. Ughhhhhh by davidbrit2 · · Score: 2

    I mean, it's a cool accomplishment in terms of implementation and all, but...

    Ughhhhhhhhhh.

    1. Re:Ughhhhhh by danieltdp · · Score: 2

      Its not ughhhh. Its old... :-) You should look what lies behind the bad graphics: playability, balance, level design, enemy design, etc. IMO, this game has some of the best level designs in game history.

      --
      -- dnl
    2. Re:Ughhhhhh by davidbrit2 · · Score: 1

      I'm not complaining about Doom, I'm complaining about horrendous JavaScript bloat. I love the game, and still play it now and then.

    3. Re:Ughhhhhh by danieltdp · · Score: 1

      Ok. My bad! Even so, I think its brilliant to be possible to port a nice oldie like doom to the browser! ;-)

      --
      -- dnl
  21. Buggy by Sigvatr · · Score: 1

    I'm sorry to ruin everyone's fun but this is full of visual glitches.

    1. Re:Buggy by JackDW · · Score: 1

      I did wonder what was with the sprite glitches. Sometimes sprites vanish, other times you can see them through walls. I've never seen anything like that in a Doom port. It shouldn't be possible unless the rendering code is changed. However, they say that no significant source changes were made, so I can't help wondering if I'm actually seeing the results of a compiler bug...

      --
      You're an immobile computer, remember?
  22. Step 2 by DrXym · · Score: 1

    Port the iOS APIs and run apps from any webhost. Obviously there would be limitations but I wonder what Apple could do about it.

  23. This proves the old adage by Jailbrekr · · Score: 2, Insightful

    "Just because you can, doesn't mean you should"

    --
    Feed the need: Digitaladdiction.net
    1. Re:This proves the old adage by DigiShaman · · Score: 1

      That's what she said.

      --
      Life is not for the lazy.
    2. Re:This proves the old adage by sockman · · Score: 1

      And then the bed broke.

    3. Re:This proves the old adage by Anonymous Coward · · Score: 0

      I'm pretty sure saying this about a Doom or Quake port means you instantly have to hand in your geek card.

    4. Re:This proves the old adage by Jailbrekr · · Score: 1

      I'm pretty sure saying this about a Doom or Quake port means you instantly have to hand in your geek card.

      I just turned 40, so I am officially in old man mode.

      --
      Feed the need: Digitaladdiction.net
    5. Re:This proves the old adage by david.given · · Score: 4, Informative

      "We do what we must, because we can."

    6. Re:This proves the old adage by lennier · · Score: 2

      I'll be honest with you. We're just throwing science at the wall here to see what sticks.

      --
      You are not a brain: http://books.google.com/books?id=2oV61CeDx-YC
    7. Re:This proves the old adage by Anonymous Coward · · Score: 0

      For science. You monster.

    8. Re:This proves the old adage by Anonymous Coward · · Score: 0

      Groan.

    9. Re:This proves the old adage by Combatso · · Score: 1

      just becuase you can't, doesn't mean they shouldn't

    10. Re:This proves the old adage by danieltdp · · Score: 1

      I have to disagree. There is a proof of concept behind this that should be done and kudos for the guy to do it on the most classic FPS on history. Wolfenstein was not good enough and duke nukem, quake, heretic, ROT all climbed over the giant's shoulder

      --
      -- dnl
  24. Doesn't work!? by Anonymous Coward · · Score: 0

    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...

  25. This is why Plug-ins are a great option. by JackAxe · · Score: 1

    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.

    1. Re:This is why Plug-ins are a great option. by Anonymous Coward · · Score: 0

      This is the kind of demo that shows that JavaScript and other fully open web technologies are evolving. We need things like this that push the envelope in order to move the web forward. Even if it could be better, it does show that we are getting closer to the point where developers won't have to rely on plugins. We're obviously not quite there yet, but as long as we keep pushing, we'll get there.

    2. Re:This is why Plug-ins are a great option. by JackAxe · · Score: 1

      It's a nice step forward in one respect, but when compared to plug-in like Flash, it's still a huge step back.

      It would be ideal if all browsers played nicely with each other and they all supported the same features, while upgrading in unison to keep things moving. Maybe that will happen sooner than later, but until then, and even then, it's nice to have the option of plug-ins for obvious reasons.

  26. A re-write in JS would have been MUCH faster. by VortexCortex · · Score: 1

    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.

    1. Re:A re-write in JS would have been MUCH faster. by h4rr4r · · Score: 1

      ARM machines are not so great at floating point, so that might not be true outside of desktops.

    2. Re:A re-write in JS would have been MUCH faster. by mbrubeck · · Score: 1

      Note that Alon Zakai, who published this demo, is also the person who wrote the Emscripten LLVM-to-JavaScript compiler. So I think he does deserve a cookie. :)

    3. Re:A re-write in JS would have been MUCH faster. by itchythebear · · Score: 1

      You want a cookie for being able to compile something? Too bad, I'm fresh out.

      No worries man, i got you covered.
      VortexCortex.cookie = "congratulations=Being able to compile something chocolate chunk;";

      --
      If what I just said sounded like a troll, it was probably just a failed attempt at humor.
    4. Re:A re-write in JS would have been MUCH faster. by multipartmixed · · Score: 1

      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.

      This is not quite true. JavaScript does not have multiple number types exposed to script, but the VM "knows" when you are working with ints or floats, and uses the appropriate types internally.

      For example, in Firefox, all JavaScript values are stored in a C type called a "jsval". As of Firefox 4, this is a 64-bit quantity, tagged to indicate type. ~16 bits are general-purpose tags, some are re-used when storing floats, pointers are limited to 48 bits with 8-byte alignment, short strings can be stored right in the jsval, and ints up to 32-bits are also stored in the jsval.

      This means that bitops are performed on integers internally, giving this JS

      var a = 12

      approximately this complexity if we were to write it in C:

      jsval v = (X & magic1 >> magic2) > magic2)

      Where X and Y are the jsvals which yield 12 and 3 when masked with magic1 and shifted right magic2 bits. Obviously, this is not as fast as '12 >> 3', but it is a hell of a lot more efficient than what you describe.

      For completeness, the pointers I mentioned will point to either JSObject or JSString, these are C stricts (well, C++ classes now) which store either objects or strings.

      And, while I speak only of Firefox, you can bet your backside that similar implementations exist in other browsers.

      --

      Do daemons dream of electric sleep()?
    5. Re:A re-write in JS would have been MUCH faster. by gsnedders · · Score: 1

      (Disclaimer: I'm one of the test engineers on Opera's JS engine.)

      Although JS as a language has a single Number type almost identical to IEEE 754 doubles (the only difference is there is only a single NaN value in JS), every implementation, going back to Brendan Eich's original, has always implemented the JS Number type as two separate types internally: signed 32-bit integers, and double-precision floats. Even today with modern JS engines and modern CPUs, integer maths is still substantially quicker than floating-point maths.

      Equally, they won't actually be dynamic object property lookups: the property lookups will be cached. There will likely be fairly little difference between Math.sin/cos/etc. calls and a lookup in an object.

    6. Re:A re-write in JS would have been MUCH faster. by Anonymous Coward · · Score: 0

      Dear karma whoring dumbass:

      The goal was not a functioning Doom port, but a proof of concept in automatic conversion from C to Java. No significant source changes were made. You act as if a proper Java port of the game you can play in a browser was the goal. We have enough Doom ports already.

    7. Re:A re-write in JS would have been MUCH faster. by VortexCortex · · Score: 1

      Benchmark it fool. I have, looking up hundreds of different sin/cos/acos values for a frame thrashes your "cache".

      Additionally -- Using a float type directly IS STILL FASTER than emulating floating point math with JS opcodes -- BENCHMARK before you BERATE, lest you find yourself a FOOL.

    8. Re:A re-write in JS would have been MUCH faster. by Anonymous Coward · · Score: 0

      Have you ever done anything interesting, ever?

      No, I'm not fucking signing this.

    9. Re:A re-write in JS would have been MUCH faster. by Anonymous Coward · · Score: 0

      Congratulations on your "Wayne the Fucking Brain" award. Enjoy jerking off to it in your desperate, lonely, sad basement.

    10. Re:A re-write in JS would have been MUCH faster. by Old+Wolf · · Score: 1

      Translation: I'm bitter I didn't think of this myself so I will just spew arrogant hubris

    11. Re:A re-write in JS would have been MUCH faster. by Anonymous Coward · · Score: 0

      Additionally: JS does not have any numbers except 64 bit floats!

      Did not. Does now.

    12. Re:A re-write in JS would have been MUCH faster. by gsnedders · · Score: 1

      I was â" for some reason, as thinking about this now it makes little sense â" hypothesising that the majority of callsites would have an immediate argument. http://jsperf.com/math-sin-cache/3 shows that in the case of having an immediate argument, in Opera at least (which is unsurprisingly what I know the perf characteristics of best), using a cache is significantly faster; Chromium is giving somewhat unstable results, showing between a 1â"5% difference between Math.sin and a cache; Firefox/QtWebKit both make Math.sin significantly quicker in the immediate argument case. Of course, in the case when the argument is largely polymorphic, property caches stop providing decent performance, and calling Math.sin becomes quicker.

      I also never claimed that implementing floating point maths in JS using integer maths was quicker than using the native Number type (or made any claim about the relative performance at all), merely that within JS engines not everything is a double, and that there is (internally) a separate int32 type, so the performance wouldn't be quite as bad as was claimed (which is certainly far from any claim that it's going to be at all quick).

  27. Re:Come on, you could do this with flash 2 years a by kevinmenzel · · Score: 2

    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.

  28. unplayable by Anonymous Coward · · Score: 0

    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.

  29. My only question is by toby · · Score: 1

    What took em so long??

    --
    you had me at #!
    1. Re:My only question is by Anonymous Coward · · Score: 0

      Gotta have respect for your.... ahem .... id

  30. oops broke it by hilldog · · Score: 1

    Error: R_DrawColumn: 265 to 275 at 17 FAILURE in loop iteration: SDL_Quit! Fun while it lasted.

  31. Gee by Anonymous Coward · · Score: 0

    "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!

  32. Dungeon Crawl Nettiles by Windwraith · · Score: 1

    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.

  33. version of java matter? by jasonmicron · · Score: 1

    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.

    1. Re:version of java matter? by amicusNYCL · · Score: 1

      This doesn't use Java, it uses Javascript and parts of HTML 5 (canvas, audio, etc).

      --
      "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
    2. Re:version of java matter? by afidel · · Score: 1

      It's javascript not java, so your browser version matters, something with a JIT compiler from the last 6 months will probably be able to display it at 30+fps (except Chrome, it doesn't render at all in either current or beta).

      --
      There are 4 boxes to use in the defense of liberty: soap, ballot, jury, ammo. Use in that order. Starting now.
    3. Re:version of java matter? by jasonmicron · · Score: 1

      It's javascript not java, so your browser version matters, something with a JIT compiler from the last 6 months will probably be able to display it at 30+fps (except Chrome, it doesn't render at all in either current or beta).

      Ahh, gotcha. Yea my RHEL5 system is running Firefox 3, my WinXP box is running Firefox 4.

    4. Re:version of java matter? by H0p313ss · · Score: 2

      Amazing... Over a decade and a half and even tech-heads still get this wrong.

      I did a "RESTful webservices in java" course the other day and the instructor felt it necessary to point out that JavaScript was not Java despite the fact that you had to have years of Java experience to even register for the course.

      --
      XML is a known as a key material required to create SMD: Software of Mass Destruction
    5. Re:version of java matter? by jon_doh2.0 · · Score: 1

      Runs faster in Chromium than Firefox 4 for me (Debian Linux), was getting between 13-25fps in FF and between 20 - 35fps in Chromium.

  34. In Soviet Russia, Firefox Dooms You! by jdgoulden · · Score: 1

    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.

  35. wow... by Anonymous Coward · · Score: 0

    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.

    1. Re:wow... by icebraining · · Score: 1

      Get a better browser. 30fps on FF4 on a single-core 1.6GHz.

  36. Doom? This is better by Anonymous Coward · · Score: 0

    This is better http://www.youtube.com/watch?v=cwLFAOqTPSs

  37. Reminds me of this comic by Anonymous Coward · · Score: 0
  38. Re:Come on, you could do this with flash 2 years a by jon_doh2.0 · · Score: 1

    Agreed. Much better version (in terms of playability), with more controls. Still, the sound was delayed for me.

  39. Re:Come on, you could do this with flash 2 years a by Anonymous Coward · · Score: 0

    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!

  40. isn't this part of the standard stress test suite? by Thud457 · · Score: 1

    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

  41. One more layer by Anonymous Coward · · Score: 0

    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?

  42. IE by Anonymous Coward · · Score: 0

    Not working in IE8... Can someone tell me why? *ducks*

  43. Re:Every platform? by walshy007 · · Score: 1

    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.

  44. Re:Come on, you could do this with flash 2 years a by icebraining · · Score: 1

    So will WebGL.

  45. Re:Not bad... by JackAxe · · Score: 1

    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.

  46. Descent port anyone? by Anonymous Coward · · Score: 0

    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.

  47. Huge Difference... by deesine · · Score: 1

    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
  48. It doesn't run! by ehernandez · · Score: 1

    I tried to run it loading the webpage on Firefox 4.0.1 with no luck.

  49. Doesn't work when I try it by Snaller · · Score: 1

    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
  50. Re:Come on, you could do this with flash 2 years a by Anonymous Coward · · Score: 0

    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.

  51. All that matters... by sootman · · Score: 1

    ... 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.
    1. Re:All that matters... by smitty97 · · Score: 1

      IDSPISPOPD doesn't, but that might be from doom 2 or something.

      --
      mod me funny
  52. Hell, can you do it? Go to it then! by Anonymous Coward · · Score: 0

    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.

  53. Speaking of DOOM... anyone know how to... by scottbomb · · Score: 1

    ...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.

    1. Re:Speaking of DOOM... anyone know how to... by Anonymous Coward · · Score: 0

      http://www.dosbox.com/
      or use a source port which stays faithful to the original

  54. No mouse turning? by Old+Wolf · · Score: 1

    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.

  55. hell ya by Anonymous Coward · · Score: 0

    super great..
    i m running ff5 in winxp in vbox 4 which is hosted in F14
    i got 36.x FPS....

  56. Re:Come on, you could do this with flash 2 years a by Anonymous Coward · · Score: 0

    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.

  57. Died while playing by I)_MaLaClYpSe_(I · · Score: 1

    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...

  58. Cool comment, but by Anonymous Coward · · Score: 0

    what are we supposed to understand from "Ughhhhhhhhhhh"? were you having liver pain?

  59. Audio Data API by Anonymous Coward · · Score: 0

    So.... this used the Mozilla direct-to-soundbuffer experimental API? Or was it using audio tags?

    1. Re:Audio Data API by Anonymous Coward · · Score: 0

      The direct to soundbuffer API.

  60. Mozilla has pulled the Doom link! by Anonymous Coward · · Score: 0

    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?