I love gaming over multiple monitors. It’s my current choice for work and games – especially simulations. Having several monitors attached to one computer (or graphic card) is not a big deal in 2021 any more. The framebuffer in recent graphic cards is insanely huge compared to some years ago, when one really had to think twice about the possible resolution when e.g. connecting a beamer to a laptop (good old SiS 630 anyone?).

xfce4-display-settings for my refurbished “new” set of displays

This couldn’t be easier nowadays. Even mixing the integrated graphic card of a recent Intel CPU with an NVIDIA or AMD dedicated graphic card does usually “just work”. Some driver specific mode may have to be set but that’s it. The workspace easily expands over multiple displays and windows can be moved around freely.

Games do not see one huge desktop but individual displays

There is however a catch. Games tend to read the primary display only and the maximum resolution offered usually comes with the readout of this very first display – or worse – the first display connected. This sucks especially when the monitors have different resolutions, as it was the case for me for several years now, because I didn’t just purchase a set but collected discarded monitors over the time. This can often be omitted by temporary disabling the “false” ones or by force window mode.

This results in hacky scripts involving xrandr, wmctrl and xdotool. This is for example how I hammered X4: Foundations into shape _after_ it started, because it would allow me to select a single display only. Set to window mode it can be freely scaled but that comes with a disturbing window decorations so with this the X4 window gets positioned to 0x0, expanded to 5770×1210 and the window decorations purged:

xdotool search --class "X4" windowmove --sync %@ 0 0 windowsize %@ 5770 1210 set_window --overrideredirect 1 %@
X4: Foundations on Extreme Multihead

That’s a pain to find out and the fun really stops when it comes to Proton or some games that would not allow resizing over their maximum detected resolution – like for example Everspace.

How about a virtual monitor?

So the idea was to introduce a completely virtual monitor to the systems with the resolution of choice. VNC servers do that all the time so it must be possible. The usual approach won’t work in this case though: When loading the dummy driver the real displays can usually no longer be used and the drivers for AMD and NVIDIA do not really offer such a feature at all.

It is perfectly possible to define virtual monitors with a recent xrand but they have to be mapped on an existing output (a real port). One can use an unused port (as in: no monitor connected) for this, add a Modeline and even force it as “online” like so: echo on > /sys/kernel/debug/dri/0/HDMI-A-1/force

I was delighted to see the display showing up briefly but the AMD driver made short work of my soaring hopes by forcing it off again in an instant. So close and yet so far. This would require some hardware hacking by creating a dummy plug for the port. That’s basically some resistors in the right place making the computer think a display is connected. I hear they can also be purchased and this may be a way for others.

Others seem to have had success by compiling the experimental DisplayLink driver that seems to offer (virtual) monitors but I really didn’t feel like fiddling with something even more alien that will probably break on the next kernel update again.

Intel to my aid!

The success for me was in the end to use of the Intel driver and it’s VirtualHeads feature. The caveat is that one probably needs an Intel CPU for this to work and has to create a X11 config file. If this is done without adding the usual driver people will experience black screens on reboot only. This may be a show stopper for inexperienced Linux users who don’t know how to recover from a broken X11 config (yet :D). For me this is an amdgpu so my file /etc/X11/xorg.conf.d/20-intel-virtual-and-amd.conf has to look like this:

Section "Device"
       Identifier "amdgpu0"
       Driver "amdgpu"
Endsection

Section "Device"
       Identifier "IntelVirtual0"
       Driver     "intel"
       Option     "VirtualHeads" "1" 
EndSection

Triple check that your driver is used in there instead or you will end up with a broken config without the possibility to log in to a graphical window manager. When in doubt start e.g. a new session to your liking on the next display server where you can switch back with the key combination ctrl+alt+F[1-0]: startx /usr/bin/startxfce4 :2

Once started a new provider shows up and the new output “VIRTUAL1” is available: xrandr --listproviders

