<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Linux on ln --help</title>
    <link>https://blog.mei-home.net/tags/linux/</link>
    <description>Recent content in Linux on ln --help</description>
    <generator>Hugo -- 0.147.2</generator>
    <language>en</language>
    <lastBuildDate>Sat, 11 Nov 2023 14:45:06 +0100</lastBuildDate>
    <atom:link href="https://blog.mei-home.net/tags/linux/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Europa Barbarorum and Linux Gaming</title>
      <link>https://blog.mei-home.net/posts/europa-barbarorum-linux-gaming/</link>
      <pubDate>Sat, 11 Nov 2023 14:45:06 +0100</pubDate>
      <guid>https://blog.mei-home.net/posts/europa-barbarorum-linux-gaming/</guid>
      <description>A Linux Gaming appreciation post and a guide on getting Europa Barbarorum running on Linux</description>
      <content:encoded><![CDATA[<p>I&rsquo;ve been a gamer for all my life, and I&rsquo;ve been using Linux as my main OS since
I started studying computer science and thought to myself &ldquo;every self-respecting
CS student should run Linux&rdquo;. (I was young and deeply into CS nerd culture okay?
It was a different time! &#x1f609;)
For a long time, those two things, Linux and gaming, didn&rsquo;t really go together,
at least as long as you were a mainstream gamer.
So on every machine I used, I always had a Windows partition that was nothing
more than a game console. It had Steam, and not much else.</p>
<p>That era ended in September 2021 for me. It was a Sunday afternoon, and I felt
like continuing my Stellaris game earlier than my typical gaming time past
10 pm. That would mean I would need to reboot from Linux to Windows, and also
switch back to listen to some podcasts while preparing and eating dinner. And
I thought: Nope, this rebooting has to stop. Let&rsquo;s see what the &ldquo;Gaming on
Linux&rdquo; story looks like these days. I had read a lot about Steam&rsquo;s Proton,
but never took the time to look at it.</p>
<p>An additional problem for me was that I was using Gentoo Linux, meaning
everything is compiled locally, (almost) no binary packages. Which is fine for
me, I like the system overall, and it provides me with an excuse to always buy
the top end for the current CPU offerings. But from a previous experiment, I
knew that installing native Steam worked - but would mean that I needed to run
a multilib system, with 32 bit and 64 bit versions of a lot of libs.</p>
<p>I had read on the Gentoo forums that there was a viable alternative with much
less pain in the form of Flatpak. I had never used that either, but it worked on
first try, and suddenly I had a working Steam on my Linux system.</p>
<p>And then I installed Stellaris. And it just worked. I needed to do absolutely
nothing weird, no additional command line parameters, absolutely nothing. Just
hit install, and then hit play. And bam. Only slightly annoying thing was
actually finding the right directories to copy my saves from Windows over.</p>
<p>I was honestly flabbergasted. Could it really be that easy? And it seems it
can be. There were a couple of graphical glitches very sporadically, but moving
the camera just a smidgen in any direction fixed them. Everything else worked.</p>
<p>I played Stellaris for months (as I&rsquo;m wont to do with any damned game Paradox
releases. &#x1f614;) without issues.</p>
<p>And next came Factorio. Exactly the same story. Hit install, hit play, enjoy.</p>
<p>Then I became nervous, because my next game after that was <a href="https://www.egosoft.com/games/x4/info_en.php">X4: Foundations</a>.
And I thought: Okay, that&rsquo;s pretty demanding. How well would it really run?
And the answer was, yet again: Without any issue whatsoever. That was pretty
much the end of it: I was a Linux gamer now. 7 Months later (X is another one
of those game series which will occupy me for a long long time) I ran
<a href="https://www.paradoxinteractive.com/games/shadowrun-hong-kong-extended-edition/about">Shadowrun: Hong Kong</a>.
I would not mind a new entry in that series of games. Also worked perfectly.
Then came Battletech, also worked without any issue.</p>
<p>And then came another which I was dreading, Anno 1800. Relatively demanding and
modern game. AAA title. Finally came out on Steam, so I could finally buy it.
And here, for the first and up to now only time, I had to do some fiddling,
as Anno did not launch right away. In the end, I only needed to change the
launch command to <code>PROTON_ENABLE_NVAPI=1 %command%</code>. And then it also ran without
any issues at all.</p>
<p>Next came Kindgom Come: Deliverance and Disco Elysium, both games I could not
really get into, but which both worked absolutely fine under Linux as well.</p>
<p>My current game is Divinity 2: Original Sin. Like all the others above, again
no issues. Also a great RPG. I&rsquo;m now looking forward even more to the new
Baldur&rsquo;s Gate from the same studio.</p>
<p>Overall, this was a really great experience. I&rsquo;m quite happy that I don&rsquo;t need
to maintain a separate Windows partition anymore, just for gaming.</p>
<p>A couple of things to note though: As you can see from the list above, I&rsquo;m pretty
far behind on my Steam list of shame. Most of these games are older titles. I
don&rsquo;t know what it would look like if I were to play more recent titles, e.g.
Baldur&rsquo;s Gate or Starfield from this year.</p>
<p>But I&rsquo;ve found being behind on my gaming also has some good sides. I get to
immediately play the &ldquo;Complete&rdquo; or &ldquo;Definitive&rdquo; editions with all the DLCs and
without all the day 1 bugs. I don&rsquo;t really like returning to games I&rsquo;ve already
played, with some Paradox titles as the exceptions to prove that rule.</p>
<p>Another potentially important note: I&rsquo;m using an AMD GPU, an RX580 from 2017.
And because AMD is not quite as arrogant as Nvidia, they maintain their Linux
drivers right in the kernel, so they have always gotten my money in the past,
and will always get my money in the future.</p>
<h2 id="the-trigger-for-this-post">The trigger for this post</h2>
<p>And finally, onto the trigger for this post, the <a href="https://www.twcenter.net/forums/forumdisplay.php?454-Europa-Barbarorum-II">Europa Barbarorum 2</a>
mod for Medieval II: Total War. For some reason, I&rsquo;m currently on an &ldquo;Ancient Rome&rdquo;
trip, since I started listening to the excellent <a href="https://thehistoryofrome.typepad.com/">History of Rome</a>
podcast. I&rsquo;ve also been reading the <a href="https://en.wikipedia.org/wiki/Imperium_(Harris_novel)">Cicero Trilogy</a>
and I&rsquo;m currently reading the equally good <a href="https://en.wikipedia.org/wiki/Masters_of_Rome">Masters of Rome</a>
series.</p>
<p>That made me think back to my days at University. Money was a bit tight, so I was
in the &ldquo;a lot of time to game, very little money to buy games&rdquo; situation.
I mitigated that problem by really getting into game mods. One of them was the
first Europa Barbarorum, for Rome: Total War. I played that game a lot, and I
have fond memories of it. The modders introduced a lot of interesting things
via scripting, and build a gigantic world map to conquer. It was amazing.</p>
<p>So it was only natural that I felt like I needed to command Rome&rsquo;s Legions
myself, instead of just hearing and reading about other people doing so.</p>
<p>My initial misgivings about whether Medieval II would even run under Linux,
being a game from 2006, were put to rest rather
quickly by the mod authors having explicit instructions for Linux in their
installation docs.</p>
<p>And that&rsquo;s really the first amusing thing: Suddenly being back in the days
where mods needed actual install instructions, instead of just using the game&rsquo;s
or Steam&rsquo;s mod framework. So some file copying was in order. Which will prove
more problematic than you might think.</p>
<p>But first, let me state: The Steam version of Medieval II runs under Linux
without any issue at all. Just download and hit play.</p>
<p>But then comes the mod install. The instructions can be found <a href="https://www.twcenter.net/forums/showthread.php?791590-Announcement-Europa-Barbarorum-II-2-35-released!">here</a>.
Rather amusingly, I first had to figure out where the hell Flatpak put the Steam
files! Hint: It&rsquo;s under <code>~/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps</code>.</p>
<p>Sadly, the install instructions for the mod also contain this line:</p>
<blockquote>
<ol start="2">
<li>Delete your settlements folder in share/data/mods/ebii/data. You play with vanilla settlements.</li>
</ol></blockquote>
<p>This seems to be current information, as without doing this, the game crashes.
But ah well, you can&rsquo;t have everything. &#x1f609;</p>
<p>The final hurdle came with installing patches. Initially, I just installed
the main 2.35 version and launched a campaign, forgetting about the two patches.
And everything seemed to be working, at least in the first couple of turns.</p>
<p>Then I happened to look at the forum again and realized that there were two
patches for that release also waiting to be applied. And that&rsquo;s where the problems
began.
I ran the rsync command to install/override some new files:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>rsync -aPv ./data/ /home/michael/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common/Medieval<span style="color:#ae81ff">\ </span>II<span style="color:#ae81ff">\ </span>Total<span style="color:#ae81ff">\ </span>War/share/data/mods/ebii/data/
</span></span></code></pre></div><p>And suddenly the game crashed for every battle. It took me quite a while
to realize that this was due to one of Windows&rsquo; quirks: The filesystem in Windows
does not care about the case of filenames. <code>HELLO</code> is the same as <code>heLLo</code>.
Now, in the main 2.35 install, all files and directories, without exception,
were lower case. But in the two additional patches, some files and directories
were upper case. And so when I ran the above command, some new files were added,
but some old files were not overwritten as intended, leading to the crashes.</p>
<p>And now I come to a confession: I had to google how to recursively change all
filenames to lower case in a directory. &#x1f648;</p>
<p>After I had finally done that, Europa Barbarorum 2 runs fine on Linux, besides
the aforementioned vanilla settlement maps. Slightly weird to breach the walls
of an Aztec looking city with a Roman Legion, but ah well.</p>
<p>So the full guide to installing Europa Barbarorum for the Steam version of
Medieval II: Total War under Linux.</p>
<p>First, install Medieval II with the Kindgom expansion via Steam. Then launch
the game and a grant campaign. I&rsquo;m also not sure why that&rsquo;s necessary, but the
EBII install instructions mention it, and it&rsquo;s also a good way to test whether
campaigns and battles work properly.</p>
<p>Then, download the non-installer version of EBII v2.35 from one of the links
mentioned in <a href="https://www.twcenter.net/forums/showthread.php?791590-Announcement-Europa-Barbarorum-II-2-35-released!">this announcement</a>.
I decided for the non-installer version because I figured I would need Wine
for the installer to work properly. As we&rsquo;re installing under Linux, you can
also ignore all the instructions about installing in a short path outside the
<code>Program Files</code> directory.</p>
<p>Unpack the 7z package with <code>7z e EBII_noninstaller.7z</code>. This will create a
directory called <code>mods/</code> in the current dir, with a single dir called <code>ebii</code>
inside it. Copy that dir to:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>~/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common/Medieval<span style="color:#ae81ff">\ </span>II<span style="color:#ae81ff">\ </span>Total<span style="color:#ae81ff">\ </span>War/share/data/mods/
</span></span></code></pre></div><p>Then copy the file <code>Medieval\ II\ Total\ War/share/data/mods/ebii/data/banners/no_banner.mesh</code>
to <code>Medieval\ II\ Total\ War/share/data/data/banners/no_banner.mesh</code>, outside
the mod dir.
Then delete the dir <code>Medieval\ II\ Total\ War/share/data/mods/ebii/data/settlements</code>.</p>
<p>Next, have a look at the instructions <a href="https://www.twcenter.net/forums/showthread.php?810596-Announcement-Europa-Barbarorum-II-2-35A-R3-5-released!">here</a>
to install two patches for the mod.
These are problematic, because they contain some directories with upper case letters,
which means that rsync will add those directories and files to your mod, instead
of replacing the existing files, leading (in my case) to crashes whenever I
start a battle.
First, unpack the <code>EBII 2.35A Patch FINAL R1.rar</code> file with <code>unrar</code>.
This will create a directory called <code>2.35\ patch</code>. If you run a find command
on that one, you will see the problem:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>find 2.35<span style="color:#ae81ff">\ </span>patch/ -regextype posix-extended -regex <span style="color:#e6db74">&#39;.*[[:upper:]].*&#39;</span>
</span></span></code></pre></div><p>This produces a lot of files. Now run the same command on the original mod
folder:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>find  ~/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common/Medieval<span style="color:#ae81ff">\ </span>II<span style="color:#ae81ff">\ </span>Total<span style="color:#ae81ff">\ </span>War/share/data/mods/ebii/ -regextype posix-extended -regex <span style="color:#e6db74">&#39;.*[[:upper:]].*&#39;</span>
</span></span></code></pre></div><p>There will be no hits - all files are lower case.
To lower case all of the files in the patch, you can use the following command:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>find 2.35<span style="color:#ae81ff">\ </span>patch/ -depth -exec perl-rename <span style="color:#e6db74">&#39;s/(.*)\/([^\/]*)/$1\/\L$2/&#39;</span> <span style="color:#f92672">{}</span> <span style="color:#ae81ff">\;</span>
</span></span></code></pre></div><p>Note specifically the <code>perl-rename</code>. I also have a different <code>rename</code> command on
my machine, that&rsquo;s not the right one for this snippet.</p>
<p>After all files have been made lower case, you can now install the patch:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>rsync -aPv ./2.35<span style="color:#ae81ff">\ </span>patch/data/ ~/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common/Medieval<span style="color:#ae81ff">\ </span>II<span style="color:#ae81ff">\ </span>Total<span style="color:#ae81ff">\ </span>War/share/data/mods/ebii/data/
</span></span></code></pre></div><p>This patch also has some additional instructions in the <code>2.35\ patch/readme.txt</code>
file. Namely, removing all <code>*.idx</code> and <code>*.dat</code> files in the <code>modes/ebii/data/sound</code> dir.</p>
<p>And finally, unpack the last <code>EBII v2.35A R3.5.zip</code> patch. This one also needs
the lower case treatment as described above and then should also be copied with
rsync to the <code>mods/ebii/data</code> folder.</p>
<p>And that&rsquo;s it. Happy conquering the ancient world. :slight_smile:</p>
]]></content:encoded>
    </item>
  </channel>
</rss>
