MV But... Can it run Doom?

Can It Run Doom?
mario135790_, original port to WebAssembly made by
diekmann

Introduction

Can your RPG Maker MV games run Doom? Apparently yes, they can.

RPG Maker MV (and MZ) games use NW.js, which itself is based on the Chromium browser engine and the Node.js runtime, both of which provide native support for WebAssembly. I didn't find anything related to anyone trying this, so I figured I would try. Turns out it is possible.
This uses diekmann's WebAssembly port. I chose this over heavier ports like Dwasm because it's stripped down, and I figured it would be much easier to inject into the RPG Maker engine without breaking a lot of stuff. Now, to be fair, I didn't even begin to try to get Dwasm working, but... if it works, it works.

I really need to emphasize this, I did pretty much none of the hard work, that was all diekmann. I just made the NW.js app start up the Doom engine and handle the inputs.

Features
For rendering, it uses a dedicated canvas overlaid on the game window.
The port has no native sound driver, so the plugin plays a BGM of your choice instead. You can configure the song name in the Plugin Manager (default: DoomBGM).
I also included a crash handler. If Doom crashes (which happens when trying to save/load or when exiting the game in the menu), it catches the error and returns you to the main game rather than killing the whole application.

Screenshots
1767596755014.png
1767596771619.png


How to Use
Pretty much plug and play. Drop the data and js folders into your project's root directory. Make sure doom.js, doom.wasm, and doom1.wad are located inside YourProject/data/doom/.
To play a different WAD, replace doom1.wad with your own WAD file, but keep the filename as doom1.wad so the engine recognizes it.
To start the game, use the PlayDoom plugin command.

I don't know if it requires updating NW.js, but I recommend doing it anyway.

Plugin Commands
PlayDoom: Starts Doom.

Terms and Credits
Honestly... doubt you would use this in your game but, there's no need for credit.
Major props to diekmann for his work back in 2021.

Disclaimer about AI usage:
AI was used for debugging and to polish the CSS to make the game canvas full screen. Everything else is hand made.

Download
itch.io
Updated itch.io! Now using Dwasm!

Turns out using Dwasm was incredibly straightforward. I tried doing the same thing I did for diekmann's port. Didn't work.
Then I thought: "Wait... why not run it in a sandboxed iframe?"
Did that. It worked.

So yeah, if you REALLY REALLY want Doom running on your game with pretty much everything working and custom WAD support, there it is.

Next thing I'd like to explore is getting Doom to communicate back to RPG Maker. Things like triggering common events, activating switches, or incrementing variables. That could open up some really cool possibilities, but it would require modifying the Doom source code itself, and... I don't know much about C, so I don't know if I could do that haha.
I didn't check the files, but since your description doesn't make it very clear: are you distributing DOOM or does it require the person to own DOOM in order to make this work?

I'm also not up on the legal state of DOOM. While I am aware it's become a meme of "can it run DOOM?" (and usually the answer is yes :LZSlol: I'd be more fascinated what can't run DOOM at this point.) most of that has been done as personal projects. I'm not aware if it has an open license at this point. I'd err on the side of it not, considering official versions are still listed and distributed by Bethesda - owner of the DOOM rights now.

Another thing I am not 100% sure on - since I am not a mod - but the forum cannot condone piracy and if you are distributing the DOOM files with this, that would be a form of it...so you may need to alter the distribution so that the player is required to have their own copy of DOOM (assuming you aren't already doing that.)

Very funny though, I approve.
I didn't check the files, but since your description doesn't make it very clear: are you distributing DOOM or does it require the person to own DOOM in order to make this work?
Don't worry haha Doom Shareware is perfectly legal to distribute and is included with the plugin. It would be another story if I just included the full game in there.

Also, yes, there is a disclaimer stating that you need to own the games if you intend to use them with the plugin, and Freedoom is suggested as an alternative.
This reminded me of a guy who was merging Rm2k3 with Wolf4SDL.

Original thread: https://forums.rpgmakerweb.com/threads/but-can-it-run-doom.181785/