Skip to content
patrickklug edited this page Apr 26, 2017 · 4 revisions

If the default Modding API's are not enough to realize your mod idea you can use the power of HTML 5 to change nearly every aspect of the game.

Doing this requires a bit of studying the games own source code (available under ./compressed/codeNw.js). You can use a beautifier to make reading the code easier. You can also apply to get access to the unobfuscated code by filling out this form.

Important: While it's fine to read the code in order to make a mod for Game Dev Tycoon, it is against the EULA and Modding Agreement to reverse engineer or re-use the code or techniques in the code for any purpose other than modding the game. Game Dev Tycoon is NOT open source, it is a proprietary product owned by Greenheart Games Pty. Ltd. - If you have any questions please consult the EULA, Modding Agreement or contact [email protected]

Modding techniques

Add-on methods

The easiest way to mod the game is to write add-on methods that interact with the original game source. In fact, the official Game Dev Tycoon Mod itself are just a bunch of add-on methods. With a bit of knowledge you can easily mod things that are not yet supported through this API. Add-on methods are often of general usefulness so please consider creating a PR to add any good API's you create to the official gdt-modAPI mod.

Re-acting to events

Game Dev Tycoon ships with a bunch of events defined on the GDT object and you can use these to great results.

Changing game code behavior

It might be tempting to start changing the game code in codeNw.js directly but this is not a good practice. First, this will potentially break other mods and secondly it will make it very hard to distribute your mod since it's illegal to distribute the codeNw.js file with your mod.

For this reason it's better to patch the games source code, rather than changing it directly. You can easily do this by overwriting objects/methods in the game code. Sometimes you might just want to add a hook when something happens, in this case you can hijack an original method like this:

var originalMethod = GDT.foo;
var bar = function(){
	//add your custom code
	originalMethod();//if appropriate, call the original logic
};

GDT.foo = bar;//assign your custom method over the original.

If there are cases where you don't have access to certain game internals but this is required to make your mod work, please contact us on our forum and we will try to make internal methods/objects available.

Distribution of your mod

Please be very careful that your mod does NOT distribute any parts of the original game such as code-parts or images or any other kind of assets. Mod's must be add-ons that change/adapt or add things to the game; they can't package any of the source material.

Clone this wiki locally