Flash Plays Doom

July 20th, 2007

Update 3: Visit the home of Doomed Online here.

Update 2: There’s a bigger, badder, version up now.

Yes, that’s THE Doom. This uses the original Doom shareware wad file and gets all content from it at runtime. There’s no preloader, so be patient, it’s 1.7 MB. Use the arrow keys to move.

You’ll need to view this in a browser with Javascript and Flash 9 in order to see it.

There’s no sprites yet (enemies, barrels, that sort of thing) and you can walk through walls too. There’s also a mysterious bug that erects unnecessary walls in the outer areas of the map, but altogether it’s still pretty fast and stable right now. There’s some rudimentary sound support too, although for some reason it sounds scratchy at the end of a sound right now. Press the spacebar to hear.

It took some trial and error to get this far, since making a fast rendering system is so important. I tried using the same method for drawing bitmaps as Papervision at first, and while it was very fast, it also looked terrible. Papervision’s technique doesn’t seem to work well in an FPS environment because the wall textures skewed as you walk along them. I tried again with another method that used Flash’s draw method heavily, but it was far too slow and hard to work with. I was about to trash the whole thing, but I tried a more basic system, roughly resembling how environments were drawn in the original Doom where each pixel is drawn one-by-one. It seemed like it was still too slow, but after a few key optimizations to the drawing routine it ended up being very fast. I honestly wasn’t expecting that, but it’s actually playable now on a decent computer.

I don’t know exactly where I’m going with this, but I’m pretty sure it’s worth it. The only thing I can’t do is the music, the format is roughly the same as midi, and as far as I can’t tell it can’t be preloaded. Everything else Doom is capable of is possible. This whole thing was developed entirely using Flex 2 and the Flex 3 beta with Eclipse on Ubuntu Linux. In other words, with only free tools, right down to the OS.

Update: Apparently nobody knows my name. I think that’s kinda cool, but it’s actually Max.

