This project is a simplified, web-based port of the original Diablo game, making it easier to run on your own server or hosting environment. The goal is to bring the classic Diablo experience to the browser using a modern tech stack, including Vite and TypeScript.
To play the full game, you must use your own DIABDAT.MPQ file obtained from an original copy of the game available on GoG.
You can only upload diabdat.mpq, and it must be compressed using the compression tool available at: johnimril.github.io/diablo_web/.
To run the game locally:
- Place the compressed
diabdat.mpqfile in thepublicfolder. - Start the development server as described below.
To deploy the game on your own server:
-
Compress
diabdat.mpq:
Use the compression tool available at johnimril.github.io/diablo_web/ to reduce the file size. -
Prepare the build:
Generate the production build of your project (e.g., usingnpm run build). -
Upload files to your server:
- Upload the build files to your server in the
../diablo_web_simple/directory. - Upload the compressed
diabdat.mpqfile to the same../diablo_web_simple/directory.
- Upload the build files to your server in the
-
Verify paths:
Ensure that the build anddiabdat.mpqare accessible at the correct paths.
This project was initially based on the DiabloWeb repository by d07RiV. The code has been modified to remove unnecessary dependencies and to expose a minimal JavaScript interface, enabling the game to be compiled into WebAssembly. My optimized project
Significant changes were made to event handling—particularly in the menus—to adapt to the browser-based, JavaScript-driven environment.
This project also builds on the work of devilution, which was crucial in making Diablo 1 playable in web browsers through WebAssembly. The source code used to build the WebAssembly modules can be found here.
- Vite Build System: Enjoy faster and more efficient development with Vite.
- TypeScript: Strong typing for improved maintainability and reduced bugs.
- Modernized Codebase: Updated dependencies and refactored code for better performance and reliability.
- Compatible with Node 22: Resolved issues that prevented the project from running on Node 22.
- Node.js (v20 or later)
- npm
-
Clone the repository:
git clone https://github.com/JohnImril/diablo_web_simple.git
-
Navigate to the project directory:
cd diablo_web_simple -
Install the dependencies:
npm install
-
Place your
diabdat.mpq(full game) in thepublicfolder. -
Start the development server:
npm run dev
The application will be available at http://localhost:5173/diablo_web_simple/.
To build the project for a production environment:
npm run buildTo deploy the game on your own server:
- Build the project for production as described above.
- Upload the contents of the
dist/directory to your hosting environment. - Ensure that
diabdat.mpqis placed in the correct location (e.g., the same directory asindex.htmlindist/). - Access the site through your server’s URL. You can now play Diablo directly from your own hosted environment.
Contributions are welcome! If you encounter any issues, feel free to open an issue or submit a pull request.
Special thanks to d07RiV for the original DiabloWeb project, which laid the groundwork for this project. Additionally, we extend our gratitude to the devilution team for their incredible work in making Diablo 1 accessible on modern platforms.
