Results 1 to 7 of 7

Thread: Someone explain to me how KeeperFX was done.

  
  1. #1

    Default Someone explain to me how KeeperFX was done.

    I read what the author wrote on the KeeperFX page, but I'm really curious about a little more detail...

    "Instead, I've learned binary formats of EXE and DLL files, and modified the Dungeon Keeper executable file to become a DLL."

    "With my new DLL, I was able to create very simple executable file which may be used as complete code to run the game. Now I'm incrementally rewriting DK; functions which are not yet rewritten are called from the DLL, so the project functions like whole game, even though it wasn't completely rewritten yet."


    How does one modify an executable like this?

    Did the author find a way to see best-guesses of the original source code, and fix/add to it that way?

    Is there a thorough explanation somewhere on how this type of thing is done in full? I'm very familiar with C++ but I've never seen a project like this.

  2. #2

    Default Re: Someone explain to me how KeeperFX was done.

    I'm not a programmer at all, so I can't help you. But if you google 'code disassembly' you'll be able to learn more, and if you use terms like this for searching on this forum you'll be able to find what Mefisto shared about the subject here.

    Edit: And look here: http://keeper.lubiki.pl/html/dk_keeperfx_devel.php
    Last edited by YourMaster; October 14th, 2017 at 21:00.

  3. #3

    Default Re: Someone explain to me how KeeperFX was done.

    Thanks for that link. Exactly what I was looking for.

    Wow, I'm blown away. This is very difficult stuff and was truly a work of passion. Amazing.

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

    Default Re: Someone explain to me how KeeperFX was done.

    It is awesome that mephisto found original dbg exes. Without them he would have auto generated names for functions from ida. I talked to him before, he did not find dbg exes for dk2. Which is a shame.
    http://img192.imageshack.us/img192/6659/c2warlocki.gif

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

    Default Re: Someone explain to me how KeeperFX was done.

    Quote Originally Posted by spartahawk View Post
    How does one modify an executable like this?
    Some more articles covering the challenges:
    http://sandsprite.com/CodeStuff/Usin..._as_a_dll.html
    https://www.codeproject.com/Articles...ssion-Possible

    It's easier the other way around, injecting your code into the target process.
    https://www.codeproject.com/Articles...oces#section_1

    Quote Originally Posted by spartahawk
    This is very difficult stuff and was truly a work of passion.
    Not difficult, just tedious. What you would really need is automation.
    There are a few decompilers (even online like https://retdec.com/) but they focus on giving you half-decent pseudo-code intended for manual analysis rather than something semantically equivalent to the original when recompiled.

    This one is more interesting in that it is based on the idea of an x86 emulator: http://zneak.github.io/fcd/

  6. #6

    Default Re: Someone explain to me how KeeperFX was done.

    Great stuff, thank you. Maybe someday I'll get around to trying to contribute. The pathfinding bug is a real pain on what could be some great maps. I would love to know what would be involved in finding and fixing it. Do you know how debugging would work for this sort of project? Can you have exceptions thrown and get a stack trace etc? Can you even run it all in debugging mode in an IDE at all? Or is it all much more complicated than that?

  7. #7

    Default Re: Someone explain to me how KeeperFX was done.

    That is assuming the current issues with the pathfinding are caused by the original code. It might just as well be Mefisto's own code(he thinks so), which is 'just' C++ that can be found on github and debugged however you are used to.

Similar Threads

  1. Explain DK1’s Engine
    By Ominous Perspective in forum Dungeon Keeper 1
    Replies: 3
    Last Post: January 21st, 2013, 19:47

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
  •