Configuration Option to Override Plugin's Generated Config Name #227
Replies: 4 comments
-
Hello! The plugins files you're talking about currently use the default config file provided by BepInEx to developers, which uses their plugins GUID (that string starting with The main problem I see is: As for the second problem you describe, I've never seen that personally. Even my own copy of the example you give doesn't seem to display the same behavior, but it's quite possible there's an issue somewhere there. You mentioned Valheim in your other issue, so I'll assume that's the main game your playing. On your end I would suggest possibly using a mod manager such as r2modman if that's an option, it provides a search for config files and will manage everything for you. |
Beta Was this translation helpful? Give feedback.
-
I'm going to add to what Windows10CE mentioned in relation to file naming. As he pointed out, the The reason for using GUIDs is because all other metadata is not unique. For instance, you can have two plugins, say // In Foo.dll
[BepInPlugin("org.plugin.foo", "Foo Plugin", "1.0.0")]
public class Plugin : BaseUnityPlugin {}
// In Bar.dll
[BepInPlugin("org.plugin.bar", "BarPlugin", "1.0.0")]
public class Plugin : BaseUnityPlugin {} This means that you cannot name the config file In addition, even DLL filenames are not unique! BepInEx allows you to put each plugin in a subfolder inside
i.e. there is Depending on mono runtime version shipped with the game, assembly version and internal assembly name, this can be allowed and can be loaded fine by BepInEx. In that case again, naming your config All in all, GUIDs are always unique. BepInEx will never load plugins with the same GUIDs at the same time. The best option I see is to allow plugin developers to rename their plugin files. This can be done by making All in all, I shall repeat what Windows10CE mentioned: consider using Configuration Manager or r2modman for config management if you don't feel like editing files manually. I'll keep the issue open for a little while if you have alternative suggestions on the matter on how to obtain more ""readable"" automatically generated plugin config names that are also unique. |
Beta Was this translation helpful? Give feedback.
-
@Windows10CE Thanks to your screenshot, I've determined the "issue" with the linebreaks.... It's because for simple cfg files I don't bother to fire up Notepad++ and let Windows Notepad handle it. However, seems that even though the file is encoded to "Dos/Windows" and is UTF-8, that M$'s Notepad just wants to be... difficult/obnoxious/a troll? lol As for using a Mod Manager, I probably would have (and do use FOMM for Fallout series games), but then I saw how painfully simple/easy they were to install on Unity so it seemed pointless. I do use the ConfigManager and that greatly helps, but sometimes I just get that urge to edit the actual file before loading or after exiting (having forgot to modify it before quitting), due to that some settings inherently require a restart for the changes to be reflected -- generally rendering related stuff. (Unless there's a "vidrestart" console command I can use to force changes??) In terms of your points with the actual request... Migration of configs already generated before the use of this option, to me once more seems straight forward: internally Bep could start writing in an identifier. Frankly, most of the plugins I have seem to do this already. A few examples:
I included the last one because this is that person's first mod ever, and it includes the GUID in the config. EXAMPLE: In comes the points made by @ghorsington [a] Failover to the config file being named As far as I understand it, in your example, the only issue being when it would come down to the filenames, even if internally everything matched. Even in the case of there being multiple packages inside a single DLL, it still sounds like there would be an internal name to differentiate each config. All we'd need to do is append the Plugin's Filename to the beginning of the Config's Filename. . The long and short of my request basically boils down to that there are situations where the mod maker will not have the knowledge to adhere to proper coding convention, or may not even consider whether or not what they've entered makes it easy for others to pick out the configs. :) If this really is way too much hassle than it's worth, I suppose I could always do what just came to me (although it'd be continuous legwork I'd have to do every mod), whereby I have a folder in Bepinex called "configs" (plural), and then I make Shortcuts to every config file, and manually rename those to be organized in more me-friendly system. Thanks for hearing me out, sorry for rambling! heh |
Beta Was this translation helpful? Give feedback.
-
In-file identifies are not reliable since they are not mandated to be in there. The reason they were added in the first place was to the human-readable metadata for end-users, not tools. Moreover, with BepInEx 6 being in planning to allow plugins to swap the config file format (i.e. they can write all their configs as JSON if a plugin developer so chooses), the identifier will not be consistent.
The issue is less about just plugin placement but the fact that all plugin metadata (type name, assembly name, folder placement) except the GUID is not designed to be immutable. There are reasons for why each of them can be changed between plugin versions or between end-users. All of this can manifest in the examples I outlined above, but it is not an exhaustive list. No matter how you name the plugin, if you add possibly mutable metadata to the name, you'd have to be able to handle migrations like @Windows10CE mentioned. In that case we end up back to issues I outlined earlier. All in all, it seems to be that allowing developers to explicitly rename the default plugin configuration file in code seems best here. In that case the name is hardcoded into the plugin and the developer has to handle name migrations if there is a need. Whatever the solution, I'm moving this discussion from an issue ticket to a Discussions thread. |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
It's a huuuge pain in the asterisks to sort through the config files and try to pair them up to the mod they belong to, when the mod author opt not to change/define a name.... Having to scroll up and down a few times to figure out what the config file's name is.
Here's a friendly face we can use as an example, to not call out a mod author directly... lol
com.bepis.bepinex.configurationmanager.cfg
Granted, it's slightly better formatted than some I've come across, but, the fact that the actual mod/plugin file is called
ConfigurationManager.dll
, one intuitively looks forConfigurationManager.cfg
Describe the solution you'd like
Simply an override in the intuitively named
BepInEx.cfg
that will automatically rename the config file by the plugin that's creating it, to whatever the plugin's filename is (respecting whitespace and upper/lowercasing).Therefore,
ConfigurationManager.dll
will now produceConfigurationManager.cfg
.Something to the tune of this perhaps?
(alternative name: PluginMatchesConfig, NameMatchedFiles, MakeMyLifeEasier, NoMasochisticTendencies, ICanHazSanity
[false = NoThnx; true = YasPl0x]
)Describe alternatives you've considered
Reaching out to every single mod author to ask them to do whatever it is they need to do (since I don't know, myself), to have their config files generate with the same name as their mod's DLL.
Additional context
BONUS ROUND! Maybe also have it automagically plop additional twined-octothorpes (hashtags, if you rather) entries on a new line in the config, similar to how I did it in the above example. (this might be a bug, I don't really have a clue! )
Currently some configs of mods I have for Valheim, they display like this (albeit rare; although, the aforementioned config manager does! lol):
Whereas one would expect it'd be formatted....
Beta Was this translation helpful? Give feedback.
All reactions