Results 1 to 10 of 10

Thread: Dungeon Keeper 2 - Convert KMF Meshes to OBJ

  
  1. #1

    Default Dungeon Keeper 2 - Convert KMF Meshes to OBJ

    Hi Friends.

    Currently i try to write a small article for my blog (simonschreibt.blogspot.de) about DK2 but i'm stuck with my investigations.

    You can extract the mesh files (.KMF) of Dungeon Keeper 2 with a mod tool but I need an importer for 3Ds Max or Blender or a converter which can convert KMF to OBJ. I already searched the web and found nothing. The only piece of code i got was this:

    https://bitbucket.org/trass3r/gameto...s/d8e318ea78f4

    I'm not sure what it is doing exactly but i hope it can convert KMF to OBJ. I tried to contact Trass3r who wrote the code but didn't get any response. So if you know something, have tools, understand the code, are a DK2 developer or just feel inspirited to investigate the KMF files - feel free to help me.

  2. #2
    Your Majesty Hapuga's Avatar
    Join Date
    Aug 2009
    Location
    Austin, USA
    Posts
    1,444

    Default Re: Dungeon Keeper 2 - Convert KMF Meshes to OBJ

    The biggest problem is getting the files back into the game. Nobody figurd that out yet.
    http://img192.imageshack.us/img192/6659/c2warlocki.gif

  3. #3

    Default Re: Dungeon Keeper 2 - Convert KMF Meshes to OBJ

    No problem for me. I just want to investigat the geometry. So, do you know how to convert KMF into a readable format like OBJ?

  4. #4
    Your Majesty Hapuga's Avatar
    Join Date
    Aug 2009
    Location
    Austin, USA
    Posts
    1,444

    Default Re: Dungeon Keeper 2 - Convert KMF Meshes to OBJ

    No idea.
    http://img192.imageshack.us/img192/6659/c2warlocki.gif

  5. #5
    Demon Spawn
    Join Date
    Sep 2009
    Location
    Germany
    Posts
    188

    Default Re: Dungeon Keeper 2 - Convert KMF Meshes to OBJ

    It's a complex format.
    Code:
    local int i;
    
    struct {
        char magic[4];
        int size; // size of file incl. header
        int version; // = 17
    } KMSH;
    
    struct {
        char Signatur[4];
        int size;
        int Format; // 1 = Mesh, 2 = Anim (?)
        int uk; // = 1
    } HEAD;
    
    struct Texture {
        string name;
    };
    
    struct MAT2 {
        char Signatur[4];
        int size;
        string uk; // internal name?
        int NumTextures;
        Texture Texturenames[NumTextures]<optimize=false>;
        int uk1;
        int uk2;
        int uk3;
        string uk4;
    };
    
    struct {
        char Signatur[4];
        int size;
        int NumMat;
        MAT2 Materials[NumMat]<optimize=false>;
    } MATL;
    
    struct Mesh {
        char MeshSig[4];
        int size; // inkl. Signatur
        struct {
            char head[4];
            int size;
            string meshname;
            int NumGroups;    // number of groups in SPRS
            int NumVerts;    // total number of vertices defined in GEOM
            float uk1; // bounding area?
            float uk2;
            float uk3;
            float uk4;
            int NumLOD;    // number of total LOD entries
        } Header;
        struct Ctrl {    // NumCTRL only non-zero in ANIM files
            char Signatur[4];
            int size;
            int NumCTRL;
            int uk[NumCTRL*2];
        } ctrl;
    
        typedef struct {    // only used in ANIM files
            char Signatur[4];
            int size;
            float x,y,z;
        } POLY;
    
        typedef struct {
            short index;    // index of the vertex in GEOM
            int uk;        // flag?
            float nX;    // the vertex normal
            float nY;
            float nZ;
        } VertEx;    // Extra vertex data with normals
    
        struct Model {
            char Signatur[4];
            int size;
            for (i=0; i<Header.NumGroups; i++)
            {
                struct {
                    char Signatur[4];
                    int size;
                    int LODEntries[Header.NumLOD]; // one entry for each LOD
                    int NumVertsEx; // number of entries in the extended vertex list
                    int uk;
                } SPHD;
            }
    
            for (i=0; i<Header.NumGroups; i++)
            {
                struct
                {
                    char Signatur[4];
                    int size;
                    int uk;
                    local int j;
                    for (j=0; j<Header.NumLOD; j++)
                    {
                        struct {
                            struct {
                                ubyte x,y,z; // indices for the extended vertex list
                            } LODVertIndices[SPHD[i].LODEntries[j]];
                        } LODEntries;
                    }
    
                    VertEx VertsEx[SPHD[i].NumVertsEx]; // extended vertex list
                } Groups;
            }
        } model;
    
        typedef struct {    // a vertex definition
            float x;
            float y;
            float z;
        } Vec3f;
    
        struct GEOM {
            char Signatur[4];
            int size;
            Vec3f vertices[Header.NumVerts];
        } geom;
       } mesh;

  6. #6

    Default Re: Dungeon Keeper 2 - Convert KMF Meshes to OBJ

    Thx Trass3r. I finally got it and here's the resulting article:

    http://simonschreibt.blogspot.de/201...r-2-walls.html

  7. #7
    Demon Spawn Keeper Decagon's Avatar
    Join Date
    Sep 2012
    Location
    Tanis Base, The Great Derelict
    Posts
    183

    Default Re: Dungeon Keeper 2 - Convert KMF Meshes to OBJ

    Do you know where I could download the WAD tool from? On keeper.lubie it only says to search the internet, and so far I haven't found anything useful, only dead links.
    Current creatures in the RPG:

    Creatures in Northland


    Creatures in RCI



    Creatures in Faircoast


  8. #8

    Default Re: Dungeon Keeper 2 - Convert KMF Meshes to OBJ

    Here you go. But please check the EXE with virustotal.com or something other before you execute it.

  9. #9
    Demon Spawn Keeper Decagon's Avatar
    Join Date
    Sep 2012
    Location
    Tanis Base, The Great Derelict
    Posts
    183

    Default Re: Dungeon Keeper 2 - Convert KMF Meshes to OBJ

    Thanks for the link.
    Current creatures in the RPG:

    Creatures in Northland


    Creatures in RCI



    Creatures in Faircoast


  10. #10

    Default Re: Dungeon Keeper 2 - Convert KMF Meshes to OBJ

    I already read the article of this link:
    http://simonschreibt.blogspot.de/201...r-2-walls.html
    It may work for some people, but not for me, when I try do do it follow the guide, I encounter with error after error, could anyone just upload the obj format models?

Similar Threads

  1. Hive Keeper - Dungeon Keeper remake on Starcraft 2
    By Bibendus in forum General Discussion
    Replies: 55
    Last Post: March 9th, 2024, 11:46
  2. Convert & Conquer
    By Tacyarts in forum DK2 Maps
    Replies: 5
    Last Post: November 1st, 2021, 11:14
  3. Dungeon Keeper Ami
    By Aelphais in forum General Discussion
    Replies: 0
    Last Post: July 25th, 2011, 05:47
  4. Dungeon Keeper won't run
    By Combat-Enforcer in forum DK1 Troubleshooting
    Replies: 5
    Last Post: July 16th, 2010, 19:54
  5. Does keeper klan have a wiki for dungeon keeper?
    By kyle in forum General Discussion
    Replies: 9
    Last Post: November 6th, 2009, 14:02

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •