Starfield Mod Manager

01-22-2024

Demo

Starfield Mod Manager

When I moved to Linux as my daily driver, I knew I would run into surprise issues with compatibility. One of these issues was applying mods to games like Starfield. Vortex, the mod manager I've long used for Bethesda games, apparently does not have a Linux version.

When I realized that there was not a Linux version of Vortex, I did some scouring to find an alternative. A number of cross platform mod managers existed, but I either struggled to get them to work properly, or disliked their interface. While researching alternatives, I became convinced that I could make a manager myself that while perhaps not better than the alternatives, would at least work more the way that I'd want a mod manager to work.

150 commits later, I have a CLI based, Linux focused mod manager for Starfield that I really like. You can check out the manager and its features at its dedicated website, or the source code.

Making Of

Going in, I understood that the core of a modern manager is to symlink files, while applying priority to one mod's files over another. The other components include downloading and unzipping mods, and managing their files and metadata.

I tested my theories by manually creating some symlinked files and testing that the game recognized them. Then I experimented with the "Download with Vortex" button on Nexus, and learned how to create a desktop entry with an associated xdg-mime default, which meant I could spin up the app straight from the website.

Knowing I could technically accomplish everything, my next big question was what platform to use. I knew I wanted to go CLI, and to use Kotlin. Initially I tried using Kotlin native to directly work with files as an executable in the terminal. While this seemed convenient at the time, I realized I wasn't comfortable enough with the native file interface to move as quickly as I liked, so I transitioned back to using a jar executed from the CLI, with a CLI interface. In the end, while I don't get to up arrow for previous commands within SMM, everything else proved more convenient with this direction.

I used a simplified pattern to my Quest Command game, which allowed every command to be its own, independent model, while still sharing common functions. This worked really well as I was able to quickly develop new commands without running into coupling issues. I started with core commands, things like deploying a mod, or adding a mod folder. Then I worked out from that core adding more complexity, like adding from a zip or an 7zip archive etc. After I felt feature complete, I used (and continue to use) the mod, and iterated on more convenience functions and aliases.

As I neared feature complete, I started working on a showcase website, and have since iterated on it as well. I used my now go-to setup for website building: a Kotlin app that uses KotlinJs and the Kotlin html builder, to quickly build out what I wanted without fussing with a web framework. I started with a site that was more consolidated, but after feedback evolved it to have a very simple landing page with a demo and concise description, and then a full features page that demoed each of the main features. I also split out the setup page and a manual page (the manual page is actually generated from the in-app help command).

Coincidentally, as I was working on the mod manager, I stumbled upon Asciinema, an incredibly neat terminal recorder. This was the perfect tool to demo my app, as it records terminal input and output and encodes it into a playable (and hand editable) json file that uses a straightforward js library to replay. You can even copy paste text from it! While my self imposed no js rule means I can't show non-gif demos here in the blog, the features page of the site has plenty of demos using Asciinema.

Closing

While it's not at all popular on the Nexus, I personally love the tool, and enjoy using it more than Vortex now. I'm proud of the quality of the tool and it's dedicated website. For me there is something really sweet to having built my own mod manager. On the one hand, there is a satisfaction to programming my own mod manager, after using other people's mods and modding is what got me into programming. On the other hand, for me the joy of modding is really tweaking and customizing a game to your own preferences; creating a mod manager feels recursive in that way. I've now modded my mod tools.