You can sign up to get a daily email of our articles, see the Mailing List page.
We do often include affiliate links to earn us some pennies. See more here.

Factorio devs detail their 'Linux adventures' in a new blog post

By - | Views: 42,665

Factorio from Wube Software currently has an expansion and big update on the way, with regular blog posts going over all that's coming. The latest has some fun behind the scenes info on their Linux adventures.

The post is detailed in Friday Facts #408, which goes over all sorts of things but I felt it worth highlighting because one developer, raiguard, clearly puts a lot of effort and love into their official Native Linux version. As mentioned by raiguard they were originally making mods for the game since 2019 and eventually joined Wube Software in 2023 with their primary goals being "expansion programming and Linux support, as well as being an advocate for the modding community" and they daily-drive Linux on their own system too.

And the subject of why don't more games support Linux comes up, here's what raiguard said:

"Why don't most games support macOS and Linux?" is a sentiment I often see echoed across the internet. Supporting a new platform is a lot more than just changing some flags and hitting compile. Windows, macOS, Linux, and the Nintendo Switch all use different compilers, different implementations of the C++ standard library, and have different implementation quirks, bugs, and features. You need to set up CI for the new platform, expand your build system to support the new compiler(s) and architecture(s), and have at least one person on the team that cares enough about the platform to actively maintain it. If you are a video game, you will likely need to add support for another graphics backend (Vulkan or OpenGL) as well, since DirectX is Windows-exclusive.

Many developers will take one look at the Windows market share and decide that it is not worth the trouble to support other platforms. Also, with the meteoric rise of the Steam Deck and Proton, it is easier than ever for game developers to ignore Linux support because Valve does some black magic that lets their game run anyway.

Factorio supports macOS and Linux so well because there has always been someone at Wube who actively uses these platforms and is willing to take on the burden of supporting it. Our native Apple Silicon support is a great example of this. Today, I will take you through some of the adventures I've had with maintaining Factorio's Linux support.

After that raiguard goes over the fun of add Wayland support to the game, client-side window decorations, the game having seizures when the window was resized, dependency hell, clipboard issues and more.

The blog post is worth a read for the more technical side of game development and Linux support, especially in an area where Linux is in quite a bit of flux due to Wayland, Pipewire and more.

Factorio is available to buy on GOGHumble Store and Steam.

Article taken from GamingOnLinux.com.
30 Likes
About the author -
author picture
I am the owner of GamingOnLinux. After discovering Linux back in the days of Mandrake in 2003, I constantly came back to check on the progress of Linux until Ubuntu appeared on the scene and it helped me to really love it. You can reach me easily by emailing GamingOnLinux directly. Find me on Mastodon.
See more from me
13 comments
Page: 1/2»
  Go to:

slembcke Apr 26
View PC info
  • Supporter Plus
Huh, so one nice thing about SDL is that it mostly "just works". Why did they need to add the Wayland protocols into their source tree, and link with libdecor themselves? I predominantly test my SDL stuff on Wayland and I've never had to even think about that. Is it because they are statically linking maybe?
Soulprayer Apr 26
Sometimes Programming is just guessing the best outcome, so you mean FUN!!! in Dwarf Fortress style.
Okay, my joke is bad, sorry.
So, as someone who knows diddly about programming I gleaned two main things from that post.
1: Gnome is annoying for developers
QuoteFactorio does not need to provide decorations on any other platform, nay, on any other desktop environment, but GNOME can (ab)use its popularity to force programs to conform to its idiosyncrasies or be left behind.
2: Open source is great
QuoteI was hoping to utilize SDL's built-in clipboard functionality, but unfortunately SDL does not support incremental transfers. This means there are three options:

