Brief Description

Semi is a mod loader for Enter the Gungeon. It is the successor of ETGMod, and part of the Mod the Gungeon project. Semi is a complete rewrite, with a wildly incompatible API, and therefore mods written for these platforms are incompatible.

Enter the Gungeon is written in C# and runs on the Unity3D engine. It includes various Unity plugins, most notably Toolkit2D (ingame rendering), Daikon Forge (UI) and AudioKinetic WWise (audio). Due to the nature of the .NET platform, decompilation of assemblies (.NET libraries/executables) produces results that are very close to the original source code. Together with the fact that since version 1.0.9 the Enter the Gungeon code is not being obfuscated (per modding community request), this makes modifying the code that Gungeon runs fairly easy compared to other games.

To accomplish the most basic form of modding, that is, to create an entry point for the mod loader to be able to start executing code, a toolkit called MonoMod written by 0x0ade is used. Semi uses static patching - that is, the game is modified offline (on disk). The other method of patching is dynamic patching where the game is modified as it runs - there are pros and cons to both approaches, and Semi actually allows mods to do the latter, but for performance and other historical reasons the former has been chosen.

MonoMod operates by reading a compiled .NET library, looking for certain markers that identify patches (intended changes to the code), then merges these changes with the original assembly. Semi acts only as input to MonoMod - it is not executable by itself, and it is useless without the toolkit.

MonoMod is included in the MTG generic installer (which is in turn used by the Semi installer).

Hopefully this page explains at least a little bit about Semi's architecture and the most basic concepts of modding .NET (C#) programs and games. The next pages in this section are going to focus more on practice.

Last updated