Post

Post

Mattias Gustavsson đź’– on X: "Have you ever thought about playing around with the original DOOM source code? I'd recommend it, it is really nice. But if you grab the original source code release, it is not very easy to get it to build. So I wanted to share this quick fix-up for it, making it easy to build"

  • user avatar

    Have you ever thought about playing around with the original DOOM source code? I'd recommend it, it is really nice. But if you grab the original source code release, it is not very easy to get it to build. So I wanted to share this quick fix-up for it, making it easy to build

  • user avatar

    The repo is here: github.com/mattiasgustavs… and to build it, you just go: cl doom.c or tcc doom.c no need to install any dependencies or use any build systems. This version is for windows and wasm, but might not be too difficult to port to mac/linux

    user avatar

    I also made it so you can build it for WebAssembly, so you can run it in a browser. Try it here: mattiasgustavsson.com/wasm/doom-crt Full instructions for building for WASM is in the README in the repo (it is just another one-liner, and a build tool you just download and unzip).

    user avatar

    There are a lot of great windows ports, fixing bugs and adding features, and most of them would be a better choice if you want a DOOM which runs well on windows, or if you want some code to do serious work on top of. My port won’t try to compete with those efforts.

    user avatar

    I think it might be useful to make available a simple and minimalistic port. One which modifies the original code as little as possible, uses as few dependencies as possible (no large external frameworks) and which can be built without a complex build system.

    user avatar

    I am applying me CRT shader to it, because, well, I think it looks nice, and it makes it easy to apply aspect ratio correction. I also wanted to make both music and sound effects work, as I've noticed that's something that is sometimes missing from some quickly ported versions

    user avatar

    One cool thing about the web build, is that if you just open it in your browser mattiasgustavsson.com/wasm/doom-crt and then just save the html file, you get a single, fully self-contained html file that you can run locally. And it is about the same size as the doom.exe+doom1.wad. Cool!

    user avatar

    And one thing I specifically wanted to do for this, is to make it as an actual fork from the id Software github code for DOOM github.com/id-Software/DO… I didn't move files around, or change thinsg if I didn't need to. And all changes I did can be seen in the history.

    user avatar

    If you want to learn more about how DOOM works, how the code and engine is structured, and just in general want a really good read, I really recommend Game Engine Black Book: DOOM by

    @fabynou

    , available here: fabiensanglard.net/three_books_up… It is really great, as is his other books

    user avatar

    And if you want to know more about the people who made the game, I whole-heartedly recommend Doom Guy: Life in First Person by

    @romero

    available here: romero.com/shop/p/doomguy It is a very enjoyable read!

    user avatar

  • user avatar

    The media could not be played.

    GIF

Did someone say … cookies?

X and its partners use cookies to provide you with a better, safer and faster service and to support our business. Some cookies are necessary to use our services, improve our services, and make sure they work properly.