MonkeyModdingTroop / MonkeyLoader

A convenience and extendability focused mod loader using NuGet packages.
https://monkeymoddingtroop.github.io/MonkeyLoader/index.html
GNU Lesser General Public License v3.0
11 stars 3 forks source link
config configuration games harmony logging mod mod-loader modding modloader mods monkeyloader mono nuget unity

MonkeyLoader

A convenience and extendability focused mod loader using NuGet packages.

Online Documentation is here.

Quick Links

Resonite Game Pack

ResoniteModLoader Game Pack

What's this?

MonkeyLoader is a mod loader that aims to combine easy usability for developers and users, while also offering a feature rich platform. It started with me wanting to use the break in mod compatibility, caused by the release of Resonite, to develop something with support for pre-patching (modifying assemblies before they're loaded), without relying on the game's plugin system, and with a focus on improving dependency resolution.

To start with this, I asked other active developers in the general modding community, what they would like to see as features in a new mod loader. It became clear, that main requests were:

Using NuGet packages (.nupkg) files to distribute and load mods from came as a natural conclusion from the last two points. As fancy zip files, they make it easy to bundle assets (like debug symbols, 3D models, textures, ...) for the mod into one file, without creating an enormous and opaque DLL file. Further, they include metadata that can be read without having to load the DLLs, which allows checking whether all dependencies are available and otherwise restoring them. For mod distribution and dependency resolution, custom NuGet feeds can be used: Mod authors can have their own feeds for mods, and community groups could set up feeds for "vetted" builds as well. Other general libraries can be loaded from custom feeds or the general nuget.org one too.

Features

Below you can find an overview of the (planned) features. Help is always wanted and appreciated, feel free to ask here, or on Telegram or Discord.

How it Works

This is the order of operations that MonkeyLoader executes on startup:

After that, the game can proceed with its initialization and startup. GamePacks may provide extra hooks for patchers that need some things to already be set up. For example the Unity pack ads a hook for patching after the first scene has been loaded - otherwise, the dynamic binding of Unity engine methods fails and everything breaks.

Creating a Mod

Someone from the Resonite community has created a Template, which covers both the regular RML and MonkeyLoader.

Otherwise, the general steps are:

For more detail, you can take a look into the Resonite.Integration for now. I will update this readme with an actual MVP eventually and link to other examples.