{"id":971,"date":"2016-01-13T20:46:51","date_gmt":"2016-01-13T19:46:51","guid":{"rendered":"\/Blog\/?p=971"},"modified":"2019-01-17T14:00:30","modified_gmt":"2019-01-17T13:00:30","slug":"windows-unity-games-on-linux","status":"publish","type":"post","link":"https:\/\/seegras.discordia.ch\/Blog\/windows-unity-games-on-linux\/","title":{"rendered":"Windows Unity-Games on Linux"},"content":{"rendered":"<p><strong>The fact is, beginning with Unity 4, just about all games run on Linux as well<\/strong>. Unless they&#8217;re buggy, explicitly check for the platform or use plugins not available on Linux.<\/p>\n<p>I found this <a href=\"http:\/\/rutracker.org\/forum\/viewtopic.php?t=5026239\">Howto in Russian<\/a> on how to fix an incomplete Unity runtime so it runs on Linux, could reproduce the effects, and so here&#8217;s the writeup in English on how it&#8217;s done.<\/p>\n<p>This is how the minimal Unity-runtime for Linux looks: <\/p>\n<p><code>\u251c\u2500\u2500 player_Data<br \/>\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 Mono<br \/>\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 etc<br \/>\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 x86<br \/>\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 libmono.so<br \/>\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 x86_64<br \/>\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 .   \u2514\u2500\u2500 libmono.so<br \/>\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 Plugins<br \/>\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 x86<br \/>\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 ScreenSelector.so<br \/>\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 x86_64<br \/>\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 .   \u2514\u2500\u2500 ScreenSelector.so<br \/>\n\u251c\u2500\u2500 player.x86<br \/>\n\u2514\u2500\u2500 player.x86_64<\/code><\/p>\n<p>The word &#8220;player&#8221; is replaced by the actual name of the game. Note that these files are the same for every game that uses the same Unity version. <\/p>\n<h2>Find Version<\/h2>\n<p>Within the existing <code>player_Data<\/code> directory, you&#8217;ll find a file named <code>mainData<\/code>. This contains the Unity version, and you will need to add the correct version of the Linux runtime, so you&#8217;ll first need to extract that version: <\/p>\n<p><code>head mainData | strings | head -1<\/code><\/p>\n<p>if this doesn&#8217;t get you the version, the game uses a very old Unity, which has the version information towards the end of the file, but for which no Linux support exists anyway. <\/p>\n<h2>Get runtime<\/h2>\n<p>Now you need to find the correct runtime. You can check mainData of Unity games supported on Linux, and copy the respective files over. Something like this: <\/p>\n<p><code>find . -name mainData -print0 | xargs --null grep --with-filename \"4.5.5f1\"<\/code><\/p>\n<p>of course, some people already have collections of runtimes, like this: <a href=\"https:\/\/cloud.mail.ru\/public\/6SdA\/BBgyg3kjy\">https:\/\/cloud.mail.ru\/public\/6SdA\/BBgyg3kjy<\/a><\/p>\n<p>if the runtime you need isn&#8217;t available on your system, you can extract it from the official releases with 7z. The not-so-nice part is, every release comes as a huge .exe with a size of 1GB or more. And there are a lot of releases: <\/p>\n<ul>\n<li><a href=\"http:\/\/unity3d.com\/get-unity\/download\/archive\">http:\/\/unity3d.com\/get-unity\/download\/archive<\/a><\/li>\n<li><a href=\"http:\/\/unity3d.com\/unity\/beta\/archive\">http:\/\/unity3d.com\/unity\/beta\/archive<\/a><\/li>\n<li><a href=\"http:\/\/unity3d.com\/unity\/qa\/patch-releases\">http:\/\/unity3d.com\/unity\/qa\/patch-releases<\/a><\/li>\n<\/ul>\n<p>The useful files within the extracted release are below linuxstandalonesupport\/Variations\/ you&#8217;ll need the files <code>libmono.so<\/code>, <code>ScreenSelector.so<\/code> and <code>LinuxPlayer<\/code> per 32bit\/64bit environment. <\/p>\n<h2>Find Plugins<\/h2>\n<p>After you have all the files from the runtime in the right places, and have renamed them accordingly, you might have noticed, that there are some dll-files in the Plugins directory. You&#8217;ll need to add Linux versions for most of these.<\/p>\n<p>Luckily, there are some very well known plugins, they are used all over the place, and some come with the source as well: <\/p>\n<ul>\n<li><strong>CSteamworks.dll<\/strong>: these are from &#8220;Steamworks.NET&#8221;, and they&#8217;re available from  <a href=\"https:\/\/github.com\/rlabrecque\/Steamworks.NET\">https:\/\/github.com\/rlabrecque\/Steamworks.NET<\/a> The Linux version is called <code>libCSteamworks.so<\/code>, as usual, put the right versions into the directories x86\/x86_64 below Plugins.<\/li>\n<li><strong>SteamworksNative.dll<\/strong> (and SteamworksManaged.dll): They&#8217;re from &#8220;Ludosity&#8217;s Steamworks Wrapper&#8221;, <a href=\"https:\/\/github.com\/reallyjoel\/Ludosity-s-Steamworks-Wrapper\">https:\/\/github.com\/reallyjoel\/Ludosity-s-Steamworks-Wrapper<\/a> and 32bit only. <\/li>\n<li><strong>XInputInterface.dll<\/strong>: apparently comes from <a href=\"https:\/\/github.com\/speps\/XInputDotNet\">https:\/\/github.com\/speps\/XInputDotNet<\/a> <\/li>\n<li><strong>steam_api.dll<\/strong>: Sometimes the developer has implemented the access to the Steam API by itself, in that case, you&#8217;ll only need <code>libsteam_api.so<\/code><\/li>\n<li><strong>FMODUnity.dll<\/strong>: This comes from <a href=\"http:\/\/www.squaretangle.com\/FMODUnity.html\">http:\/\/www.squaretangle.com\/FMODUnity.html<\/a>. Source available.<\/li>\n<li><strong>fmod.dll<\/strong> is <a href=\"http:\/\/www.fmod.org\/download\/\">http:\/\/www.fmod.org\/download\/<\/a> There is no source, but precompiled plugins fo 32bit and 64bit. Difficult to find the one you need.<\/li>\n<li><strong>AkSoundEngine.dll<\/strong> is part of <a href=\"https:\/\/www.audiokinetic.com\/\">https:\/\/www.audiokinetic.com\/<\/a> There&#8217;s a lot of versions of precompiled plugins available, but its difficult to find out which one you might need<\/li>\n<li><strong>UWKPlugin.dll<\/strong> comes from <a href=\"https:\/\/github.com\/zodsoft\/uWebKit-1\">https:\/\/github.com\/uWebKit\/uWebKit<\/a> No compiled plugins for Linux are available, but the source is.<\/li>\n<\/ul>\n<p>The .unitypackage-files can be extracted with <code>tar xvaf<\/code>, but they consist of a salad of directories. <code>file *\/asset<\/code> can tell you what is what, the corresponding filenames are in *\/pathname. <\/p>\n<h4>Fix .unitypackage files<\/h4>\n<p>The .unitypackage-files a lot of plugins are delivered in can be extracted with <code>tar xvaf<\/code>, but they consist of a salad of directories. <code>file *\/asset<\/code> can tell you what is what, the corresponding filenames are in *\/pathname.<\/p>\n<p>This here makes a directory tree from the pathname files:<br \/>\n<code>for i in *; do mkdir -p `dirname $(head -1 $i\/pathname)`  ; done <\/code><br \/>\nAnd this here moves the assets into it and renames them:<br \/>\n<code>for i in *; do mv $i\/asset $(head -1 $i\/pathname)  ; done<\/code><\/p>\n<h2>Cosmetics<\/h2>\n<p>You now can do some cosmetics. Fix the ScreenSelector background:<br \/>\n<code>convert ScreenSelector.bmp ScreenSelector.png<\/code><br \/>\nAnd the Icon:<br \/>\n<code>wrestool -x --type=14 Game.exe | convert ico:-[6] Game_Data\/Resources\/UnityPlayer.png<\/code><\/p>\n<h2>Testing<\/h2>\n<p>Start the game with a logfile parameter to get warnings about missing libraries and other problems:<br \/>\n<code>player.x86 -logfile out.log<\/code><br \/>\nAs mentioned before, &#8220;player&#8221; needs to be replaced with the actual name of the game, and the binaries named accordingly.<\/p>\n<h2>Results<\/h2>\n<p>I basically went over my whole collection of not-yet-available for Linux Unity games I have on steam. I annotated the runtime version and troubles they might have. <\/p>\n<h4>Working Games<\/h4>\n<ul>\n<li>1954 Alcatraz (4.0.1f2)<\/li>\n<li>Coldfire Keep (4.3.4f1)<\/li>\n<li>Dead Bits (4.1.3f3)<\/li>\n<li>DeadEffect (4.6.0f3)<\/li>\n<li>Depths of Fear Knossos (4.6.1f1)<\/li>\n<li>Final Dusk (4.6.1f1)<\/li>\n<li>Gravi (4.5.5f1)<\/li>\n<li>Huntsman The Orphanage (4.2.2f1 needs LD_LIBRARY_PATH for libsteam.api.so)<\/li>\n<li>Last Inua (4.2.2f1)<\/li>\n<li>Lifeless Planet (4.6.7f1)<\/li>\n<li>Once Bitten, Twice Dead! (4.6.1f1)<\/li>\n<li>Overcast &#8211; Walden and the Werewolf (4.1.3f3)<\/li>\n<li>PaperSorcerer (4.1.5f1)<\/li>\n<li>Red Lake (4.3.4f1)<\/li>\n<li>StickItToTheMan (4.3.2f1)<\/li>\n<li>The Dead Linger (4.6.0b20 Some black textures)<\/li>\n<li>The Hat Man Shadow Ward (4.3.4f1)<\/li>\n<li>Train Town (4.5.0f6)<\/li>\n<li>Urja (4.5.4f1)<\/li>\n<li>YearWalk (4.5.5f1)<\/li>\n<\/ul>\n<h4>Games Having Trouble<\/h4>\n<p>Most of these run, but are also unplayable. Some are playable, but not enjoyable because of  missing textures or missing sound.<\/p>\n<ul>\n<li>Air Buccaneer (4.2.0f4 can&#8217;t connect to network?)<\/li>\n<li>BridgeProject (4.5.3f3 x86 crashes, x86_64 does not accept input)<\/li>\n<li>Dead Island Epidemic (4.6.1f1 libs missing, among them http:\/\/www.squaretangle.com\/FMODUnity.html)<\/li>\n<li>Deus Ex The Fall (4.3.4f1 needs LD_LIBRARY_PATH for libsteam.api.so; Wwise sound engine wrong version, playable)<\/li>\n<li>Empyrion &#8211; Galactic Survival (5.2.3f1 hanging?)<\/li>\n<li>Joe Dever\u2019s Lone Wolf (4.5.4f1 self-written plugins)<\/li>\n<li>Melissa K and the Heart of Gold (4.5.3f3 hanging?)<\/li>\n<li>Might &#038; Magic X &#8211; Legacy (4.2.2f1 hanging?)<\/li>\n<li>realMyst Masterpiece Edition (4.5.5p4 broken menu, needs uWebKit)<\/li>\n<li>Slender &#8211; The Arrival (4.5.1p3 Texture problems, playable)<\/li>\n<\/ul>\n<h4>Shader Problems<\/h4>\n<p>The following games all have shader problems. Which basically means you would need to decompile Managed\/Assembly-CSharp.dll and replace the shaders to use there, or to extract the .asset-files and create them anew. Some of these games are playable as they are, but certain things will show up pink.<\/p>\n<ul>\n<li>Astral Terra (5.1.2f1 Shader Problems)<\/li>\n<li>Avenging Angel (5.1.0f3 Shader problems)<\/li>\n<li>Godus Wars (5.2.2f1 Shader problems)<\/li>\n<li>GunsNZombies (5.2.2f1 Shader problems, crashes)<\/li>\n<li>Reign Of Kings (5.1.1p2 Shader problems, needs LD_LIBRARY_PATH for libsteam.api.so)<\/li>\n<li>StarForge (4.5.5f1 Shader problems, needs LD_LIBRARY_PATH for libsteam.api.so)<\/li>\n<li>The Forest (5.1.3p3 Shader problems)<\/li>\n<li>The Tower (5.1.2f1 Shader problems)<\/li>\n<li>Treeker &#8211; The Lost Glasses (5.1.2f1 Shader problems, playable)<\/li>\n<\/ul>\n<h4>Broken on Purpose<\/h4>\n<ul>\n<li>BlockStory (4.6.8f1 Steam-Error: &#8220;Not available on your current platform&#8221;)<\/li>\n<li>Magnetic Cage Closed (4.3.4f1 Steam-Error: &#8220;Not available on your current platform&#8221;)<\/li>\n<li>Republique (5.2.2p4 Steam-Error: &#8220;Not available on your current platform&#8221;)<\/li>\n<li>Stranded Deep (5.2.2f1 Steam-Error: &#8220;Not available on your current platform&#8221;)<\/li>\n<li>Subnautica (5.2.3f1 Steam-Error: &#8220;Not available on your current platform&#8221;)<\/li>\n<\/ul>\n<h4>Unsupported<\/h4>\n<ul>\n<li>Blackguards (3.5.6f4)<\/li>\n<li>Cognition (3.5.7f6)<\/li>\n<li>Commander Jack (3.5.7f6)<\/li>\n<li>creavures (3.4.2f2)<\/li>\n<li>Dementium 2 (3.5.7f6)<\/li>\n<li>Dungeonland (3.5.6f4)<\/li>\n<li>DysanTheShapeshifter (3.4.2f2)<\/li>\n<li>Seamulator 2009 (2.1.0f5)<\/li>\n<li>ShadO (3.5.2f2)<\/li>\n<li>Shelter (3.5.7f6)<\/li>\n<li>Theatre Of The Absurd (3.5.0f5)<\/li>\n<li>Them &#8211; The Summoning (3.4.2f2)<\/li>\n<li>The Witcher Enhanced Edition (3.5.2f2)<\/li>\n<li>Truffle Saga (3.5.7f6)<\/li>\n<li>UnearthedEpisode1 (3.5.7b1)<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The fact is, beginning with Unity 4, just about all games run on Linux as well.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,102],"tags":[],"class_list":["post-971","post","type-post","status-publish","format-standard","hentry","category-computers","category-games"],"_links":{"self":[{"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/posts\/971","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/comments?post=971"}],"version-history":[{"count":36,"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/posts\/971\/revisions"}],"predecessor-version":[{"id":1183,"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/posts\/971\/revisions\/1183"}],"wp:attachment":[{"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/media?parent=971"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/categories?post=971"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/seegras.discordia.ch\/Blog\/wp-json\/wp\/v2\/tags?post=971"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}