It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
high rated
Did you know that you can still play Unity games natively on Linux even when they don't have an official Linux build? Neither did I, until I came across this blog entry from January 2016 (which in turn references a Russian How-To). So basically I'm going to closely follow that blog entry (so credit where it's due), plus add a couple of additional instructions/observations for our less tech savvy Linuxers.


If you are curious enough, you might have already noticed that all Unity games have the same structure: one or two binaries, usually named something.x86 and something.x86_64, plus a directory named something_Data. What you might not have ever noticed (I hadn't), is that those binaries have nothing to do with the game itself, but with the particular version of the Unity engine it was created with. In other words, two different games created with the exact same version of the engine will have the exact same 32-bit and 64-bit binaries. This is crucial for our purpose of getting (apparently) non-Linux Unity games to run natively on Linux.


So, what do you need to do to get one non-Linux Unity game running in your Linux box? Just follow these steps:


0) Before anything else, you need to be able to browse the files that make your non-Linux Unity game up. To that effect, you need to uncompress it (in case it comes as a ZIP or a RAR file), or to install it (via Wine or whatever) if it's a binary installer. In the case of GOG installers there's no need to install anything as their contents can be easily extracted with innoextract (most of the time this program doesn't come pre-installed with your Linux distro, but usually it can be found in your distro's package repositories). To extract the contents of a GOG .exe installer you need to make sure that both the .exe and any potential .bin archive that comes with it are in the same directory, and type the following command:
innoextract --gog setup_whatever_game.exe
This will result in a variable number of directories being extracted: app, game, tmp, commonappdata, and sometimes others. You are only interested in the one that contains the game, i.e. the one with the game binary (something.exe) and the data directory (something_Data). This is usually the app directory, but it can also be the one named game, so take a look around to find the right one.



1) Once we have the game's files at our disposal, we first need to find out the exact version of the Unity runtime the game is using. We'll find this bit of information inside the aforementioned something_Data directory. Many files in this directory contain the Unity version inside of them: any of the levelXXX files, any of the sharedassetsXXX.assets files, the mainData, globalgamemanagers, globalgamemanagers.assets, resources.assets files, and probably others will do. I tend to go for level0 or level1, since these files seem to be always there, while others may not. To get the exact version, just type this on a terminal:
strings level0 | head -1
You should obtain something like 5.5.3f1, 4.6.4.p3, or similar. This is the version of the Unity runtime that game was built for.

If you get a version prior to 4.0.0 (e.g. 3.5.6f4), I'm sorry but you can forget about it. Unity began supporting Linux since Unity v4, so there are no Linux runtimes for earlier versions.



2) The second step is finding a Linux Unity runtime whose version matches the one we just found out.


2a) In practice you can find any one you need, as Unity has them all publicly available. The catch is that you need to download the full release, which weighs more than 1GB and contains thousands of files, when you only need a bunch of them. You can find them in these 3 repositories:

· Full releases (the ones with a X.Y.Zf[-∞] name format)
· Patched releases (the ones with a X.Y.Zp[1-∞] name format)
· Beta releases[*] (the ones with a X.Y.Zb[1-∞] name format)

[*] Only the current beta releases are available for download, so if you need an old beta runtime you're pretty much out of luck. Then again, only 6 out of my 463 Linux Unity games (and more importantly, none of my Windows-only Unity games) use such a runtime, so chances are you're not going to have to bother with that.



2b) An alternative route is to comb your own game library, in case you already have the runtime you need. When looking for a specific runtime you can use this shell command:
find . -name level0 -print0 | xargs --null grep --with-filename "4.5.5f1"
Needless to say, substitute "4.5.5f1" in that command for the exact runtime version you're looking for. This command will only scan the directory in which you invoke it and all its sub-directories, so it's a good idea to run it where you've got all your games installed (be it $HOME/games, or whatever).



2c) Another alternative, which is the one I went with, is to go one by one of your Linux Unity games and identify their runtime versions (by repeating the procedure explained in the point 1). I won't lie to you, it took me quite a long time to go through them all, but now I've got 126 different Linux Unity runtime versions at my disposal. :)



3) Once we've found a suitable candidate, we only need to copy the files we need. They are exactly these ones:

├── something_Data
│  ├── Mono
│  │  ├── x86
│  │  │  ├── libmono.so
│  │  │  └── libMonoPosixHelper.so (since v5.5)
│  │  └── x86_64
│  │     ├── libmono.so
│  │     └── libMonoPosixHelper.so (since v5.5)
│  └── Plugins
│     ├── x86
│     │  └── ScreenSelector.so (since v4.3)
│     └── x86_64
│        └── ScreenSelector.so (since v4.3)
├── something.x86
└── something.x86_64

(Of course, the name of the binaries and of the data directory will vary depending on the game)

In the best case scenario, this is all you need to get the game running natively on Linux. Copy the aforementioned files (renaming them when needed) to where your non-Linux game is located, run either the 32bit or the 64bit binary, and you should be able to play it.


-------------------------------------


Unfortunately, we're not always going to be so lucky. There are many issues that can prevent the game to work just like that (all of them being mentioned in the blog entry I've followed to write this mini-guide), the most common of which is the use of third-party plugins that may or may not be compatible with Linux. For instance, Her Story starts fine with a Linux runtime and everything works flawlessly... until you try to play a video (the videos seem to be using a codec for which there'st no compatible Linux plugin). To be honest, none of the games I've been able to get running does need any 3rd party plugin. It's getting late, so I'll write more about this tomorrow. In the meantime, I hope this is useful to somebody and good look if you decide to try to stay out of Wine™ and try to get Unity games running natively first. :)