Providers: number : 2
Provider 0: id: 0x59 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 6 outputs: 4 associated providers: 1 name:AMD Radeon RX 5600 XT @ pci:0000:03:00.0
Provider 1: id: 0x9e cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 5 outputs: 4 associated providers: 1 name:Intel

Configuring the virtual monitor with xrandr

Now that we have a virtual monitor we need a Modeline for it. This is usually the current screen (of the framebuffer) and can be calculated (e.g. sum of all monitors x height and Hz of one monitor) or by asking the system: xrandr | grep Screen

gtf (or cvt) helps obtaining the Modeline: gtf 5760 1200 60

  # 5760x1200 @ 60.00 Hz (GTF) hsync: 74.52 kHz; pclk: 579.47 MHz
  Modeline "5760x1200_60.00"  579.47  5760 6144 6768 7776  1200 1201 1204 1242  -HSync +Vsync

Now all information needed to finally set up the virtual display is there. I’m creating the virtual display on top of the three real displays because I also want to see what’s drawn on it. That’s not strictly required though and in fact most graphical tools to configure the monitor location will even refuse this – because this use case is simply not considered or supported. Gnome for example really didn’t like this. XFCE4 didn’t care. Ymmv:

xrandr --newmode "5760x1200_60.00"  579.47  5760 6144 6768 7776  1200 1201 1204 1242  -HSync +Vsync
xrandr --addmode VIRTUAL1 "5760x1200_60.00"
xrandr --setmonitor Virtual 5760/1554x1200/324+0+0 VIRTUAL1 
xrandr --output VIRTUAL1 --mode "5760x1200_60.00" --pos 0x0 --primary

It’s done.

The virtual monitor becomes visible in display settings (xfce4-display-settings here)

And it works!

After a lot of research and fiddling (and breaking my X config several times) I finally found a working solution. Games let me select the virtual monitor or see at least my primary with my “maximum” resolution. Sometimes this still requires window mode but I could care less – the decorations are optional. And it works like a charm! Here is a small selection of the games I play most at the moment:

This is how my set-up looks:

Now I’ve another problem. With this my usual 1080p gaming resolution is no longer and my graphic card is simply not up for the job any more 🤣

At least gaming itself is easy as pie on Linux in 2021. Complex display set-ups? Not so much.

This is the journey of getting head tracking for X4 Foundations on Linux. Browsing the in-game options I found key bindings to enable and reset a head tracker so I got my hopes high for head tracking for X4 on Linux and started reading.

tl;dr: The native build of X4 does not support this at all. It even lacks the symbols in the executable. There is hope with Wine though.

While seeking through the patch notes two things catched my eye (harhar). The notes suggest support for Tobi Eyetracker and somewhat earlier TrackIR. The Tobi one was marked as “Windows only” so I hoped for TrackIR and tried to understand what is involved into getting this particular head tracking to work.

Please do keep in mind that I never touched any head tracking before so I had to grasp the theory behind all this first.

So apparently there are not many possibilities to configure anything in-game. There is the additional start parameter -forcehmd that may have some effect here but that’s about it. So everything related must come from the outside, right?

Funny enough a Kerbal Space Program extension on GitHub provided me with the idea how TrackIR is supposed to function: https://github.com/pizzaoverhead/KerbTrack/blob/master/KerbTrack/TrackIRClient.cs#L45 so let’s clear that one up: The code looks for the registry entry “Software\\NaturalPoint\\NATURALPOINT\\NPClient Location” that points to the NPClient.dll (or NPClient64.dll) which in turn in loaded by the executable if found and accessed. And sure enough I found the same pattern by using the good old hexeditor on X4.exe as well:

You may suspect this already but none of that can be found in the X4 binary for Linux and this is the end of the story.

Appendix: It might be possible that a joystick look-around thingy may be abused for this but since I do not own such a joystick (yet) I wouldn’t know how to fake such signals.

A new hope