71 Responses to “Flash Plays Doom”

  1. Theo Says:

    Brilliant. Absolutely brilliant. Very good work.

  2. AMY Says:

    TU

  3. IdleTogether - Technology, design and impressive web applications » Blog Archive » Why Flash really rocks - digging out the past! Says:

    […] the original Doom? I used to play hours on my PC at the time. Well some dude (couldn’t find his name!) spends his time reading the original WAD file from Doom and is […]

  4. Nicolas Noben / Idle Together Says:

    Cool stuff. Keep us posted!

  5. Tim K Says:

    Damn!

    Check http://www.suite75.net/lab/doom/

    Seems you outrun me 🙂

    Cool work!

  6. mike Says:

    this is awesome. keep it up.
    Can we expect more? 😀

  7. Tim K Says:

    about the sound: something like a http://en.wikipedia.org/wiki/ADSR_envelope will fix the nasty static noise.

  8. Mr.doob Says:

    Nice!

  9. Mr.doob Says:

    Btw, is it just a proof of concept? Or are you planing to finish it?

  10. flashnine Says:

    That is cool. I will admit I have your site bookmarked before 🙂

    [link removed]

    Best

  11. hoover Says:

    regarding the noisy sound, it sounds like you are playing back too much data, thereby playing back what is located in memory/wad right after the actual sound data end…

  12. Max Says:

    Tim K: Cool! I thought I was the first to attempt this.

    mike: Probably, how much I don’t know.

    Mr.doob: Time will tell.

    flashnine: What was up with that link? Looks like blogspam to me. I removed it.

    hoover: You’re probably right, but sound is low on the to-do list right now.

  13. deltawing1 Says:

    Nice work 😀 I wanna have your skills.

  14. Andrew Trice Says:

    Did you actually get Flex Builder running on linux!?! If so, what did you do to get it working? Or, are you just using eclipse with Flex SDK & xml-based code hinting for Flex/actionscript? Very nice work by the way. I have spent entirely too much time playing Doom. 🙂

  15. adampasz Says:

    Awesome. Now what about doing Dark Forces?

  16. Max Says:

    Andrew Trice: I wrote an article on how I did it, it’s bit outdated at right now, but still works fine.

    How to develop for Flash on any OS, for free

  17. Garotos de Web — Doom feito em Flash para browser Says:

    […] http://blog.brokenfunction.com/2007/07/20/flash-plays-doom/ COMPARE PREÇOS DE: MP3, IPOD, CELULARES, NOTEBOOKS, CâMERAS, MONITORES, IMPRESSORAS, LIVROS NO […]

  18. » Doom terá versão em Flash! - Antenando.com.br Says:

    […] Para mais informações, confira no blog do desenvolvedor. […]

  19. Fernando Says:

    Max 🙂 Great work, let me point out there is a Doom music remake project at http://doom.ocremix.org/, you can also find on the web some MIDI files that are awesomely close to the original songs. Hope you make wall collision and doors next.

  20. Max Says:

    Thanks Fernando, I actually have that on my computer already but I never really considered it.

    The Doom music format and MIDI are pretty similar. The problem isn’t making it (which would be hard enough) it’s the fact that it would slow things down too much.

  21. links for 2007-07-31 | blog.ftofani.com Says:

    […] BrokenBlog » Blog Archive » Flash Plays Doom Jogue doom no flash (tags: flash doom as3 3d inspiration game) […]

  22. links for 2007-08-01 | pristina.org | everything design Says:

    […] BrokenBlog » Blog Archive » Flash Plays Doom Jogue doom no flash (tags: flash doom as3 3d inspiration game) […]

  23. Tim K Says:

    Hey Max,

    If you want to go further with this, maybe we could join forces? Ping me if that sounds cool 🙂

  24. Bloggy » Arquivo » Doom em flash Says:

    […] Todo gamer que se preze conhece esse clássico da violência digital. Quem não se lembra de andar naquele labirinto de texturas pixeladas e idênticas enquanto era perseguido por monstros radioativos emitindo urros com uma qualidade de som duvidosa? Ficou nostálgico? Não se preocupe! Esse game, que é um modelo de jogo FPS (First Person Shooter) até os dias atuais, está sendo refeito em flash e estará disponível para ser jogado no seu browser em pouco tempo. O desenvolvedor está encontrando vários problemas com a implementação, o que deixa a certeza que o término do projeto ainda não está próximo, mas do pouco que ele divulgou, dá pra perceber que a versão em flash não perde em nada para a original. Confira o projeto no blog do desenvolvedor. […]

  25. Flash plays Doom Says:

    […] Max from BrokenBlog has coded a proof of concept of Flash implementing Doom. It actually uses the WAD file from the Doom shareware. He has implement sprites, but the enemies are just standing and staring at the player. The map does work though, but it’s still possible to walk through walls. The Doom clone features rudimentary sound, but sounds end in noise. The whole thing was developed entirely using Flex 2 and the Flex 3 beta with Eclipse on Ubuntu Linux. In other words, with only free tools, right down to the OS. You can play the game right here. […]

  26. Gauze Says:

    this was literally breath taking… i got flashbacks from when i was 10 sitting there playing doom, finding out all the passages and shit, man, and its amazing flash can run it

  27. Madarco DevBlog » Blog Archive » The Doom game in Flash Says:

    […] See it here: Flash Doom game […]

  28. nekra Says:

    that’s amazingly fast!

    considering drawing pixel by pixel

  29. Clodoaldo Says:

    Esta Bien, solo que no se estan respetando las paredes, parece que estuviera con el cheat IDCLIP

    Saludos…

  30. Hugo Says:

    wow…the feel is just right, just like good ol’ doom!

    I can’t wait to see a playable version? Max, tell me you have plans to make this into a full-fledged version !! I’d love to be be hunting these monsters again…or be hunted 😉

  31. Raghibsuleman Says:

    nice one……………

  32. Sam Says:

    Very good, how’s it done?

  33. David Says:

    The question is, will you be sharing the source code with the world?

  34. Max Says:

    Hugo: I’m making this purely for my own amusement at this point, I don’t really know where this will end up.

    Sam: Much in the same way Doom is done really I suppose, using a BSP tree.

    David: Yeah, probably. Right now I need to complete more of it.

  35. Yowza Says:

    I saw this on http://www.SubliminalMessages.com and loved Doom. Good luck with the music and the sprites. Yowza.

  36. Me-now Says:

    Big Deal. Step 1 Finish the project THEN post it! This is like saying “eat bread” and then presenting your guests with wheat. C’mon!

  37. Anonymous Says:

    come on finish it man!!!

  38. Matt Ellsworth Says:

    awesome – just awesome!

  39. noticiasfrikis » Flash Doom Says:

    […] Quiero probarlo. […]

  40. Matthew Lloyd Says:

    Very nice. A Friend and I have a nice competition as to who can do Quake 2 in Flash first without using Papervision 3d ^^

    Its proving to be fun 😀

  41. Phil Says:

    Wow. That’s incredible!

    I am very impressed.. great job!

  42. abdullah Says:

    Great work mate! any idea when the final version will be out?

  43. Doom! « Love Uncle Sean Says:

    […] straight through the walls and all that good stuff. He’s got it in a post on his blog called Flash Plays Doom. Nostalgic PC gaming […]

  44. Max Says:

    Wow, this “Uncle Sean” blog is classic. He thinks this blog is called “Flash Plays Doom” and gets a nostalgia kick from this proof-of-concept because it reminds him of his days “blowing shit up” in Doom. Good to know you don’t have to add weapons or sprites to please people.

  45. sweet Says:

    Very nice

  46. Noah Says:

    Wow…thats great.
    To all the people who say Flash is a weak development environment…I give you this.
    (gotta say, as a 14 year old game designer, that inspired me)

    Simply wondering:
    I’m not certain exactly how the data in doom is presented, but could you create a bitmap data object and project the top down view onto it?
    Since the data in Doom is rendered pixel by pixel, I’d assume that each pixel has an X,Y, and Z coordinate. If you rendered only the X and Z data to the bitmap when the flash loaded, then kept track of the player position relative to this object, couldn’t you have a rough sort of collision detection?

    Using the player position and testing it against the Not sure if I explained it clearly…

    But you’ve probably considered that anyway.

  47. Max Says:

    Noah: Yeah, I could do that, but that doesn’t provide enough detail, I’m using real mathematical line segments provided by Doom for collisions. The data in Doom has line segments for each section of a wall, not pixels, although you could say Wolfenstein had something like that.

  48. Glidias Says:

    How did you program this Doom in Flash? Did you use actual BSP calculations or sector-based calculations? I assume the walls are line segments….but are the line segments done for each tile-width of the wall?

    ALso, is the ground tile-based? HOw does program overall differ from conventional raycasting in WolfenStein/Rise of the Triad?

  49. » BrokenBlog » Blog Archive » Flash Plays Doom - ScatteredGenius.com Says:

    […] BrokenBlog » Blog Archive » Flash Plays Doom Yes, that’s THE Doom. This uses the original Doom shareware wad file and gets all content from it at runtime. There’s no preloader, so be patient, it’s 1.7 MB. Use the arrow keys to move. […]

  50. blog.sokay.net - flash game development discussion » Blog Archive » Doom in Flash Says:

    […] Check it out! […]

  51. stefan Says:

    i wont doom 3 to play realy much.

  52. Jonathan Says:

    Hmm, so how do you actually draw the pixels, with which flash function? I know that doom is just an bps-accelerated ray tracer …

  53. valentino Says:

    this is incredible! with some collision detection can become terrific! 😀 good work!

  54. zanemx Says:

    Nice freakin work. This is amazing. I too was a doom head.

  55. Flex for Flash games coming of age | OMGWTF GAMES !!1! Says:

    […] ago I did some research into using the Adobe Flex framework to create Flash games. I found an amazing port of Doom using the Flex SDK, but at that stage, there was no source code on offer, so I couldn’t learn much from it […]

  56. i-create | therefore-i am » Blog Archive » CakePHP and More Says:

    […] is an excelent library. Flash has been becoming a 3d boom town. There are numerous code examples of importing .wad files and quake maps just look around. I will go into more detail when I get a chance at […]

  57. Nobody Says:

    This is awesome. Just need the monsters and items. The only problem I forsee is the loading. It may have to stream constantly to get all the data. However, with faster internet, it shouldn’t be a problem. Other then that, it is a brilliant idea.

  58. rkthe1 Says:

    hi……

    excellent work dear. waiting for it buddy… finish it off before quake zero….

    and provide us with multi player version …..

    :).

  59. Grey Says:

    Very good indeed – very fast – please keep with it.

  60. Yetta Says:

    I just wanted to thank #35 for mentioning http://www.subliminalmessages.com

    Very cool optical illusions, impossible figures and other weirdness – even though my eyes have been screaming at me all day!

  61. codervish Says:

    I’m after the toolkit. U mention all free stuff. What are the eclipse plugins u use. And the setup method (I use Win but Ubuntu can be a choice).

  62. Anonymous Says:

    Flash 10 supports true 3D

  63. Enfin du P2P avec Flash - open* Richmedia Says:

    […] pour éviter de réecrire le code existant en AS3, d’autres l’ ont déjà testé pour faire tourner Doom […]

  64. arch129 Says:

    Wow! :O
    I love Doon and now I can play it in Flash, this is fantasic!
    I hope that you will finish it to the point where you can play Doom like the orignal.
    Your doing an awesome job! ^^

    -arch

  65. Brendon Smith Says:

    Hello Max, I have been playing around with your source code that I downloaded from google code. I am currently using Flash Develop as an environment for development. Although I am in need of better debugging tools. I noticed you mentioned you developed this on Ubuntu what opensource program did you use on Ubuntu to develop this and how or what did you use to debug? I noticed in your code you place lots of movies that give debugging information on the screen when enabled did you primarily handle your debugging in that fashion? I also noticed on the source code I downloaded from svn the “Player” can only move forward and backward but I do see the MoveRight and MoveLeft with what appears to be the correct code. -Thanks in advance thanks for submitting this as opensource.

  66. Max Says:

    Brendon: I used the Flex SDK (2 and 3) with Eclipse. To debug I generally used fdb (comes with the Flex SDK) or just threw errors which the debug player can inform me about. Some browsers don’t like turning or strafing, I never bothered to figure that one out, but it works for some.

  67. Jake "The Cool Person" Says:

    Nice. Could you actually try to put the sprites on, along with some weapons, like Skulltag, and NEW levels???

  68. Jake "The Cool Person" Says:

    …As soon as possible would help.
    A lot.

  69. Jake "The Cool Person" Says:

    How about make a flash of Doom 2? And TNT:Evilution? And Plutonia? And the Master Levels?
    Either would do.

  70. Tom Says:

    Very nice work, Max!

    I saw a lot of Doom compared with flash these days.
    There is also a Flash version of Doom in 2D:

    http://www.codinsoft.de/doom2d.html

    Will there be also a multiplayer in your Doom version, Max? That would be cool… Like Quake-Live 🙂

    – Tom

  71. Evilzug.com › BrokenBlog » Blog Archive » Flash Plays Doom Says:

    […] BrokenBlog » Blog Archive » Flash Plays Doom Yes, that’s THE Doom. This uses the original Doom shareware wad file and gets all content from it at runtime. There’s no preloader, so be patient, it’s 1.7 MB. Use the arrow keys to move. […]

Leave a Reply