Code Monkey home page Code Monkey logo

webdoom's Introduction

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!

Building webDOOM on Debian

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-dev and SDL_net packages since online game is not supported).

  • Be also sure to have git, autoconf and automake tools.

  • Now you can download and install the emscripten compiler by following these instructions.

  • Finally, clone this repo.

  • Run ./configure script in the root folded (it can take a while) and when all the Makefiles have been created, be sure to set correct compiler paths for emcc's CC; CPP; LIBS; RANLIB and SDL options based on the location of emsdk's folder on your machine in all Makefiles 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 ds characters as you can see here).

  • Alternatively, you can build with -nosound flag by adding it to your Module object as explained here.

  • With active emcc compiler (run ./emsdk activate latest and source ./emsdk_env.sh in your emsdk directory), navigate to the root folder of this repo and run ./build.sh to compile DOOM or ./build.sh doom2 to compile DOOM II. When running ./build.sh the first time, it can take a while because emscripten's cache hasn't been set yet, but at the end you should see the HTML application in web folder here.

Building webDOOM on Windows

I was not able to compile PrBoom on Windows because of some issues:

  • PrBoom needs to be compiled by using its Makefile which requires a make command to be executed from your console in the project folded.

  • There are several ways to have a make command 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 mingw32 bash (for example) in order to avoid all the errors that will come if you'll try to build it directly on a x64 CPU.

  • Another pain in the ass refers to the SDL version you'll have to use (1.2.x) which is pretty old and can cause some problems when trying to install it for a mingw32 compiler.

  • So, even if you'll figure out all the requirements above, you'll find out that unfortunately, emcc does 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 an x32 architecture.

  • Despite that, you can install emscripten; clone this repo and run build.bat (for DOOM) or build.bat doom2 (for DOOM II) on Windows that will produce you a valid HTML application from this LLVM code.

webdoom's People

Contributors

ustymukhman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

webdoom's Issues

Created GitHub Page to Play

Steps to reproduce:

  1. I ran python -m http.server
  2. Could play DOOM w/ keyboard & mouse on samsung smart tv w/ samsung web browser (Chromium I think),
  3. Created GitHub Pages fork
  4. Site is online at https://el3ctro-.github.io/webDOOM/public/
    5.I actually had some trouble compiling on Termux, it says I don't have openGL installed which is sorta not true cause i can "make install" SDL just fine with the right 'configure'.

Cheers
el3ctro-

full screen sucks

when i do full screen it won't work and my courser won't go away fix please

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.