techiew / EldenRingMods

A collection of mods I've made for Elden Ring.
MIT License
174 stars 25 forks source link

[REQUEST] Compile regulation.bin on launch using CSV files exported from Yapped #10

Open God-damnit-all opened 2 years ago

God-damnit-all commented 2 years ago

A lot of mods rely on changing regulation.bin to do what they do. Right now, people are uploading CSV files made with Yapped that people can merge into their own regulation.bin, so I was thinking, why not perform merges at runtime based on the CSV files?

My thinking for a structure is like:

Game
└───mods
    │   RegulationMerger.dll
    │
    └───RegulationMerger
        │   config.ini
        │   load.txt
        │   log.txt
        │   regulation.bin.bak
        │
        ├───Apples
        │       ActionButtonParam.csv
        │
        ├───Bananas
        │       AiSoundParam.csv
        │
        └───Cantaloupe
                ActionButtonParam.csv

Multiple CSVs that target the same param could be made compatible this way so long as they don't change the same fields. Perhaps, by default, it could keep the game from launching and notify the user there's a conflict - and that they can change the INI file to allow conflicts to overwrite (which would be based on the alphanumerical order of the folders).

As an additional safety mechanism, it could perform a pseudo-version check by keeping a backup of the last regulation.bin file found in the root Game folder (I included this in the tree as regulation.bin.bak). If it's different from last launch, it keeps the game from launching while informing the user that they should check to see if their CSV files are up-to-date, and to launch again once they're confident that the files are current. This warning could be disabled in the config file, though the result of the "version check" would still be written to a log file.

Sadly, there doesn't seem to be a better way to do this, as the game version and regulation version can differ, and the regulation file doesn't have its version written anywhere. Alternatively, Instead of backing up the regulation.bin file you could keep a record of the checksum.