FujiAPI / Fuji

Celeste 64 Mod Loader
30 stars 10 forks source link

Add runtime patching support #21

Closed psyGamer closed 7 months ago

psyGamer commented 7 months ago

Runtime patching is pretty core part for code-modding, when you don't have source access (Fuji does, but mods don't).

I propose using MonoMod for this, since that's also what Everest uses and I assume most code modders would come from modding the base game. We thick we only need MonoMod.RuntimeDetours since we don't need to patch a precompiled assembly, but I'm not sure if that's missing something.

There's also already a "reference" implementation inside Celeste64-TAS

jasminegamedev commented 7 months ago

-Note, when we implement this, we should make sure to support a way for hooks to easily work with enabling and disabling mods. (i.e. when you disable a mod, its hooks should be cleared away.)

jasminegamedev commented 7 months ago

This should be somewhat possible now that monomod has been added in https://github.com/FujiAPI/Fuji/commit/6533d9a18dcb12ae54ddceac1489e6c43a64528c Recommended to use the hookmanager set up in https://github.com/FujiAPI/Fuji/commit/c5d4a64879279588be79a6ebfad571be8ecdd3f5 for proper support with enabling and disabling mods I'll say it's still kind of experimental for now, but we'll watch and see if people run into issues with it. So closing this for now, and we can reopen if this needs more follow up.