doom_pipeline.mp4
This is a Chocolate Doom WebAssembly port with WebSockets support for Open WebUI Functions platform.
-
Download the exported function and import it in Workspace > Functions
OR
Copy the source code and paste into a new function.
-
(Optional) Download the model configuration and import it in Workspace > Models
-
(Optional) To use your own
.WAD
file:- Host your
.WAD
file anywhere accessible via URL - Update the WAD URL in the function's Valves configuration
- Host your
-
Launch the game by typing
/play doom
into the chat -
Play DOOM!
We couldn't have brought DOOM to your WebUI without the legendary contributions and inspirations from the following awesome folks and projects:
- John Carmack, John Romero, and the rest of the iD Software team for creating the original DOOM and revolutionizing gaming forever.
- Cloudflare's WASM port of Chocolate Doom for making this web-based adaptation possible. Check out their work here.
- Tim for creating the beautiful monster that is Open WebUI, the original Snake game implementation, and his final push over my roadblock to getting this to actually work.
- Pad for the improved Snake game that inspired our implementation of DOOM.
- Everyone else on the Open WebUI Discord for their ideas, suggestions, and unending encouragement and support.
It couldn't have been done without all of these people. Thank you!
-J
You need to install Emscripten and a few other tools first:
brew install emscripten
brew install automake
brew install sdl2 sdl2_mixer sdl2_net
There are two scripts to facilitate compiling Wasm Doom:
./scripts/clean.sh
./scripts/build.sh
1. Place .WAD
File: Put your DOOM .WAD
file (e.g., doom1.wad
) in the src
directory of your fork or clone of this repo.
2. Install and Configure:
- Follow the installation steps above.
3. Configure Valves:
- In Workspace > Functions, click the gear icon for the DOOM function.
- Set these values:
- Git Repo URL:
https://raw.githubusercontent.com/yourusername/webui-doom/tree/main/src
(use the raw content CDN) - WAD URL:
https://raw.githubusercontent.com/yourusername/webui-doom/tree/main/src/doom1.wad
(use your.WAD
filename)
- Git Repo URL:
4. Launch DOOM:
- Type
/play doom
in the chat. - Enjoy DOOM with your custom
.WAD
!
To show important messages coming from the game while it's running we send the following formatted stdout messages, which can be parsed in the web page running the wasm:
doom: 1, failed to connect to websockets server
doom: 2, connected to %s
doom: 3, we're out of client addresses
doom: 4, ws error(eventType=%d, userData=%d)
doom: 5, ws close(eventType=%d, wasClean=%d, code=%d, reason=%s, userData=%d)
doom: 6, failed to send ws packet, reconnecting
doom: 7, failed to connect to %s
doom: 8, uid is %d
doom: 9, disconnected from server
doom: 10, game started
doom: 11, entering fullscreen
doom: 12, client '%s' timed out and disconnected
Chocolate Doom and this port are distributed under the GNU GPL. See the COPYING.md file for more information.