--Continue linking against X11, requiring users to install X11 on their system to be able to run the game (I don't want to mess with static linking).
--Figure out how to do runtime linking and implement that.
--Upstream our incremental transfers code into SDL so we can leverage SDL's clipboard functions and other SDL-based games can benefit from our work.
As you might guess, I chose the third option. The work to upstream our code is ongoing but should be done in time for Factorio 2.0's release.


Last edited by Purple Library Guy on 26 April 2024 at 4:13 pm UTC
F.Ultra Apr 26
View PC info
  • Supporter
Quoting: Purple Library GuySo, as someone who knows diddly about programming I gleaned two main things from that post.
1: Gnome is annoying for developers
QuoteFactorio does not need to provide decorations on any other platform, nay, on any other desktop environment, but GNOME can (ab)use its popularity to force programs to conform to its idiosyncrasies or be left behind.
2: Open source is great
QuoteI was hoping to utilize SDL's built-in clipboard functionality, but unfortunately SDL does not support incremental transfers. This means there are three options:

--Continue linking against X11, requiring users to install X11 on their system to be able to run the game (I don't want to mess with static linking).
--Figure out how to do runtime linking and implement that.
--Upstream our incremental transfers code into SDL so we can leverage SDL's clipboard functions and other SDL-based games can benefit from our work.
As you might guess, I chose the third option. The work to upstream our code is ongoing but should be done in time for Factorio 2.0's release.

#2 is exactly why I do and came to love open source, to be able to actually engage with your underlying dependencies as a developer was as being blessed to the halls of Valhalla after having been used to closed source libs where it was just "take it or leave it".
slembcke Apr 26
View PC info
  • Supporter Plus
Quoting: Purple Library Guy1: Gnome is annoying for developers

Well... Gnome is annoying for a vocal minority that don't like Gnome might be more accurate? Being the most popular DE is going to attract a bunch of ire from it's non fans. (shrug) SDL's Wayland stuff works out of the box with libdecor, and as of a year ago even provides native GTK window decorations. I'm not sure why they needed to do anything to enable it. My experience for the last few years developing SDL stuff on Gnome + Wayland is that it basically "just works". Even though they are statically linking things, I would have thought SDL's build scripts would just take care of the dependencies and such. I've only ever dynamically linked it though, so maybe not?
whizse Apr 26
View PC info
  • Supporter
Quoting: slembckeHuh, so one nice thing about SDL is that it mostly "just works". Why did they need to add the Wayland protocols into their source tree, and link with libdecor themselves? I predominantly test my SDL stuff on Wayland and I've never had to even think about that. Is it because they are statically linking maybe?
I only skimmed the post, but I think these were all issues involving compiling SDL from scratch. Not compiling the game against SDL.

At least the libdecor issue becomes mostly moot unless you hobble yourself with a castrated version of SDL.

Not sure why they link statically though. SDL still advises against doing so.
[quote=whizse]
Quoting: slembckeNot sure why they link statically though. SDL still advises against doing so.

Might have something to do with enabling modding?
Ehvis Apr 28
View PC info
  • Supporter Plus
Fun to hear some insides. Very much looking forward to the expansion. Until then, I have the mammoth task of finishing the Space Exploration modpack.

Quoting: whizseNot sure why they link statically though. SDL still advises against doing so.

The article is not entirely clear, but since they're upstreaming code they added a function to it. Statically linking would prevent it from being accidentally replaced.
Anza Apr 28
Quoting: whizse
Quoting: slembckeHuh, so one nice thing about SDL is that it mostly "just works". Why did they need to add the Wayland protocols into their source tree, and link with libdecor themselves? I predominantly test my SDL stuff on Wayland and I've never had to even think about that. Is it because they are statically linking maybe?
I only skimmed the post, but I think these were all issues involving compiling SDL from scratch. Not compiling the game against SDL.

At least the libdecor issue becomes mostly moot unless you hobble yourself with a castrated version of SDL.

Not sure why they link statically though. SDL still advises against doing so.

Probably they are compiling SDL from scratch because of the clipboard enhancements.

In general static linking or bundling the libraries is needed in order to resist changes in the environment. Open source games would probably fare better in environment like this, but that's not the world we are living in right now. Even then somebody has to care about old game to provide a patch, most games will be most likely left to rot.
Samsai Apr 28
Here's a potentially quite wild and controversial opinion. While libdecor is indeed a simple enough way to solve the client side decoration problem for games and especially since you get it for free with SDL you may as well go for it, I think with games I probably wouldn't really need those decorations if someone did omit them.

Moving a window around without decorations requires just Super pressed down and the GNOME activities view adds close buttons to windows anyway, and a quick Alt-F4 or a regional equivalent kills windows quite nicely too. Not to mention you're probably going to have an Exit button in your in-game menu anyway.

I'm sure there are probably plenty of people that would be annoyed by missing decorations though.
While you're here, please consider supporting GamingOnLinux on:

Reward Tiers: Patreon. Plain Donations: PayPal.

This ensures all of our main content remains totally free for everyone! Patreon supporters can also remove all adverts and sponsors! Supporting us helps bring good, fresh content. Without your continued support, we simply could not continue!

You can find even more ways to support us on this dedicated page any time. If you already are, thank you!
Login / Register


Or login with...
Sign in with Steam Sign in with Google
Social logins require cookies to stay logged in.