DOOM and DOOM II games compiled for web with WebAssembly.
You can try it here.
webDOOM uses PrBoom open source DOOM code, classic game assets like Doom1.wad and Doom2.wad files, original music in MP3 format and sound effects in WAV format.
Big thanks to all sites in links above for providing required assets to make it feel like original games and especially to the WebAssembly comunity that keeps working on this amazing tool!
You can build it on your own by following these steps:
-
First of all, PrBoom (v2.5.0) requires a 32-bit Linux distro (better if Debian based), so I would recomend you to install this one for your Virtual Machine if you're running a 64-bit based OS.
-
Once it's done, follow these steps to be sure to have all necessary packages to compile PrBoom code (actually you can skip
libsdl-net1.2-devandSDL_netpackages since online game is not supported). -
Be also sure to have
git,autoconfandautomaketools. -
Now you can download and install the
emscriptencompiler by following these instructions. -
Finally, clone this repo.
-
Run
./configurescript in the root folded (it can take a while) and when all theMakefiles have been created, be sure to set correct compiler paths foremcc's CC; CPP; LIBS; RANLIB and SDL options based on the location ofemsdk's folder on your machine in allMakefiles of this repository. -
Make sure to have the required music files in here (or here if you're building DOOM II) as well as the SFX files (for convenience of downloaded SFX files, their names are preceded by
dscharacters as you can see here). -
Alternatively, you can build with
-nosoundflag by adding it to your Module object as explained here. -
With active
emcccompiler (run./emsdk activate latestandsource ./emsdk_env.shin your emsdk directory), navigate to the root folder of this repo and run./build.shto compile DOOM or./build.sh doom2to compile DOOM II. When running./build.shthe first time, it can take a while becauseemscripten's cache hasn't been set yet, but at the end you should see theHTMLapplication inwebfolder here.
I was not able to compile PrBoom on Windows because of some issues:
-
PrBoom needs to be compiled by using its
Makefilewhich requires amakecommand to be executed from your console in the project folded. -
There are several ways to have a
makecommand even if you're using a Windows machine and those are to install one of the following consoles: MinGW; Cygwin or WSL. -
Besides that, PrBoom's code is strictly related to the compiler's architecture, so you'll have to use a
mingw32bash (for example) in order to avoid all the errors that will come if you'll try to build it directly on ax64CPU. -
Another pain in the ass refers to the
SDLversion you'll have to use (1.2.x) which is pretty old and can cause some problems when trying to install it for amingw32compiler. -
So, even if you'll figure out all the requirements above, you'll find out that unfortunately,
emccdoes not support MinGW or Cygwin enviroments (at least I faced this problem with v1.38.13) and there's no Windows Subsystem for Linux that emulates anx32architecture. -
Despite that, you can install
emscripten; clone this repo and runbuild.bat(for DOOM) orbuild.bat doom2(for DOOM II) on Windows that will produce you a validHTMLapplication from thisLLVMcode.