Drakulix / ScrollsModLoader

A Mod Loader Framework for the game "Scrolls" by Mojang
www.scrollsguide.com/summoner
GNU Lesser General Public License v2.1
15 stars 9 forks source link

Converting to UnityModLoader #20

Open daemuth opened 7 years ago

daemuth commented 7 years ago

Hey there,

as discussed previously, I would like to expand this project so it can be used with a variety of games, as you yourself mentioned here a couple of years ago.

After taking a look at the code, I think I understand the principles on how it works. The good news is that a lot of things are independent of Scrolls, but there are some things that need to be changed, and some things need to be able to adapt on a per-game basis.

My thinking (sys-design wise) goes along the lines of:

1) Create a repo of game-specific repositories. Along every mod a game-specific descriptor is downloaded from the repo that is updated just like any other mod. This descriptor file describes how and where the mods should hook.

2) Instead of handling each mod in-game, create a GUI that allows the installation / uninstallation / update of mods, independently of games. This does not exclude the fact that modders can create a GUI for their mods, but lowers the entry requirements.

To achieve this, the patcher functions need to be de-coupled (Patch.cs and descendants), and the in-game gui relevant parts need to be removed.

This is what I have so far, I'm currently planning out how I can achieve this, and whether it's worth the effort, as it sounds like it's going to take a while if I want to get it done properly.

What do you think? Have I missed something?

Thank you for your help!

MaPePeR commented 7 years ago

Not sure if descriptor files for defining the hooks are a good thing. And i don't really see a reason to have a repo for them.

The only thing that is game-specific - if i remember correctly - is the "Entry-Point" that initializes the mods. It should be possible to find a more generic entrypoint.

your second point is a good idea. i planned this, actually, but never had the time to implement it.

Another thing that might be needed for "very generic" games would be the possibility for mods to add their own Patches, so they can modify the game beyond hooks into methods. (This might be needed for performance reasons at some places - but will cause nasty incompatibilities between mods)

Drakulix commented 7 years ago

1) I do not think we should have game specific repos. I think the modloader should be converted into a library that can easily initialized for any unity assembly dlls and user provided hook-methods (assuming we dont find anything more generic, than a random menu init function). That way anybody can quickly build a mod loader for his favorite unity game and provide its own patches and infrastructure. This project would become some kind of framework for modloaders.

2) Following the previous idea, I do not think the gui should be part of the core library. It should be a seperate optional library which can be used to provide a basic gui, until an in-game gui is established.