Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There is a game currently in development in C# (using Direct3D for graphics) that I want to make mods for.

Ideally, I would like to make the mods in C#, but after that I am lost. How would I (or other people) put the finished mod into their version (client) of the game? I know that for Java this is pretty simple (as shown by all the Minecraft mods in the wild) but is it harder (or even possible) for a language like C#? Is there something special the devs have to do to make sure modding is possible?

share|improve this question
up vote 1 down vote accepted

If the developer builds the game with the intent of supporting mods, then you can create mods through whatever means the developer has elected to support. Generally the language used to build the game and the specific technologies used to build the game (Direct3D, in this case) are not relevant to the game supporting mods in this case.

If the developer does not build the game with mod support, it's still possible to alter the game but generally you will have far fewer options and all of those options will be much more difficult. At this point it does matter what technologies the original developer used. For example, it's possible to hook (using DLL injection or hooking, for example using the Detours toolchain) function calls the game makes to the D3D interfaces and redirect them, allowing you to draw extra information on the screen.

You can also examine the game's data files and attempt to reverse engineer and modify them.

Decompiling, modifying, and reassembling the executable or its dependent DLLs is also an option but one that sits on questionable ethical and legal grounds -- I would not recommend this approach.

Your best bet would be to contact the developer and express your interest in a modding API and toolset.

share|improve this answer

Modding is something that is easy depending on language, but more how the developer designs his game.

Minecraft for example is actually decompiled, and then the necessary modifications are added by copying new files to the jar. Things like the ModLoader or Bukkit for MC make modding not only easier, but also allow for mods to be run without actually modding the files, but instead being loaded at game load.

Generally mods are implemented using Hooks, and a set of functions are given to you (the API). You can "tap into" the Hooks and have your own peice of code run. E.G, there is a OnJoin hook, with all the information about the player joining being passed to it. You as a modder can "tap into" it, and using the given API functions, do stuff when a player Joins.

As far as your question goes...

If the developers of the game give modders an API to work with, then modding is possible. Generally mods would be placed in a folder and run at game load.

If they do not, modding can still be done, but generally the game would be decompiled by another team, an API will be added over the top of the code, and that will make modding possible.

As far as actually making the mods go. You would have documentation on what language they allow; C# or Java, or scripting languages like Lua. And then using the given functions, you create your mod from that.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.