Comment by mfinelli
18 hours ago
Re: modding with MO2/vortex I had a similar problem in that installing them on linux isn't super straightforward, and then once I did get them installed when I launched the game through them like I used to do on windows the performance was abysmal. I decided to tackle the problem myself and so I wrote this: https://github.com/mfinelli/modctl. It's a mod manager that I wrote specifically for linux. It's not really ready for primetime yet, but if you're willing to experiment depending on your needs it might work for you. The repo might look like work has slowed down, which I guess is true but that's mostly because I implemented all of the main stuff that I wanted to and now I've just been using it instead of building it for the past few weeks though there are still a few rough edges and a couple of bugs that I need to sort out (but nothing game breaking that I've found yet).
Have you considered using OverlayFS[1] instead of installing all files into the game directory and tracking them with a database? Or maybe what GNU Stow is doing where it installs each package into its own directory and then uses symlinks which it tracks to "install" the files into the global file hierarchy?
[1] https://en.wikipedia.org/wiki/OverlayFS
[2] https://www.gnu.org/software/stow/
Ooh overlayfs is quite interesting. I'll have to take a closer look at that. I imagine it's similar to what MO2 was doing on windows with the virtual filesytem to keep the game directory clean.
The stow approach is something that I considered but ultimately rejected for a couple of reasons around handling conflicts of game-installed files as well as how to ultimately handle the symlink lifecycle (eg wrapper to make the "non-running" state always clean or to let it always persist and then need to run manual cleanup/update steps). But if you're interested in that approach when I was applying for Nexus Mods approval I discovered https://github.com/Marc1326/Anvil-Organizer in the overall list of mod tools which I believe uses that strategy (though I haven't really looked too closely)
But basically my original idea to just install the files directly into the game directory stems from the fact that when I switched to linux for gaming and not having success with MO2 that's literally what I was doing. I would download the mod from nexus and unzip/tar it into the game directory manually. When I wanted to uninstall or update I'd find the original archive list the files in it and then delete them from my game directory. After doing this too much I realized that I was basically missing the functionality of a standard linux package manager (eg apt, pacman, etc)
Keep in mind that overlay file systems are designed to treat the lower layer as read only. Changes made in the merged view are written to the upper layer while the original lower files are untouched.
So if you need to persist changes into the lower layers, I think you may need to do tricks like taking snapshots and then swapping the bind mount (maybe with some diffing logic) or some other offline methods.
Interesting! I was modding Fallout New Vegas and 4 if that adds context, what did you have issues with? All the same happy to bookmark it, might play with it at some point, thanks!
I've really only tested it with Cyberpunk 2077 (and a bit of WH40K rogue trader). The issues (so far) are with tangential features. For example it's possible to define rules when you extract files (eg the mod author sticks them in a subdirectory or something you can have the tool automatically strip that leading directory) the "preview" feature to see how to rules affect the files before extraction isn't working as expected. But the main loop of create a profile for the game, add/remove mods to it, and have it spit them out into your game directory works without issue.
I should add that it's a CLI tool only (I may add a TUI later but it probably won't ever have a GUI if that matters). Anyway if you check it out and have any feedback whether positive or negative that would be cool
It's funny you say that, I've been considering another run through of 2077 and some mods would give it a fresh coat of paint... :think:
I know that running Vortex is a pain but I never ran into any problems once it was installed. I did this back in 2022.
I don't want to discourage you, but what's wrong with helping MO2 and Vortex get ported to Linux?
Vortex at one time did have a native Linux version. IIRC, it had very minimal game support, lagged behind the main branch, and was eventually canceled. I don't think they're interested in contributions for native Linux. A separate app seeking to implement Vortex API and package support would potentially be more free to improve the UX, do Flatpak/Appimage, or use more interesting Linux features like overlayfs and FUSE archive mounting. I have a mind to try my hand at it, would be a good starter project for a new language.
MO2 works fine on Linux! It’s a bit slow to start but I found it very usable, a bit less polished than Vortex maybe but it absolutely gets the job done and I got my head around it inside of an hour.