During my research on head tracking on Linux I stumbled over the website https://tkoletivrijedi.in.rs/node/219?language=en that mentioned the OpenTrack project https://github.com/opentrack/opentrack to play Windows games with Wine on Linux. How cool is that? A quick check suggests that OpenTrack features (also) the output protocol “freetrack” for Windows and a “Wine freetrack glue protocol” for Linux and OSX.

Freetrack seems to be a implementation of what TrackIR does up to version 4. Looks like the company didn’t like that or was afraid that some tinkerers use self built head tracking devices and not buy their ~200$ hardware any more so they added encryption to their devices with version 5 leaving freetrack dead in the water. Or whatever. So if a game would only support protocol 5… it’ll probably no longer work. Anyway, let’s jump into OpenTrack and give it a try. Once all required developer packages are installed, that includes the wine-devel packages for i686 (and libevdev if you want virtual joystick support), this can be compiled:

git clone https://github.com/opentrack/opentrack
cd opentrack
mkdir build
cd build
ccmake ../
make -j4
make install
./install/bin/opentrack

The important part is to tick the SDK_WINE option or we don’t get the precious Wine Glue. Here, have a video:

And sure enough we find the following already familiar files in install/libexec/opentrack/

  • NPClient.dll
  • NPClient64.dll
  • TrackIR.exe
  • opentrack-wrapper-wine.exe.so

So what OpenTrack does is once it’s started and configured to use “Wine — Windows layer for Unix” as Output: It “injects” the key [Software\NaturalPoint\NATURALPOINT\NPClient Location] to the user.reg of the configured Wine/Proton prefix on start while the also started opentrack-wrapper-wine.exe.so is used for the shared memory mapping – means from my understanding from the OpenTrack binary to some Wine process. TrackIR.exe is just a dummy that may also be run with Wine but does nothing. It’s apparently for games that check for a process with that name before they initialize head tracking features. Neat, huh?

For this to work you have to click on the little hammer symbol next to Output so make sure that your Wine Prefix is properly configured or OpenTrack may insert the registry key to the wrong Wine prefix. Sure enough it seems to come Steam and Proton ready as well but I did not try this because I made the mistake of buying X4 on GOG (I know this is getting old).

So what’s next? Oh yes, a Head Tracking device. Well bite me, I don’t even have any. Why did I go through all this trouble at all?

The head tracking device

Well why should I purchase such a device without knowing if I can even use it? Do you know what kind of device has a gyroscope built in however? Yes, every average smart phone has one and some are even really good (I hear.) So here comes the fun part: I strapped my mobile phone to my headphones while an app sends the tracking information via wifi and the UDP protocol to OpenTrack as input source.

So I will not bore you with the details how I configured and mapped this in Opentrack. It will be of no use for you anyway since this depends totally on your device and system but I can tell you that this is a lot of fiddling with the settings. Also know that a 3-point device can indeed be built for ~10$ with some LED and a webcam – there are various people demonstrating this on the net and you will find plenty on the usual video platforms.

Finally

I don’t like to have to install the game twice now, once native and once with Wine, but… it’s for science! Or so.

Yes, it’s a little clunky. This is probably because:

  • my phone sucks
  • my phone really sucks (seriously)
  • it’s UDP – order of packages is not guaranteed
  • it’s wireless and the access point is two walls away
  • …and I probably also messed up with the mapping and filter options 🙂
  • I even read that it’s not any better on Windows xD

So that’s it. Head tracking on Linux for X4 Foundations. Jumped the hoops 🙂

I was eager for the second expansion set of “Cradle Of Humanity” since I enjoyed the Split Vendetta expansion a lot. Sunk many nights into this sandbox so I pre-ordered the DLC on GOG (Good Old Games) and watched that countdown to release ticking down. Oh boy, was I disappointed when the timer reached zero and I got nothing while people who bought on Steam already enjoyed the DLC. As usual GOG leaves Linux players standing in the rain so I called it a day and checked again on the next day when I was presented with this:

