~hristoast/hristoast

hristoast/site/blog/fallout-3-on-linux-with-mods.html -rw-r--r-- 30.2 KiB
6eea07f6Hristos N. Triantafillou The new URL a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
<h1 id="title">Fallout 3 On Linux With Mods</h1>

<div id="dates">
  <span>Posted: <time id="post-date">2021-07-05</time></span>
</div>

<p id="post-excerpt">
  A while back, I did a post on playing <a href="https://hristos.co/blog/fallout-new-vegas-on-linux-with-dxvk/">Fallout New Vegas on Linux with DXVK</a>. The goal with that was to play the game, but also mod it and do the entire process on Linux. Unfortunately, at the time it wasn't doable but I had hopes that with a little effort it would be. So has anything changed? Yes! But it is quite a long journey. Read on for the details.
</p>

<div id="toc"></div>

<h3>
  Why Fallout 3?
</h3>

<p>
  You might be wondering "why is this guy writing about games", or "why is he writing about <span class="italics">that</span> game". Indeed if I'm going to choose favorites New Vegas wins by a huge margin. But there's something about the world of Fallout 3 that is irresistable. Not to mention seeing Washington D.C. in ruins is... an experience that's hard to describe. <span class="footnote"> I can <a href="/i/fo3-2021-01.png">show it to you</a>, but even then it's not quite the same as being "there", "in" that world.</span>
</p>

<p>
  Aside from all that: it's a really fun RPG by Bethesda Softworks and the modding community is still quite active. I should also note that playing Fallout 3 on its own, without mods, is a relatively trivial affair. The game works exceptionally well via Wine, so it's a good base to do something like modding on top of.
</p>

<h3>
  Why Linux?
</h3>

<p>
  Once again, I feel the need to clarify why I'd care to try and game on Linux. The long and short of it is: I don't want to use MS Windows. If I don't want to, and it's possible to not use it, why would I?
</p>

<p>
  It comes down to personal preference; some folks might like using Linux, but they don't like the idea of doing extra work to play games. That's fair, because often times extra work will indeed be required to get things just right (more on that in a bit).
</p>

<h3>
  Why Mods?
</h3>

<p>
  Playing Fallout 3 on Linux without mods is a pretty simple process, and no special tricks are needed to get the game working. Install it, and run it. Even on Windows, using mods adds extra time and effort required to game, as well as complexity into the overall setup. So why bother with mods if it creates extra work?
</p>

<p>
  Most mainstream games are released with bugs, and are possibly unfinished. Large amounts of content is cut from some games, and in others it is unseeable due to bugs. <span class="footnote"> Normally, I'd provide a source for a claim like this, but it's less work for me and better for you the reader to do a quick search for "unfinished games" or "rushed games" and go from there.</span> Fallout 3 is no exception. <span class="footnote"> Same here as with the last footnote. I'd give proof but, well it is as they say in the pudding. Play enough of the stock game and you'll see what I mean.</span> Additionally, this game had to run on a PS3, and unfortunately even the PC version shows the effects of this with restrained visuals.
</p>

<p>
  Mods allow for not only fixing leftover bugs and performance issues, but also for upping the visual quality in ways that isn't just "add HD textures". It's possible to use only a few mods and vastly improve the game, and this is what I aim to do.
</p>

<h3>
  No Mods, No Managers
</h3>

<p>
  Of course I'm using mods as stated in the post title, but I will not be using any kind of mod manager software. I'm personally not a fan of any in existence (except <a href="https://gitlab.com/portmod/portmod/-/wikis/Getting-Started">Portmod</a>), because they tend to cause more problems than they help with. <span class="footnote"> I couldn't resist making the heading title sound like Choking Victim's "No Gods, No Managers", which itself is a spin on the old slogan "No Gods, No Masters". Please don't hate me for trying to be clever.</span>
</p>

<p>
  For instance: in my last adventure with trying to mod Fallout New Vegas, I struggled to get LODGen to work properly because it has no notion of the Mod Organizer 2 VFS. It's possible to make it work, but it requires more effort than just running the thing as designed.
</p>

<p>
  That's just one anecdotal problem. Suffice it to say that although in my view skipping mod managers will cause you some extra work, in the end you'll have greater control over your setup, more stability, and an easier time working with external tools.
</p>

