soulsmods / ModEngine2

Runtime injection library for modding Souls games. WIP
MIT License
877 stars 158 forks source link

Multiple mod param merging #38

Open Madouura opened 2 years ago

Madouura commented 2 years ago

For mods that affect the same files, while loading both, check the difference and if they don't overwrite the same lines/data, diff the mods and merge them either into the first listed, or into a copy of the original file. Of course, if there are conflicts, prefer the first listed mod instead and perhaps show a warning.

Madouura commented 2 years ago

For binary or otherwise non-text files, perhaps something like xdelta for diff and merging.

garyttierney commented 2 years ago

I'm not sure if I want to do this at runtime inside modengine2.dll, but this is something I definitely want to be part of at least the pre-launch stage (either part of the GUI or launcher).

xdelta was my preferred approach for distributing mod updates, though I'm not sure it'd help with merging here (i.e., adding a new entry to a binary file is going to break all subsequent deltas from other mods). I expect for all the game data types we want to support we'll have to write a reader/writer and diff producer.

There's quite a few data formats to handle but deep-merging archives and PARAM files seems like a good start. Getting the infrastructure in place to support "mod merging" for the end-user is likely the biggest challenge, though.

nozwock commented 11 months ago

How about using DSMapStudio's exported param csv files for now? It would make different param mods compatible.