X4: Foundations patched, Split Vendetta was not, Cradle Of Humanity nowhere to be seen.

So apparently they finally managed to roll out version 4.0 of the main game but missed the first DLC Split Vendetta. What could possibly go wrong. Cradle Of Humanity is still nowhere to be seen. This didn’t change until now, one day after release and the time of writing of this article. Oh GOG, I am so done with this. And I even expected this, joking around weeks before the release date that this will be two weeks later for GOG users. Again.

Curiously I checked the Downloads for Windows next and guess what: The DLCs were all there and also on version 4.0!

So I did what every Linux tinkerer would do. I checked out what is really in the DLC files by extracting the contents using innoextract. To my delight I could not find anything operating system related in there so I threw all the Windows DLCs into my version 4.0 base game folder and extracted both DLCs.

The required files are:

  • setup_x4_cradle_of_humanity_4.00_(64bit)(45636)-1.bin
  • setup_x4_cradle_of_humanity_4.00(64bit)(45636).exe
  • setup_x4_split_vendetta_4.00(64bit)(45636)-1.bin
  • setup_x4_split_vendetta_4.00(64bit)_(45636).exe
cd /games/linux/X4_Foundations/game
innoextract --exclude-temp --extract setup_x4_split_vendetta_4.00_\(64bit\)_\(45636\).exe 
innoextract --exclude-temp --extract setup_x4_cradle_of_humanity_4.00_\(64bit\)_\(45636\).exe

When I run the game now I found both DLCs registered in the Extensions menu and could start a new game as Terrain fraction. Whop whop, here we go.

No, I will never buy a recent game on GOG again. Especially not as pre-order. I wish I could migrate this to my Steam account. This is the DRM free revolution. As usual, the joke is on the paying customer.

Nice, will be in Early Access starting february 2nd: https://www.valheimgame.com/. I clocked around ~300 hours on this when I take alpha and various beta times into account and also provided dedicated servers during development for years. All on Linux PC 😀 Great to see this gem moving forward 🎉

Challenging turn-based RPG 'Stoneshard' has a huge overhaul update out, price rising by Liam DaweLiam Dawe (gamingonlinux.com)
Ink Stains Games have released a major upgrade to the challenging turn-based RPG Stoneshard, one they've been working on for some time now and it's quite the overhaul. Sounds like it's almost a different game too, all the big main parts of the game have been changed in some way. Here's the highlight...

Absolute lovely. Looks like someone made the homework on mediaeval buildings and stuff and mixed everything in a nice looking fantasy RPG. Getting Death or Glory: Das Erbe von Morgan vibes from this. Stoneshard goes totally on my wishlist.

Story-driven, tactical stealth game Desperados III is now available on Linux PC by Liam DaweLiam Dawe (gamingonlinux.com)
THQ Nordic and Mimimi Games kept to their word, with Desperados III now being officially released for Linux PC and macOS along with the latest update. "Desperados III is a story-driven, hardcore tactical stealth game, set in a ruthless Wild West scenario. Play smart if you want to succeed. A good pl...

Oh yes, Desperados III on Linux PC 😀 So want!

https://www.gamingonlinux.com/2020/09/story-driven-tactical-stealth-game-desperados-iii-is-now-available-on-linux-pc

“Releases for PC”. Oh we Linux gamers know this phrase well. So it seems that is taking another approach now instead of the usual “PC is not Windows”. Liam changed the wording on the news slightly:

Beyond a Steel Sky to release for Linux PC during July

https://www.gamingonlinux.com/2020/06/beyond-a-steel-sky-to-release-for-linux-pc-during-july

I like that approach and I shall also use “Linux PC” in the future. And not just for my .

 

Things were going smooth for a while. The pirates didn’t stop harassing my ships so I decided for drastic action. We slacked their station in the system.

