There are two main ways of going about this, one is legal, one is not.

1. A company provides an SDK to the public to develop mods/add-ons. For instance, World of Warcraft, and games made with the Half-Life 2 engine. Requires: Game development knowledge, SDK knowledge, and (generally) C++/C knowledge

2. A game is disassembled, and understood completely. The programmer then will include his file into the disassembled code, linking to his own modification. Requires: Game development knowledge, (generally) C/C++ knowledge, ASM knowledge, OllyDBG (or IDA Pro, GDB, or another disassembler) knowledge, Computer Science theory, lots and lots of patience.

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rick Cook

To add to above: Some games will have closed source code for the game itself, but provide an API with decent documentation for additional modding purposes rather a full blown SDK. In this instance all you need to do is learn the API, the docs (and general knowledge of whatever language is being used) and hack away.. best bet, grap someone else's open source mod and play around with that to get familiarized before diving into your own mods.

To add to the above: some games have a closed source and no API, but some people develop useful internal API's which you install as mods, and then develop your own mods to use the API externally. An example of this is the ModLoader mod for minecraft, which does nothing to the gameplay, but acts as an API for other people's mods so that conflicting mods won't overwrite each others files.

ghost107 wrote:For a black box mods(not legal, in some cases), injecting a script/plugin engine into a game engine I think its much easier to mod then modding it entirely into a low level language.

An example of this being the cheat mods that script kiddies install into their half-life 2 based game engine to speed hack and all that what-not.

And lastly, you can mod the game by using wrappers. Wrappers don't change the game files in any way, they simply act as a man-in-the-middle type of thing where they can make scripted pistols, radars which show you where and what other shit is, and just some chat based functionality. (in fact, this can be done with both / either the client or the server, servers with wrappers tend to have additional text functionality as well)

And some mods are just as easy as changing or overwriting a few variables or images. Don't forget some games are made to be modable, even though the SDK might not be released. Then it could be as easy as opening an ini file and changing some variables. If you can get to the resources (images, sounds etc.), you can already mod a lot. The best way to learn: try something simple yourself, get into a team with an already done mod (as suggested) and then learn until you can do it yourself.

As you can see and probably tell, there can be a large difference between how difficult it is to mod one game compared to the next. Learning C++ is almost always required, as most professional games use that. It can be done without, but such a mod usually won't have the potential of one done with knowledge of programming and the game itself. That being said: it's almost always a better idea to mod than to create your own game from scratch. The framework being there already and all....