docker-pd2

bethington/docker-pd2

3.2

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.

Tools
1
Resources
0
Prompts
0

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

  1. Build and run the container:

    docker-compose up --build
    
  2. Connect via VNC:

    • Host: localhost
    • Port: 5901
    • No password required
  3. Access services:

    • VNC: localhost:5901
    • MCP Server: localhost:8765
    • Health Check: localhost:3000

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 archives
  • D2.LNG - Language support file

Project D2 Mod (in pd2/ProjectD2/):

  • Game.exe - Modified game executable
  • D2*.dll - Core game libraries
  • ProjectDiablo.dll - Main mod functionality
  • Modified *.mpq files - Mod-specific content

Enhancement Files

  • BH.dll - BH maphack integration
  • SGD2FreeRes.mpq + SGD2FreeResolution.json - Resolution mod
  • WebView2Loader.dll - Modern web integration

Configuration Files

  • UI.ini - Interface positioning
  • SGD2FreeResolution.json - Display settings

Environment Variables

VariableDefaultDescription
WINEPREFIX/root/.wineWine installation directory
WINEARCHwin32Wine architecture (32-bit)
WINEDEBUG-allDisable Wine debug messages
DISPLAY:1X11 display number

Ports

PortServiceDescription
5901VNCRemote desktop access
8080Web VNCOptional web-based VNC
3000Health CheckContainer health endpoint
8765MCP ServerAI 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

  1. Game won't start:

    • Check if game files exist in pd2/ProjectD2/
    • Verify Wine initialization completed successfully
    • Check container logs for error messages
  2. VNC connection failed:

    • Ensure port 5901 is not blocked by firewall
    • Try connecting to 0.0.0.0:5901 instead of localhost:5901
  3. Resolution issues:

    • Modify SGD2FreeResolution.json for different resolutions
    • Adjust Xvfb resolution in start_diablo2.sh
  4. 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

  1. Memory Monitoring: Extend diablo2_monitor.py
  2. MCP Server: Modify diablo2_mcp_server.py
  3. Game Configuration: Update config files in pd2/ProjectD2/

Custom Resolutions

To use different resolutions:

  1. Update SGD2FreeResolution.json:

    "Ingame Resolutions": ["1920x1080"]
    
  2. 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.