PS: I'll be posting in this thread all the games (from GOG or not) that I've been able to get to work, and I encourage anyone who tries the same to share their experiences so we all can have a better (and native) Linux gaming life.
Post edited September 13, 2017 by muntdefems
Great post, I didn't expect this to work at all.
high rated
So the first GOG Unity game I've been able to get working natively on Linux (and finishing it) is Subject 13.

It uses the 4.6.4f1 Unity runtime, which you can find (with the binaries and Data directories conveniently renamed for this game) here.

I didn't need to do anything else than what I described in the first post (so if they don't support a Linux version it's simply because they don't want to) and, as I said, I was able to complete it without any crashes or significant bugs. If anything, I experienced a couple of weird but minor texture glitches: one with the head of an NPC, and another one with the texture of a metallic locker. But for all I know those issues could very well be there with the Windows runtime too.



PS: the other GOG Unity games I've been able to run using this method and haven't encountered any game-breaking issue during at least 5-10 minutes of play are Kyn, Randal's Monday, and The Last Tinker: City of Colors. However, I won't report them here until I beat them, or play them long enough as to feel confident that they are not going to break down the line.
Post edited September 13, 2017 by muntdefems
Good work! This, of course, raises the question why one makes a Unity based game and not a Linux version for it. Does it take that long to compile one more time?
avatar
Themken: Good work! This, of course, raises the question why one makes a Unity based game and not a Linux version for it. Does it take that long to compile one more time?
I don't think so. If anything, I imagine it must be because the devs have never touched a Linux distro and are afraid of committing to support an unknown platform.

Or because of the use of incompatible 3rd party plugins/middleware, like in Her Story.
avatar
Themken: Good work! This, of course, raises the question why one makes a Unity based game and not a Linux version for it. Does it take that long to compile one more time?
Different runtime environment, testing, 3rd party libraries, codecs...etc.
Linux desktop only share 2~3% of market (at best).

(I am a long-time Linux user, from around 1995.)
avatar
muntdefems: PS: I'll be posting in this thread all the games (from GOG or not) that I've been able to get to work, and I encourage anyone who tries the same to share their experiences so we all can have a better (and native) Linux gaming life.
Thank you very much for this guide! I'll be trying this myself for sure with Kyn.
Might I suggest also starting a gogmix for games that have been confirmed to run like this? Being able to identify such games from their store pages would be a great improvement, particularly once the list gets decently long.
Huge thanks for sharing this info with us!
I didn’t know such a thing was possible at all, and I already see a lot of possible applications in my own projects ;)
avatar
muntdefems: Did you know that you can still play Unity games natively on Linux even when they don't have an official Linux build?
No, and it's an interesting thing you did there. I'm tempted to try out some things myself, but I'll probably give it a rest until I manage to get a more gaming-capable Linux netbook. Bookmarked for now and +1 of course :).
avatar
WinterSnowfall: No, and it's an interesting thing you did there. I'm tempted to try out some things myself, but I'll probably give it a rest until I manage to get a more gaming-capable Linux netbook. Bookmarked for now and +1 of course :).
Dual boot on your new computer? ;-)

Netbook as in single core, 1GB RAM, 600p monitor? <shudders>
avatar
Themken: Dual boot on your new computer? ;-)
Nope, it's going to be Linux only.
avatar
Themken: Netbook as in single core, 1GB RAM, 600p monitor? <shudders>
More like the 14", i7-7500u, MX150, 16GB RAM kind if I find the right offer :P. I believe the marketing term for them is "ultrabooks" these days.
Post edited September 12, 2017 by WinterSnowfall
avatar
WinterSnowfall: More like the 14", i7-7500u, MX150, 16GB RAM kind if I find the right offer :P. I believe the marketing term for them is "ultrabooks" these days.
Ah, and the price is rather 'ultra' as well :-( Nice computers for carrying around though.
high rated
avatar
gogtrial34987: Might I suggest also starting a gogmix for games that have been confirmed to run like this? Being able to identify such games from their store pages would be a great improvement, particularly once the list gets decently long.
Good idea! Here it is: Unity3D games that can be run natively on Linux.

At the moment it's got only the 4 games I've mentioned in this thread. I've got several other GOG Unity games that don't have a Linux version, but I haven't got any of them to work. Most of them use a 5.x.y runtime and have the 'pink syndrome' (something about missing shaders).
avatar
muntdefems: PS: the other GOG Unity games I've been able to run using this method and haven't encountered any game-breaking issue during at least 5-10 minutes of play are Kyn, Randal's Monday, and The Last Tinker: City of Colors. However, I won't report them here until I beat them, or play them long enough as to feel confident that they are not going to break down the line.
Awesome!! Kyn was a pinata game I received. Now I don't have to be as disappointed that I got a windows game!
Alright, I've now played Kyn for a bit. After some exploration, I've figured out that I can't set it to be fullscreen, otherwise it won't start. I'm not sure why. Other than that, it seems to work perfectly.

I guess the next step is to list all of the Unity games that don't ship a Linux version.