Tag Archives: Dungen Keeper 2

I made a game! Buy on Steam

Deep in the dungeons of my brain was something waiting to come out. The last impulse to bring it into the daylight was given to me through Dr. Fj. He mentioned the walls of Dungeon Keeper 2 and made me think and write about it.

S t r u c t u r e

Let’s start easy: The game makes you build and underground empire and for that you have to “cut” the ground earth on a cube basis (like Minecraft).
I wondered if these cube geometries are already existing (standing side by side) or if the whole ground geometry is one big block and modified in real time. The answer can be seen if you activate a wireframe
mode:
There are no cubes standing side by side! It’s “solid mass” where the needed intersections are cut into. You can also notice how the whole polygon topology changes at the cut area

S i l h o u e t t e

One point which fascinated me since i saw the game the first time is shown here. The image consists of 3 frames: 1. Screenshot 2. Overpaint (silhouette following original form) and 3. Overpaint (straighten to show how boring it could look).
The overpainted wall structure shows some nice geometry variation. If you think about a wall, you may think that it should be straight. But wouldn’t this look a bit boring (at least for a comicish style)? I wondered how this is done, because the
geometry/topology of the wall/ground changes – depending on the type of the wall and size of the room (more about this later).

It seems that there’s some kind of realtime transformation going on. Sure, the wall parts could be stored in several versions and stick together by code. But 2 clues lead me to a different suggestion.

  1. Most times i can’t see repeating patterns.
  2. A possibility to see the original geometry was given to me. This is the result:

These are the original geometries of the “training room” walls. As you see, the meshes aren’t deformed. Just straight lines – except a small alcove (lower right) and a shield (low centered). This is you it looks in the game:
I hope you can recognize the meshes and see, that they’re deformed (at least a bit). This leads me to the consideration that the artists had a “relaxed” job by not creating x variations of the same asset in different deformation states. Instead, the coders invested some brain power to add a consistent “noise modifier” (to speak in 3Ds max talk).

And this deformation not only moves the vertices a bit, instead the impact can be  pretty drastically like you can see if you let your workers dig a column of earth:

V a r i a n c e

Besides the nice deformation, i really like how dynamic the different wall parts are placed. The different tiles are sorted depending on the size of the room. Here i built a training room for the goblins and you can see how the wall “react” to the placement of more and more training tiles:

D a m a g e

Another nice detail: before walls are destroyed, they get different textures for the damage state:

E d g e

Last but not least: I really like that they not only textured the wall but also the top of the wall! It’s nothing fancy but i like the sense of detail.

E n d

You reached the end of the article. I thank you for reading and visiting my blog. I would be happy to hear your opinion about it!

If you wanna know, how to extract the meshes of DK2 or read some words of thank, just continue reading.

T u t o r i a l (3Ds Max)

It took me long time to find the tools and a workflow to extract the DK2 meshes and show them in 3Ds Max. Here’s the workflow:

  1. Install Dungeon Keeper 2 (e.g. GoG Version)
  2. Download DK2WADTOOL here (original link is dead)
  3. Run the DK2WADTOOL and select a WAD file from your game directory e.g. …\DungeonKeeper2\data\Meshes.WAD
  4. Download the 010 Editor Trial here
  5. Download the necessary scripts here (Thx to Hoenir!!) and extract them RAR archive
  6. Start the 010 Editor
  7. Open one of the KMF mesh files from the …\DungeonKeeper2\data\Meshes directory (created by the DK2WADTOOL) via “File > Open File”
  8. Open the template (Dungeon Keeper 2 KMF.bt) which you extracted from Hoenirs RAR archive via “Template > Open Template”
  9. Run the Template via “Template > Run Template” and select the opened template there
  10. Open the template (Keeper 2 Vert Extrahierungsskript.1sc) which you extracted from Hoenirs RAR archive via “Script > Open Scripts”
  11. Run the Script via “Script > Run Script” and select the script there
  12. A new tab with a new file should be created which should look like the following. Copy the whole file content into the clipboard.fn create = (
    temp = mesh numverts:9 numfaces:8
    setVert temp 1 [0.000000,0.500000,-1.000000] …
  13. Open 3Ds Max
  14. “Max Script > New Script”
  15. Paste the script code here
  16. In the script window press “Tools > Evaluate All”
  17. Done! A new objects is generated which should show you the mesh. It’s pretty small – zoom in!

T h n k s

This took me longer than every other article and i needed more help than ever.  Without these great people it wouldn’t have been possible to collect all the   information. But the greatest thing of this project is to get in contact with other people and so i want to say thanks to:

FJ because he mentioned the issue and gave me the last impulse to start writing.

Elshad for finding out, that the that the DXRipper wireframe mode works even if it doesn’t show the usual interface.

Tomasz Lis for providing DK2 tools on a website and answering all my questions

.

Trass3r for giving me hope. I found his code snippets which let me hope that there’s a solution.

Hoenir for being part of the decryption of the DK2 file format, answering all my  questions and most important: handing me out the template and script for the 010 editor. Without these it isn’t possible to have a look on the original meshes of the game.

Update 1

Trass3r has released updated scripts to convert KMF to OBJ! Thank you so much! <3