<p>
  But if I'm not using a mod manager, how do I do it all correctly and keep my sanity?
</p>

<h3>My Machine</h3>

<p>
  I'll just say a little bit about my general setup:
</p>

<ul>
  <li>CPU: AMD Ryzen 5 1600</li>
  <li>GPU: Gigabyte RX 5700XT</li>
  <li>RAM: 32GB</li>
  <li>Storage: A Samsung SATA2 SSD</li>
  <li>OS: Void Linux, with <a href="/xbps/linux-tkg/">my custom kernel package</a></li>
  <li>Display: An old 41 inch Sony TV (1080p)</li>
</ul>

<h3>The Setup</h3>

<p>
  I'm taking a cue from OpenMW's data paths system; this allows one to tell the engine to use multiple data paths, which is a godsend for mods. The idea (with OpenMW) is, I can configure (in a plain text cfg file) all the data paths I need, one for each mod, and the engine resolves them all and merges them into a VFS.
</p>

<p>
  I won't be working with a VFS, but I'll be creating something like a VFS by hand. The high-level process will be like this:
</p>

<ol>
  <li>Install <a href="https://www.gog.com/game/fallout_3_game_of_the_year_edition">Fallout 3 GOTY from gog.com</a> with Wine.</li>
  <li>Select the mods I want to use.</li>
  <li>Give them a rough, logical order and put each one into its own directory.</li>
  <li>Extract each mod into their own directory (the one you assigned in the previous step).</li>
  <li>Ensure all files are lowercase (more on this later).</li>
  <li>Create another directory for the merged content.</li>
  <li>One by one, and in order, copy the data files from each mod into your merged directory.</li>
  <li>Copy the complete merged directory over the base game data files.</li>
  <li>Run the Fallout 3 Launcher, enable all plugins.</li>
  <li>Run LOOT, sort plugins.</li>
  <li>Run LODGen, generate better/more LOD (distant stuff that is lower quality than the up close version).</li>
  <li>Work around problems with the game's MP3 files (used by the radio stations).</li>
  <li>Play the game!</li>
</ol>

<p>
  I've glossed over a lot, so let's go into each point in detail!
</p>

<h3>Install Fallout 3</h3>

<p>
  I've written <a href="https://wem.hristos.co/">WEM</a> as a way to simplify interacting with Wine for complex game setups, and I'll be using WEM commands and configurations in this post.
</p>

<p>
  With WEM, getting started looks something like this:
</p>

<pre><code class="language-sh">$ wem init fallout3 \
    --dxvk-version 1.8.1 \
    --fsync \
    --install-exe \$HOME/games/setup_fallout_3_1.7.0.3_(12034).exe \
    --install-expected "{{.WinePrefix}}/drive_c/game/Fallout3.exe" \
    --install-workdir \$HOME/games \
    --quiet-run \
    --run-exe 'C:\\game\\fose_loader.exe' \
    --run-workdir "{{.WinePrefix}}/drive_c/game" \
    --wine-exe \$HOME/.local/share/wem/proton/Proton-6.10-GE-1/files/bin/wine</code></pre>

<p>
  Breaking this down: I'm defining a Wine "env" with specific options for DXVK, fsync/futex2, Proton, and various paths. The result is that future interactions with the env will involve little more than a <code>wem run fallout3</code>. Note that I've got the installer files in the <code>$HOME/games</code> directory.
</p>

<p>
  With the env initialized, the install can now happen but we don't want to run the game just yet:
</p>

<pre><code>$ wem install fallout3</code></pre>

<p>
  This will kick off the install process. Make sure the install directory is set to <code>C:\game</code> (this is a pattern I do for every Wine game install).
</p>

<div class="center">
  <a href="/i/fo3-2021-02-full.png"><img title="A picture of the GOG installer with the game install path set as required, click for a full-size image." src="/i/fo3-2021-02.png" /></a>
</div>

<h3>Selecting Mods</h3>

<p>
  This is always subjective, but I prefer to go with a smaller mod list for these games (Fallout 3/New Vegas). When you consider they are notoriously buggy and crash-prone even on Windows, mods begin to sound risky when you're looking for a game that runs and doesn't crash. <span class="footnote"> If/when these games are implemented for OpenMW, I wouldn't worry at all because that engine is free software and highly stable. In that case, feel free to run 300 mods and enjoy yourself!</span>
