Home Artists Posts Import Register

Content

Well it's been a quiet few weeks in the Wabbajack world as we've been waiting for the dust to settle post-nexus-archive-changes. In the mean time I've been looking at our code base, and decided enough was enough it's time for a code cleanup.

This makes a bit more sense if we look at it from the perspective of some of the changes the code has been through over the past two years. I started Wabbajack at what could be considered one of the worst times to start an app in the .NET world. Two years ago the community was split into roughly two camps: users of .NET Framework, and users of .NET Core. Due to the better documentation and support for UI toolkits like WPF at the time I decided to write Wabbajack on .NET framework 4.5. And then I built an app the way I was used to writing code at my day job...with threads (they use a lot of memory), and little regard for memory usage. Heck some of the servers I code on at my IRL job have 72 cores and 720GB of RAM. So some things like using async code everywhere was rather low on my list.

The first major change came when we added a better WPF UI and Noggog pulled me aside and explained how we *really* needed to use async code everywhere or we'd be running against the grain of how .NET development worked. He was right so I refactored a lot of the code to be async. That was major change #1.

Shortly after we found out that .NET Framework was being deprecated and most people should be moving to .NET Core 3. So we hacked a few things and got it working on .NET 3. That was major change #2.

Not too long later .NET 4 came out and with it was an increased focus on making code cross platform. Non-GUI apps could actually run on Linux! Too bad our entire app was so entrenched in Windows that there was no chance of that happening. But we moved to .NET 4, and that was major change #3. .NET 5 came a bit later, and we changed nothing, just moved to it directly.

And that's where we are today on a hacked together codebase that works well but needs a lot of love before we're can start taking advantage of the latest and greatest features of .NET.

Another major complaint is how badly we need to remake the main website at https://wabbajack.org. One issue with that site is that it's written in TypeScript because C# doesn't run in the browser (more on that in a bit). So things tend to break because both code bases don't always agree on what the data should look like.

Well and then the Steam Deck came out, and I have a problem where when I see cool hardware I want to justify buying it...wouldn't it be sweet if we could get Wabbajack on a Steam Deck?

So 3 weeks ago I said "enough is enough" and started giving Wabbajack the love it needed. More correctly I create a new source repository, and have been rewriting the entire app in .NET 6 and writing it the way the gods intended. This is bigger than a basic refactor, but smaller than a clean-code rewrite. I start with one part of the project, rethink how it should be written based on modern .NET coding standards, and then copy over the code and massage it until it works, implementing tests as I go. As of today I've gotten all the way up to the installer, and it can load and start installing a modlist (it quickly fails because I only have a few of the downloaders implemented, but we're getting there).

This new codebase, dubbed wabbajack-redux or Wabbajack 3.0 has the following major features: 100% cross-platform. Currently all the tests are executed on Linux, OSX and Windows. I've also broken the code into several modules that can be mixed-and-matched. It's possible to create a Wabbajack installer, without a compiler. It's possible to load Wabbajack modlists into memory for analysis with only about 100KB of code, instead of pulling in all of CEF (120MB of code). The code makes heavy use of Dependency Injection, which is just a way of saying that each module doesn't care about other modules. A module can say "I need something from the internet" and it doesn't have to care about how to do network retries, or how many threads to use, all of that can be "injected" into the code from another part of the app.

Because the code is now cross platform, we can target Blazor in addition to Linux and OSX meaning that we can run parts of Wabbajack in the browser. I'm not sure how far we'll take this, but it will at least allow us to write our main website in C# and to have a browser based CDN downloader (and uploader).

WPF is kindof-sortof-not-really cross platform, but with .NET 6 (coming out in November) we can start writing Blazor apps for the desktop. Yes...this is somewhat like Electron for C# not the best idea I've ever heard, but there's a lot of weight behind this from Microsoft and it doesn't look completely horrible.

The timeframe for all of this is probably in the order of another month or so. I have the installer mostly working so the guts of Wabbajack are about 50% ported, but we'll need to figure out what we want to do with the UI: stick with WPF or go with Blazor. I'm leaning on the latter but I'm still researching the tech. The UI takes time to develop, but my goal is to have Wabbajack 3.0 completely backwards compatible, so while we're working on 3.0 UI we can continue to have people compiling and using 2.5.

TL;DR - Wabbajack 3.0 should be cross platform where "platform" is: Windows, Linux, OSX and the browser. And we should be able to take parts of the app and make them available on wabbajack.org. Also if you want to write an app that uses Wabbajack it should be much easier to do so

As always thank you for the support, it's been quiet but I've been busy, and I hope to have some cool stuff to show soon. 

Comments

John Barry

Interesting, you keep writing them, I'll keep reading them.

Anonymous

Been using and advocating for Wabbajack for a couple of years now. Rebasing your code to support as many users as possible is great for the modding community. Instantly earned my dollars after reading this. Bethesda game modding was the last siren's call keeping me from ditching Windows entirely. Great work!