[DLL] Mysterious Diablo 2 dlls

This forum is for discussions on how to edit what can not be edited through the txt files, needless to say this isn't about battle net hacking.

Moderators: Nefarius, Havvoric

Post Reply
User avatar
Burznazg
Posts: 12
Joined: Tue Jul 12, 2016 1:31 pm
Poland

[DLL] Mysterious Diablo 2 dlls

Post by Burznazg » Thu May 10, 2018 8:04 pm

Hello,

some time ago I was asking about which version of Diablo 2 should I mod. But unfortunatelly I was not able start serious progress during that time but now. Anyway back to the topic.

Every day I'm going through this forum to gather as much informations as I can however it is somehow unclear for me how dlls are correlated and for what they are exactly responsible. Not sure if I missed some tutorial or some kind of dlls master list, so if I did, I ask kindly to point it for me. There so many tutorials and other stuff here that I'm literally drowning in information currently. Obviously d2game.dll with d2client seems to be the most important ones when it comes to modding. I saw numerous times that d2game.dll is called 'server'. Can someone explain to me how exactly should I interpret it? Is this dll really a server code which runs on bnet? Or this is related to some kind of game architecture design?

Also how this related to fact that d2server.dll also exists? What is purpose of this dll? I know it is not present in recent versions of the game. Not sure at which point it was removed? 1.10? Some knows? Also how about the fact that there supposably was command line parameter '-server'. It had been used with this dll? I'm curious about history how files changed over the years.

And one more thing. What game.exe is responsible for? What stuff related to game is happening there? Creation of windows in OS? Some game control flow? High level graphics handling?

User avatar
Necrolis
Senior Admin
Throne
Posts: 9125
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
Contact:
South Africa

Hand-picked

Re: [DLL] Mysterious Diablo 2 dlls

Post by Necrolis » Thu May 10, 2018 10:03 pm

To understand the dll's you need to understand the architecture of a D2 game, and how that fits into Bnet/mp/sp games. The very simplified version is something along these lines:

D2Game.dll contains the game server, D2Client.dll mirrors everything needed for the visual representation plus communication to the game server. D2Server.dll was accidentally packaged with D2 v1.00, there is only one public version of it; it runs the realm server and supporting services together with D2Game.dll, which allows it to host multiple games for clients to connect to. game.exe glues everything together, and runs D2Launch for the main menus, D2Multi for BNet Menus, D2Client for in-game and D2Server for the realm. D2Common.dll contains code that is used by the client and the game server (but not the realm server), to deduplicate work, then the rest of the dll's are supporting code.

storm => a massive collection of Blizzards standard libraries carried through many of their older games up till WC3; contains the input manager and MPQ code most notably, and many OS or CRT functions
fog => very similar to storm, and in many cases wraps a lot of storms code into another API (I believe this dll was used for OS abstraction between Windows & Mac), contains the networking layer of D2, the memory manager, the file system layer and other misc functions.
D2GFX => the graphics interface/driver, loads D2GDI/D2DDraw/D2Direct3D/D2OpenGL(not public)/D2Glide for the OS graphics API chosen through D2VidTest
D2Win => contains a lot of supporting code for UI elements, text drawing, and various odds and ends like MPQ loading
D2Sound => The sound driver
D2Lang => does all the string work in D2, and manages the string tables for localization
D2Net => contains a thin network layer around fog.dll
D2CMP => this contains all the code related to sprites and tiles (DC6, DCC & DT1 files), as well as all the palette handling code and internal format conversion and encoding tools
Smack32 and Bink => the are codecs from RAD Tools for movies/sound
ijl11 => lib from Intel used for jpeg compression of screenshots

The rest of the Dll's are used for various BattleNet stuff which I will omit.

In 1.14x all the dll's got statically compiled into game.exe to produce a monolith binary, that contains everything.
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

User avatar
Burznazg
Posts: 12
Joined: Tue Jul 12, 2016 1:31 pm
Poland

Re: [DLL] Mysterious Diablo 2 dlls

Post by Burznazg » Sat May 12, 2018 11:42 am

Thank you very much for explanation Necrolis. Indeed some things are now clearer for me.

Post Reply

Return to “Code Editing”