bethington/docker-pd2
If you are the rightful owner of docker-pd2 and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Project Diablo 2 Docker Container provides a comprehensive environment for running Project Diablo 2 with integrated VNC remote access, memory monitoring, and MCP server capabilities for AI assistance.
Project Diablo 2 Docker Container
This Docker container provides a complete environment for running Project Diablo 2 with VNC remote access, memory monitoring, and MCP server integration for AI assistance.
Features
- Headless Gaming: Runs Project Diablo 2 in a virtual X11 display
- Remote Access: VNC server for remote desktop connection
- AI Integration: MCP server for Claude Desktop integration
- Memory Monitoring: Real-time game state monitoring
- Custom Resolution: Optimized 1068x600 resolution for container environment
- 3dfx Support: Enhanced graphics rendering with 3dfx emulation
Prerequisites
- Docker and Docker Compose installed
- Project Diablo 2 game files in
pd2/
directory - VNC client (optional, for remote access)
Quick Start
-
Build and run the container:
docker-compose up --build
-
Connect via VNC:
- Host:
localhost
- Port:
5901
- No password required
- Host:
-
Access services:
- VNC:
localhost:5901
- MCP Server:
localhost:8765
- Health Check:
localhost:3000
- VNC:
Directory Structure
Diablo2/
āāā Dockerfile # Container definition
āāā docker-compose.yml # Service orchestration
āāā README.md # This documentation file
āāā INSTALL.md # Installation and setup guide
āāā start_diablo2.sh # Main startup script (executable)
āāā diablo2_monitor.py # Memory monitoring service
āāā diablo2_mcp_server.py # MCP server for AI integration
āāā screenshots/ # Directory for game screenshots
āāā memory_dumps/ # Directory for memory analysis dumps
āāā pd2/ # Project Diablo 2 game files (user provided)
āāā Base Game Files (Root Level):
āāā D2.LNG # Language file
āāā d2char.mpq # Base character data
āāā d2data.mpq # Base game data
āāā d2exp.mpq # Expansion pack data
āāā d2music.mpq # Base music files
āāā d2sfx.mpq # Base sound effects
āāā d2speech.mpq # Base voice files
āāā d2video.mpq # Base video files
āāā D2xMusic.mpq # Expansion music
āāā d2xtalk.mpq # Expansion voice files
āāā D2xVideo.mpq # Expansion videos
āāā Patch_D2.mpq # Base game patches
āāā Save/ # Save Directory
ā
āāā ProjectD2/ # Project D2 mod directory
āāā Executables:
āāā Game.exe # Main game executable
āāā Diablo II.exe # Original Diablo 2 executable
āāā PD2Launcher.exe # Project D2 launcher
āāā D2VidTst.exe # Video test utility
ā
āāā Core Game Libraries:
āāā D2Client.dll # Client library
āāā D2Common.dll # Common game functions
āāā D2Game.dll # Core game library
āāā D2gfx.dll # Graphics library
āāā D2Lang.dll # Language support
āāā D2Launch.dll # Game launcher
āāā D2Net.dll # Network functionality
āāā D2sound.dll # Audio system
āāā D2Win.dll # Windows interface
āāā D2CMP.dll # Compression library
āāā D2Multi.dll # Multiplayer support
āāā D2MCPClient.dll # Battle.net client
āāā Fog.dll # Blizzard utility library
āāā Storm.dll # Blizzard core library
ā
āāā Graphics & Display:
āāā D2DDraw.dll # DirectDraw wrapper
āāā D2Direct3D.dll # Direct3D wrapper
āāā D2Gdi.dll # GDI graphics
āāā D2Glide.dll # 3dfx Glide wrapper
āāā D2HD.dll # HD graphics support
āāā ddraw.dll # DirectDraw implementation
āāā glide3x.dll # 3dfx Glide library
āāā SGD2FreeRes.dll # Resolution mod library
āāā SGD2FreeDisplayFix.dll # Display fix library
ā
āāā Media & Codec Libraries:
āāā binkw32.dll # Bink video codec
āāā SmackW32.dll # Smacker video codec
āāā ijl11.dll # Intel JPEG library
āāā sciter.dll # HTML/CSS engine
āāā WebView2Loader.dll # Modern web integration
āāā libcrypto-1_1.dll # Cryptography library
ā
āāā Project D2 Mods:
āāā ProjectDiablo.dll # Main Project D2 modifications
āāā PD2_EXT.dll # Project D2 extensions
āāā BH.dll # BH maphack integration
āāā Bnclient.dll # Battle.net client mod
āāā StormLib.dll # MPQ archive library
ā
āāā Game Data Archives:
āāā d2gl.mpq # D2GL graphics mod
āāā D2MultiRes.mpq # Multi-resolution support
āāā patch_d2.mpq # Game patches
āāā pd2assets.mpq # Project D2 assets
āāā pd2data.mpq # Project D2 data
āāā pd2maps.mpq # Project D2 maps
āāā SGD2FreeRes.mpq # Resolution mod data
āāā SlashDiabloHD.mpq # HD graphics pack
āāā ver-IX86-1.mpq # Version-specific data
ā
āāā Configuration Files:
āāā BH.json # BH maphack settings
āāā BH.json.bak # BH settings backup
āāā d2gl.json # D2GL graphics settings
āāā d2gl.yaml # D2GL YAML config
āāā ddraw.ini # DirectDraw settings
āāā D2HD.ini # HD graphics settings
āāā default.filter # Default item filter
āāā loot.filter # Loot filter settings
āāā local_metadata.json # File integrity checksums
āāā ProjectDiablo.cfg # Project D2 configuration
āāā ProjectDiablo.json # Project D2 JSON config
āāā ProjectDiablo.json.bak # Config backup
āāā SGD2FreeResolution.json # Resolution settings
āāā SGD2FreeRes.json # Resolution config
āāā UI.ini # UI positioning configuration
File Categories
Essential Game Files
Base Diablo 2 Installation (in pd2/
):
*.mpq
files - Original game data archivesD2.LNG
- Language support file
Project D2 Mod (in pd2/ProjectD2/
):
Game.exe
- Modified game executableD2*.dll
- Core game librariesProjectDiablo.dll
- Main mod functionality- Modified
*.mpq
files - Mod-specific content
Enhancement Files
BH.dll
- BH maphack integrationSGD2FreeRes.mpq
+SGD2FreeResolution.json
- Resolution modWebView2Loader.dll
- Modern web integration
Configuration Files
UI.ini
- Interface positioningSGD2FreeResolution.json
- Display settings
Environment Variables
Variable | Default | Description |
---|---|---|
WINEPREFIX | /root/.wine | Wine installation directory |
WINEARCH | win32 | Wine architecture (32-bit) |
WINEDEBUG | -all | Disable Wine debug messages |
DISPLAY | :1 | X11 display number |
Ports
Port | Service | Description |
---|---|---|
5901 | VNC | Remote desktop access |
8080 | Web VNC | Optional web-based VNC |
3000 | Health Check | Container health endpoint |
8765 | MCP Server | AI integration endpoint |
Game Launch Parameters
The game is launched with the following parameters:
wine Game.exe -ns -3dfx
-ns
: No splash screen-3dfx
: Enable 3dfx graphics acceleration
Desktop Integration
The container creates desktop shortcuts and menu entries:
- Desktop Shortcut:
/root/Desktop/Diablo2.desktop
- Fluxbox Menu: Right-click desktop to access game launcher
- Applications Menu: Available in
/root/.local/share/applications/
Troubleshooting
Common Issues
-
Game won't start:
- Check if game files exist in
pd2/ProjectD2/
- Verify Wine initialization completed successfully
- Check container logs for error messages
- Check if game files exist in
-
VNC connection failed:
- Ensure port 5901 is not blocked by firewall
- Try connecting to
0.0.0.0:5901
instead oflocalhost:5901
-
Resolution issues:
- Modify
SGD2FreeResolution.json
for different resolutions - Adjust Xvfb resolution in
start_diablo2.sh
- Modify
-
Performance issues:
- Try different Wine D3D renderer settings
- Adjust container resource limits in docker-compose.yml
Debug Commands
Access the running container:
docker exec -it diablo2_container /bin/bash
Check running processes:
docker exec diablo2_container ps aux
View logs:
docker-compose logs diablo2
Development
Adding New Features
- Memory Monitoring: Extend
diablo2_monitor.py
- MCP Server: Modify
diablo2_mcp_server.py
- Game Configuration: Update config files in
pd2/ProjectD2/
Custom Resolutions
To use different resolutions:
-
Update
SGD2FreeResolution.json
:"Ingame Resolutions": ["1920x1080"]
-
Modify Xvfb in
start_diablo2.sh
:Xvfb $DISPLAY -screen 0 1920x1080x16 &
Security Notes
- VNC server runs without password (suitable for local development only)
- Container runs as root (consider non-root user for production)
- All ports are exposed (restrict in production environments)
License
This container setup is for educational and development purposes. Ensure you own legitimate copies of all game files.