The Scale Plate Pact station is no more

That sure put a damper on their actions in the sectors nearby. Surviving ships were hunted down, boarded and taken over. It was glorious. The fleet was unstoppable for a while and with each carefully picked battle it grew.

Gate duty helped to train the fleet further and a lot of sweet loot to improve and modify ships further could be collected.

The highlight was two Xenon K jumping into the sector to be annihilated by my fleet of two destroyers, plenty of small fighters and an auxiliary ship used as bullet sponge.

Battling Xenon K at the gates

This was when I decided to contact the Split while extending my mining business all over the galaxy big time. I started with a bad reputation towards Split – that’s kinda default for most races in the X4 universe – so I had a hard time to make them like me… somewhat. This was mostly achieved by destroying enemy ships near to their stations.

Meanwhile I bought several Magnetar mining ships so keep the needed raw materials on my prospering stations coming. Everything was going nicely and I decided to claim the sector Heretics End.

While I was busy building my stations to do so my new not-exactly-enemies decided to go to battle in freakin Argon Prime. Four Rattle Snake destroyers went basically unchallenged into the Argon heart and took out the Wharf. I didn’t want to interference since I just made not-exactly-enemy with the Split. From here it went downhill fast. Almost all of Argon Prime was wiped out – and I had bought most of my ships there. This! Hurt! Business!

I had not much time to mourn though. While I was busy with my new stations in Heretics End I was ended by a very surprising Xenon attack myself. First two more K ships showed up that I hardly managed to destroy – especially since most of my fleet was busy rescuing some Teladi trading station from another K.

While I was busy counting my losses _it_ showed up. The worst nightmare X4 has to offer: The Xenon Branch 9 Destroyer I entered the sector and all I had to offer were two half built stations, some Interceptors and my badly damaged Argon Behemoth destroyer.

Xenon Branch 9 Destroyer I

I tried to keep my distance while waiting for my fleet to arrive. This worked for a while but it eventually was going to destroy my station so I tried to get into it’s blind spot. That was my last stand. Out of mines and turrets, low on interceptors and badly damaged my destroyer went down with me on the bridge.

I accept this glorious defeat – for now 😀

I wonder for a suited format for a series of log entries for my X4 adventures. Mayhap I should simply edit and append as the story [of my sandbox] unfolds.

Spent most of the day hunting pirates that seem to develop a taste for my ships. The salvaged Cerberus Vanguard is a huge help with this and whenever a pirate surrenders my own support fleet of Minotaur grows. Did I mention that I just love the design of this ship? It’s such a great all-round asset that can even haul some cargo on occasion or act as small carrier.

I also stumbled over another really tiny vault. Took some time to unlock all it’s secrets but I’m starting to get the hang of it.

Raiding a tiny vault

Talking about raiding I had some notable encounters as well. A Raider tried to steal from the current head quarter. That was a mighty stupid idea and the Raider was toast before I even got close to it.

Scale Plate Pact Raider going down in a blaze

And another had the nerve to attack my medium freighters during their duty of making profit. When I finally had enough I called in the fleet and together we started a boarding operation. That was a long and ugly fight mostly because due to a bunch of Xen fighters trashing our party. Lost one small heavy fighter and 45 marines but in the end the ship was ours. Good thing the Cerberus brought a repair drone along to fix the busted engines, by the way.

I also identified a choking point in Napileos’ Fortune VI where a lot of the pirate traffic seems to originate. It’s an empty and unclaimed sector so I started building an Administrative Center here hoping to get this pest under control.

Claiming Napileos’ Fortune VI

I wonder if it makes sense to start more stations here, because a lot of other huge stations are within 4 sectors of this – the typical maximum distance for auto traders to go – and a lot of traffic is passing through this already.

Oh yeah – and I finally got all the parts to assemble the SINZA device. It’s IMHO not really obvious that it simply activated with Shift+4 because I tried to install it as modification or ship drive first.