</p>

<p>
  As such, I prefer to keep my mod list relatively short and only add things that I think will really enhance the experience. As I said, this is subjective, but here's a rundown of what I'm using for this project (note that they are presented in the install order that I used):
</p>

<ul>
  <li><a href="https://www.nexusmods.com/fallout3/mods/944">ArchiveInvalidation Invalidated</a>: In a nutshell, this one enables other mods to work (by working around silly engine quirks). This one has unique install steps, be sure to check the included HTML document for those details.</li>
  <li><a href="https://www.fose.silverlock.org/">Fallout Script Extender (FOSE)</a>: This is a requirement for the unofficial patch and a few other mods. As the name implies, it extends the game's scripting engine. I used the beta version (v1.3b2).</li>
  <li><a href="https://www.nexusmods.com/fallout3/mods/23682">Command Extender</a>: A required dependency for the unofficial patch.</li>
  <li><a href="https://www.nexusmods.com/fallout3/mods/19122">Updated Unofficial Fallout 3 Patch</a>: This one fixes many of the numerous bugs left in the final released and patched game. If you only use one mod, it should probably be this (and the dependencies, of course).</li>
  <li><a href="https://www.nexusmods.com/fallout3/mods/6938">RH_IronSights - FOSE</a>: Adds ironsights aiming to the game, to replace the weak zoom you get by default. Note that this doesn't magically make the game's shooting what you'd expect from a "real" FPS, but it does potentially help.</li>
  <li><a href="https://www.nexusmods.com/fallout3/mods/20183/">Fallout 3 - Enhanced Camera</a>: Gives your first person perspective a body, so when you look down you see your legs and whatnot.</li>
  <li><a href="https://www.nexusmods.com/fallout3/mods/3729">CASM</a>: Periodic auto-saving. If the game wasn't so prone to crashing you might not need this, but even if you think you don't need it, you actually do. This is because you will be burned by a crash sooner or later, and you don't want to lose a bunch of progress because you didn't think to save.</li>
  <li><a href="https://www.nexusmods.com/fallout3/mods/1854">Sprint Mod</a>: Adds a sprint mechanic to the game, similar to what's in Skyrim.</li>
  <li><a href="https://www.nexusmods.com/fallout3/mods/9592">Underground Hideout</a>: This is a player home mod; you don't necessarily need this one or any other player home mod, but there's something neat about them. Skip or replace this as desired.</li>
  <li><a href="https://www.nexusmods.com/fallout3/mods/626">Better Booze</a>: Give alcoholic beverages a nicer look, optionally with real-world brands.</li>
  <li><a href="https://www.nexusmods.com/fallout3/mods/3876">Better HiRes Skill Books</a>: Replaces skill book items with much higher quality versions that look great.</li>
  <li><a href="https://www.nexusmods.com/fallout3/mods/3679">Better PreWar and Burned Books</a>: Same as above, but with non-usable book items.</li>
  <li><a href="https://www.nexusmods.com/fallout3/mods/15960/">Chems and Meds Re-Texture Pack</a>: Replacers for the chems, giving them more vibrant colors which in my opinion make them look nicer.</li>
  <li><a href="https://www.nexusmods.com/fallout3/mods/101">Enhanced Blood Textures v2_22b</a>: What it says on the tin, but it is indeed much nicer than the default texture.</li>
  <li><a href="https://www.nexusmods.com/fallout3/mods/19931">Fallout 3 Hirezd</a>: High resolution replacements of many things, including weapons and creatures.</li>
  <li><a href="https://www.nexusmods.com/fallout3/mods/14946">GNR Enhanced</a>: If I only used two mods, it'd be the Updated Unofficial Fallout 3 Patch and this one. It tastefully extends the catalogue of Galaxy News Radio and I absolutely love it. It's a big download, so if you don't use the radio (which is actually a great gameplay choice, the game is much creepier without it) you can skip this. You will have to massage the MP3 files in order for them to work (that includes the files the game ships with, I'll explain that later on).</li>
  <li><a href="https://www.nexusmods.com/fallout3/mods/20053">HD Smoky Fire and Explosions for FO3</a>: You'll be seeing a lot of fire and smoke, best to make it look a bit nicer.</li>
  <li><a href="https://www.nexusmods.com/fallout3/mods/12056/">NMCs_Texture_Pack_for_FO3</a>: Very high-quality texture replacements for a large amount of the game's assets. In my opinion, they look fantastic and you need this.</li>
  <li><a href="https://www.nexusmods.com/fallout3/mods/20373">PipBoy 3000 HD Retexture</a>: You'll potentially look at this thing a lot while playing, so make it look a bit better as well.</li>
  <li><a href="https://www.nexusmods.com/fallout3/mods/9250">Realistic Interior Lighting</a>: This one makes interiors really dark. As the name of the mod implies (hey, you can't always go on that in the mod world), it in my opinion seems to be a relatively realistic level of lighting. Makes subways very creepy.</li>
  <li><a href="https://www.nexusmods.com/fallout3/mods/866">Terrain_Pack_ROCKS_ADD_ON_PACK</a>: Very high resolution rock textures; I'm using the 8K version.</li>
  <li><a href="https://www.nexusmods.com/fallout3/mods/8260">https://www.nexusmods.com/fallout3/mods/8260</a>: Give the UFO DLC a facelift to go along with what NMC and others have provided.</li>
  <li><a href="https://www.nexusmods.com/fallout3/mods/591">Whats Your Brand - cigarette texture megapack</a>: Give the cigarette packages high quality textures based on real world brands. I went with Camel because that's what I used to smoke <span class="footnote"> I'd honestly be okay with having a smoke now and then, but it's hard to find good tobacco. I'm not really down to smoke Camels or any other store brand nowadays.</span>.</li>
  <li><a href="https://www.nexusmods.com/fallout3/mods/21174/">LODGen</a>: This one generates better and more distant objects. It comes with a plugin that you need to have enabled while running it, but not while you're playing (more on that later).</span></li>
</ul>

<p>
  One could take it a bit further, but for me personally this is a good amount of mods for various reasons:
</p>

<ul>
  <li>The game engine has stability issues even on Windows.  The more mods you add or textures/meshes you replace the more you increase the overall volatility.</li>
  <li>When you start to get a large list of plugins, the chances of having two or more that modify the same objects is pretty good, and you will require a merged patch to properly resolve this. More on this below.</li>
  <li>It's easy to get carried away and add all kinds of things, but the base game and DLCs have a ton of content, so in my opinion you don't need that much extra content.</li>
</ul>

<p>
  As a reminder: I've installed these in the order that they are listed. I've done that in a scrappy, manual way; by creating numbered directories (e.g. <code>01-ModName</code> and so on) and putting each mod into their own.
</p>

<p>
  This is definitely an area for automation, but there's no capable software to properly do the job at this time.
</p>

<h4>4GB Patch</h4>

<p>
  If you're familiar with the normal rituals of modding a Bethesda game, you may be wondering "why isn't he mentioning the 4GB patch?" - well, the GOG.com version of Fallout 3 ships with this applied so there's no need for me to use it. Thanks GOG.com!
</p>

<h4>Merged Patch</h4>

<p>
  When you have a large number of plugins from mods, there's a good chance that two or more will modify the same object or record in the base game. In this case you'll want to use something like Wrye Bash (there's even a Fallout 3-specific variant) to created a merged patch that safely blends things.
</p>

<p>
  It could be argued that even my relatively small loadout needs a merged patch, and while Wrye Bash works quite well on Linux via Wine (or with the "plain" python build), for now I'm skipping it.
</p>

<p>
  If I wasn't skipping this, the installation and usage patterns would closely resemble the LODGen process (more on that in a bit); the <code>Wrye Bash.exe</code> executable lives next to the game executables and I run it with WEM. <span class="footnote"> At present, there's a limitation with WEM's <code>--exec</code> option that causes executables with spaces in their names to not be ran correctly. The "fix" is to rename them to not have a space in the name, but the long-term approach will be to <a href="https://todo.sr.ht/~hristoast/WEM/31">give WEM an <code>--exec-args</code> option</a>.</span>
</p>

<h3>Extracting Mods</h3>

<p>
  Now that I've got mods downloaded and organized in numbered directories, it's time to extract them. I treat each mod directory as if it was the <code>Fallout 3</code> game dir; that means most things go into a directory called <code>Data</code> in the root of the mod's specific directory. Only FOSE goes in the parent directory of <code>Data</code>, next to the game executables.
</p>

<h3>Lowercase Filenames</h3>

<p>
  On Windows, of course, the filesystem is not case-sensitive. "Thing.esp" and "thing.esp" are the same file for all intents and purposes, whereas on most Linux systems they would be different files. Unless you've gone out of your way to have a case-insensitive filesystem, I think this will probably be an issue.
</p>

<p>
  The approach I've taken is to create a small shell script that finds directories and files in a given path, and renames them to be fully lowercase. This could be pointed at the base directory contaning all your other mod directories and just have everything lowercased, plugins and all. Additionally, you'll want to lowercase the contents of the <code>Fallout 3/Data</code> directory.
</p>

<p>
  There are a few important exceptions: you don't want to lowercase plugins such as <code>bsa</code>, <code>esp</code>, or <code>esm</code> files because of referencing issues. <span class="footnote"> I imagine this wouldn't be an issue on Windows (or if your filesystem is not case-sensitive), but if plugin <code>Foo.esp</code> lists <code>Bar.esm</code> as its master, and you've got <code>bar.esm</code>, there will be a "missing masters" problem.</span> So however you go about lowercasing, take care to not touch your plugins.
</p>

<h3>Merge Data Files</h3>

<p>
  With everything extracted and lowercased, it's time to copy the data files into the merged directory. This is done in a specific order, so you'll always want to overwrite and replace existing files when prompted.
</p>

<h3>Install Mods</h3>

<p>
  Finally, with all mods extracted and lowercased, and the stock game data lowercased, you're ready to paste the merged mod data on top of the the stock game data. There shouldn't be anything that's overwritten, most of the stock game files are packed into <code>bsa</code> archives.
</p>

<h3>Enable Plugins</h3>

<p>
  Next up: run the <code>FalloutLauncher.exe</code> executable and click the "DATA FILES" option. You can do that with WEM like this:
</p>

<pre><code class="language-sh">$ wem run fallout3 --exec "{{.RunWorkDir}}/FalloutLauncher.exe"</code></pre>

<p>
  This will bring up a menu that may render oddly, but all that's needed to be done is check the box next to each plugin. With that done, apply the changes and exit the launcher.
</p>

<h3>Sort Plugins With LOOT</h3>

<p>
  As far as I know, <a href="https://loot.github.io/">LOOT</a> is probably the best tool for sorting your plugin order for almost all Bethesda games. I recently became aware that LOOT now builds and runs on Linux, albeit with somewhat strict requirements.
</p>

<p>
  The LOOT Linux build is somewhat huge, clocking in at around 1.2 GB with a 1.1 GB <code>libcef.so</code> file being the main offender. Anyways, it's for this reason that the LOOT team has decided not to ship Linux binaries, but it is possible to build one's self.
</p>

<h4>Building LOOT</h4>

<p>
  Building LOOT for Linux is possible, but it's not trivial. It has more specific requirements than most things I'm used to dealing with, so to me it made sense to try and use a Docker container for building it. <a href="https://git.sr.ht/~hristoast/build-loot-linux">This repository</a> is the result of that effort, the readme describes how working binaries can be produced as well as how to configure the thing (though, I'll go into detail about configuring below).
</p>

<p>
  In the end, after some effort, I was able to fill a major gap in the Linux workflow for these games. I consider this a big victory, and look forward to poking around in the LOOT source.
</p>

<h4>Running LOOT</h4>

<p>
  More than likely, you won't be able to just run <code>./LOOT</code> and have it work. <span class="footnote"> On my laptop with an Intel GPU, I had to add the <code>--disable-gpu</code> argument for LOOT to launch correctly.</span> I myself have to run it as follows:
</p>

<pre><code class="language-sh">$ cd ~/games/loot-linux
$ LD_LIBRARY_PATH=. ./LOOT</code></pre>

<h4>Configuring LOOT</h4>

<p>
  On Windows, when you run LOOT, it magically sees all your games and just works. You click some buttons, you're done. It's usually pretty easy and convenient.
</p>

<p>
  On Linux, it's not nearly as straightforward but it's also not hard to figure out what's needed. When you first run LOOT, you'll be hit with the settings menu. On the lefthand side at the bottom, click "ADD NEW GAME" and fill in the values as follows:
</p>

<ul>
  <li>Name: <code>Fallout 3 GOTY</code> (or whatever you want to call it)</li>
  <li>Base Game: <code>Fallout3</code></li>
  <li>LOOT Folder: <code>/home/hristos/games/WinePrefixes/fallout3/drive_c/game</code></li>
  <li>Master File: <code>/home/hristos/games/WinePrefixes/fallout3/drive_c/game/Data/Fallout3.esm</code></li>
  <li>Masterlist Repository URL: <code>https://github.com/loot/fallout3</code></li>
  <li>Masterlist Repository branch: <code>v0.15</code> (the default branch as of this writing)</li>
  <li>Install Path: <code>/home/hristos/games/WinePrefixes/fallout3/drive_c/game</code></li>
  <li>Install Path Registry Key: Leave this empty</li>
  <li>Local Data Path: <code>/home/hristos/games/WinePrefixes/fallout3/drive_c/users/steamuser/AppData/Local/Fallout3</code> <span class="footnote"> Note that if you aren't using Proton, <code>steamuser</code> in this path will be your login username.</span></li>
</ul>

<p>
  Most of those should be self-explanatory, but one to note is the "Local Data Path", which is where the <code>plugins.txt</code> file which defines the game load order lives.
</p>

<p>
  When you save your configuration, nothing will happen and you'll get an error when you try and select it from the profile menu at top-center. Close LOOT, re-run it, and you should be greeted with a recognized load order.
</p>

<h4>Sorting With LOOT</h4>

<p>
  Click the download icon at the top right to update master lists, then the button just to the left of that to sort your plugins. You'll be asked to Apply with a button, so do that. The result should look something like this (the below image is just the base game files, and no mods):
</p>

<div class="center">
  <a href="/i/fo3-2021-03-full.png"><img title="A picture of LOOT and a freshly sorted load order, click for a full-size image." src="/i/fo3-2021-03.png" /></a>
</div>

<p>
  Be sure to pay close attention to the notes LOOT gives for your plugins, it's possible there are errors you need to address. <span class="footnote"> LOOT did tell me I was missing several NVSE mods that were dependencies of the unofficial patch, but I definitely have them.</span>
</p>

<h3>Better LOD With LODGen</h3>

<p>
  The default LOD of Fallout 3 is actually pretty sparce. It's easy to not notice it, but once you do it's hard to unsee. Thankfully LODGen makes it easy to fix that situation, even on Linux.
</p>

<h4>Install LODGen</h4>

<p>
  LODGen should have been "installed" with the rest of the mod list above, the exe for it living alongside <code>Fallout3.exe</code> and friends.
</p>

<h4>Running LODGen</h4>

<p>
  When LOOT sorted the load order, it probably disabled the LODGen plugin (<code>FO3LODGen.esp</code>). Manually add that to the <code>plugins.txt</code> file with a text editor before you run LODGen (for me, that lives at <code>$WINEPREFIX/drive_c/users/steamuser/AppData/Local/Fallout3</code>).
</p>

<p>
  WEM makes it easy to run an arbitrary executable with the context of a specific Wine prefix, you can use it to run LODGen like this:
</p>

<pre><code class="language-sh">$ wem run fallout3 --exec "{{.RunWorkDir}}/FO3LODGen.exe"</code></pre>

<p>
  This will launch a GUI that will crunch for a bit while it scans the plugins in your load order. When it's done you'll be prompted with options for generating the LOD.
</p>

<p>
  I select all worldspaces, and I set atlas sizes to 4096x4096 since I'm using a lot of high resolution textures. Click OK to generate and let it work; it takes around ten minutes to finish for me.
</p>

<p>
  Note that the first time I tried to generate LOD, LODGen.exe actually crashed. Against my better judgement I re-ran it with the same options and it worked. Indeed, sometimes LODGen will crash, but re-running it will usually be OK if that happens.
</p>

<p>
  Once that completes, open up <code>plugins.txt</code> one more time and remove <code>FO3LODGen.esp</code> from the list.
</p>

<h3>Fixing Audio</h3>

<p>
  Unfortunately, out of the box there seems to be an issue with the game's MP3 files for the radio tunes. The result is that tracks won't play at all, or they will play for a few seconds then cut off.
</p>

<p>
  There is a way to make them work, but it involves converting the tracks with <code>ffmpeg</code>. <span class="footnote"> I stumbled on <a href="https://old.reddit.com/r/wine_gaming/comments/m2h308/fallout_3_and_new_vegas_finally_got_radio_working/">this /r/wine_gaming post</a> where someone kindly left a clue about how they resolved this.</span> Here's how I did it (fish shell):
</p>

<pre><code class="language-fish">$ cd $WINEPREFIX/drive_c/game/Data/Sounds
$ for file in (find . -type f -iname "*.mp3");
    mv $file $file.orig.mp3; and ffmpeg -i $file.orig.mp3 -codec:a libmp3lame -b:a 64k $file;
end</code></pre>

<p>
  This takes a bit to crunch, and if you aren't using the radio mod I linked above, you'll need to extract the MP3s from the game's related .bsa archive. <span class="footnote"> OpenMW comes with the <code>bsatool</code> executable, which would make this an easy task.</span> But when it's done, the radio tunes should play as expected.
</p>

<h3>Playing The Game</h3>

<p>
  Now, we can finally play the game! The intro sequence is a bit of a bore, but once you embark out into the world all of this work will have been worth it. Run it with WEM like this:
</p>

<pre><code class="language-sh">$ wem run fallout3</code></pre>

<video class="video" src="/v/fallout-3-on-linux-with-mods.mp4" controls></video>

<h4>Stability</h4>

<p>
  You will experience crashes. In about ten hours, I had two or three crashes. As mentioned before, these games are known for instability on Windows, so you can't very well hope for more stability when playing on a totally different OS via a compatibility API. That being said, I'd say the stability is pretty good. I'm able to play the game for long sessions, and I don't need to be paranoid about crashes (even if they do happen from time to time).
</p>

<h3>A Theoretical Mod Manager</h3>

<p>
  I'll take a moment to muse about a theoretical piece of software that'd automate the boring and tedious stuff as much as possible. A short list of features:
</p>

<ul>
  <li>Maybe something that took several "in" directories and copied files into an "out" directory, which would take care of all the manual merging.</li>
  <li>It'd be nice to have the tool handle extraction, but this is absolutely riddled with special cases.</li>
  <li>Renaming/lowercasing files would be a must.</li>
  <li>It'd be nice to see what, if anything, is overwritten by what. Meaning, I'd like to see what conflicts there are between mods.</li>
  <li>The ability to find and edit the game INI files is required.</li>
</ul>

<p>
  There're probably many other features you could tack in here. However feature bloat is part of why, in my opinion, other softwares in this category lack. They tend to do a lot, but none of it is done really all that well. <span span class="footnote"> Obligatory reference to <a href="https://www.joelonsoftware.com/2002/11/11/the-law-of-leaky-abstractions/">The Law of Leaky Abstractions</a>.</span> A good mod manager should be useful, but not try to do everything. <span class="footnote"> <a href="https://gitlab.com/portmod/portmod/-/wikis/Getting-Started">Portmod</a> does quite a bit, aside from downloading mods in all cases it damn near does everything. So it is possible to have a lot of features, it's just not easy. Props to Ben Winger for his awesome software.</span>
</p>

<h3>Conclusion</h3>

<p>
  It seems that it is in fact possible to play Bethesda RPGs on Linux, even if there's no native release and I'm just using Wine. LOOT sorting plugins for me is what really makes this possible; I live without a mod manager by doing things by hand, but the load order sorting isn't something you want to be doing by hand. That, as well as Wine and DXVK of course.
</p>

<p>
  If I wanted to play just the base game with no mods, the entire process would have looked like: install, run. The game is very buggy but not unenjoyable that way. Still, mods are needed to really smooth it over and make it an awesome experience. And in the end, the amount of time spent isn't a whole lot more than one would spend with Windows.
</p>

<p>
  When you consider that future modifications should be easy since I've already got an organized directory scheme, as well as the fact that I can use WEM to simplify interacting with Wine, this was a worthy endeavor. I have a working game environment that should continue to work and is easily adjustable should the need arise. Additionally, the patterns I described should work for any Bethesda RPG from Oblivion to Skyrim.
</p>

<h3>Footnotes And References</h3>

<div id="footnotes"></div>