Difference between revisions of "Linux"

From Kerbal Space Program Wiki
Jump to: navigation, search
(accomplished, check grammar!)
m (Reverted edits by Rocketing Rudolph (talk) to last revision by Endoril)
 
(13 intermediate revisions by 7 users not shown)
Line 3: Line 3:
 
== Running on non-English localized systems ==
 
== Running on non-English localized systems ==
 
===Source of the problem===
 
===Source of the problem===
KSP doesn't work on some localization, because the English writes the decimal fractions with points (<code>3.1415</code>), and in other languages uses comma (<code>3,1415</code>). As a result of this, the Unity engine is attempting to use one method for writing and tries another method to read.
+
KSP doesn't work on some localization, because English uses decimal fractions with a decimal point (<code>3.1415</code>), and other languages use a comma (<code>3,1415</code>). As a result of this, the Unity engine is attempting to use one method for writing and another method to read.
  
 
[[File:Ksp steam command.jpeg|thumbnail|Command line on Steam]]
 
[[File:Ksp steam command.jpeg|thumbnail|Command line on Steam]]
For starting in English localization use this command line:
+
For starting [[KSP]] in English localization use this command line:
  
 
<code>LC_ALL=C ./KSP.x86</code>
 
<code>LC_ALL=C ./KSP.x86</code>
Line 14: Line 14:
 
<code>LC_ALL=C ./KSP.x86_64</code>
 
<code>LC_ALL=C ./KSP.x86_64</code>
  
The command lines can be used in console, placed in shell file or in the command or in the command line of menus. For '''Steam''' version the file name has to be replaced with the <code>%command%:
+
The command lines can be used in console, placed in shell file, in the command or in the command line of menus. For the '''Steam''' version the file name has to be replaced with the <code>%command%:
  
 
<code>LC_ALL=C %command%</code>
 
<code>LC_ALL=C %command%</code>
Line 24: Line 24:
 
''(See the picture on the right)''
 
''(See the picture on the right)''
  
== Text is missing in menus and the game ==
+
== Text is missing in menus in the game ==
 
=== Source of the problem ===
 
=== Source of the problem ===
The game needs Arial and Arial Black fonts not installed.
+
The game needs Arial and Arial Black fonts to be installed.
 
=== Solution ===
 
=== Solution ===
In case of Debian based systems (Ubuntu, Mint) install the "Microsoft TrueType core fonts" package (or something like this), in case of AchLinux  "ttf-ms-fonts" package, and so in case of other distros too.
+
In case of Debian based systems (Ubuntu, Mint) install the "Microsoft TrueType core fonts" (ttf-mscorefonts-installer) package (or something similar), in case of AchLinux  "ttf-ms-fonts" package, and so in case of other distros too.
 +
 
 +
=== Since KSP 1.1 ===
 +
Under Linux (all distributions) the Unity game engine encounter an occasional compatibility issue that cause few menus (including settings panel) to not show text at all under certain screen resolution.
 +
 
 +
=== Solution ===
 +
You can try to launch the game with different screen resolution by manually editing the [[settings.cfg]] file of KSP (seems to work with few config) this file can be found at the [[root directory]] of KSP.
 +
 
 +
A solution that work with any screen resolution is to add the <code>-force-glcore</code> as launch option. Under Steam go to: Library -) right click on KSP -) Proprieties -) Set up launch options and add <code>-force-glcore</code> The game engine will try to run the game with the best OpenGL version possible and all available OpenGL extensions as explained in the [http://docs.unity3d.com/Manual/OpenGLCoreDetails.html Unity 3D documentation]
 +
 
 +
With this option enabled you may encounter shadow glitches, try few different settings in-game in the setting panel to resolve the problem.
 +
 
 +
[http://bugs.kerbalspaceprogram.com/issues/7493 This issue] has been reported but it seems that it will not be fixed until the next game engine release.
 +
 
 +
== Text is unreadable, letters are replaced by squares ==
 +
=== Source of the problem ===
 +
If you have an ATI graphic card, you need to enable AMD compatibility mode. This is not a Linux-specific issue.
 +
=== Solution ===
 +
You have two ways to handle this problem :
 +
* From the settings in KSP launcher, select "advanced" then check "Run in AMD compatibility mode".
 +
* From Steam: go to Library, right click on KSP, select "Properties", click on "Set launch options..." and add <code>-force-gfx-st</code>
 +
 
 +
== Desktop menus appear when clicking buttons in KSP ==
 +
=== Source of the problem ===
 +
Fullscreen windows are "click-through" under Gnome Shell. You have to disable unredirect feature.
 +
=== Solution ===
 +
Temporary fix (you have to re-enable this workaround every time you restart your session) :
 +
* Run 'Looking Glass' (Alt+F2, type 'lg', hit enter)
 +
* Enter 'Meta.disable_unredirect_for_screen(global.screen);'
 +
 
 +
Permanent fix :
 +
* create a .desktop file under "~/.config/autostart/" (for example, "gnome3_disable_unredirect.desktop")
 +
* edit the previously created file, add the content below and save it
 +
 
 +
<syntaxhighlight lang="bash">
 +
[Desktop Entry]
 +
Type=Application
 +
Exec=/bin/bash -c "gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval 'Meta.disable_unredirect_for_screen(global.screen);'"
 +
</syntaxhighlight>
 +
 
 +
Note that:
 +
* you need to be root to create and edit the .desktop file
 +
* the .desktop file does not need to be executable
 +
* you have to restart your session for change to take effect, or apply the temporary fix
  
 
== Mods ==
 
== Mods ==
 
===Source of the problem===
 
===Source of the problem===
There are no problems. The mods are usually compatible with each-others, and you do not have to pay special attention of compatibility of {{color|darkgreen|mod}}.dll -s.
+
There are no problems. Mods are usually compatible with each other, and you do not have to pay special attention of compatibility of {{color|darkgreen|mod}}.dll files.
  
 
== 64-bit version ==
 
== 64-bit version ==
 
===Source of the problem===
 
===Source of the problem===
The [[KSP]] sometimes can run out of memory, especially if you use many mods - the 32-bit application cannot handle memory over 4GB, and the 64-bit Linux version has a small bug, but can be cured before use.
+
[[KSP]] can sometimes run out of memory, especially if you use many mods; the 32-bit application cannot handle memory over 4GB, and the 64-bit Linux version has a small bug, which can be fixed before use.
 
===Solution===
 
===Solution===
At first ensure about your system is 64-bit version (if you not sure). For the command <code>uname --hardware-platform</code> it has to reply <code>x86_64</code>.
+
{{Box|type=warning|This solution modifies the KSP.x86_64 executable. Make a backup of it first, because if not applied correctly this can cause various errors and break the executable.}}
 
+
This works only on a 64-bit system. The command <code>uname --hardware-platform</code> replies <code>x86_64</code> on 64 bit systems.
In the game directory there has to be a file named <code>KSP.x86_64</code>. This file needs a repair. Open a console in the game directory.
 
  
If you are not in the game directory, go there:
+
In the [[root directory]] is the executable named <code>KSP.x86_64</code> which needs to be patched. First you need to change to the directory using [[w:cd (command)|cd]] depending on your installed directory. Two bytes need to be set to 0, depending on the installed version:
 
 
<code>cd "$HOME/.local/share/Steam/SteamApps/common/Kerbal Space Program/"</code>
 
 
 
''($HOME - your personal home directory)''
 
 
 
:The correction commands for the KSP different versions:
 
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! version !! commands
+
! Version
 +
! Positions
 
|-
 
|-
| 0.24 — 0.24.2||
+
| 0.24 — 0.24.2
<code>echo "0099f587: 00" | xxd -r - KSP.x86_64<br>
+
| <code>0099f587</code> and <code>0099f58c</code>
echo "0099f58c: 00" | xxd -r - KSP.x86_64</code>
 
 
|-
 
|-
| 0.23.5 ||
+
| 0.23.5
<code>echo "090f377: 00" | xxd -r - KSP.x86_64<br>
+
| <code>090f377</code> and <code>090f37c</code>
echo "090f37c: 00" | xxd -r - KSP.x86_64</code>
 
 
|-
 
|-
| 0.23 ||
+
| 0.23
<code>echo "838077: 00" | xxd -r - KSP.x86_64<br>
+
| <code>838077</code> and <code>83807c</code>
echo "83807c: 00" | xxd -r - KSP.x86_64</code>
 
 
|}
 
|}
 +
For example for version 0.24.2 it looks like:
 +
<pre>
 +
echo "0099f587: 00" | xxd -r - KSP.x86_64
 +
echo "0099f58c: 00" | xxd -r - KSP.x86_64
 +
</pre>
  
====the universal patcher from [https://github.com/Voidi/proprietary_installer/blob/master/ksp_installer Voidi]====
+
==== Automatic script ====
<syntaxhighlight enclose="div" lang="text">
+
Alternatively based on [https://github.com/Voidi/proprietary_installer/blob/master/ksp_installer ksp_installer] by Voidi, the following script will automatically search for the erroneous position and fix it. It'll also backup the original file as <code>KSP.x86_64.unpatched</code> if anything has gone wrong.
 +
<syntaxhighlight lang="bash">
 
#!/bin/sh
 
#!/bin/sh
 
position1=$(echo "obase=16; $(perl -n0777e 'print pos()-1,"\n" while /\x01\x00\x00\x00\xB8\x01\x00\x00\x00\xC3\x41\x56\x41\x55\x49/g' "./KSP.x86_64") - E" | bc)
 
position1=$(echo "obase=16; $(perl -n0777e 'print pos()-1,"\n" while /\x01\x00\x00\x00\xB8\x01\x00\x00\x00\xC3\x41\x56\x41\x55\x49/g' "./KSP.x86_64") - E" | bc)
Line 83: Line 123:
 
From now, only your <u>hardware</u> limits the usable memory. Install as many mods as you wish.
 
From now, only your <u>hardware</u> limits the usable memory. Install as many mods as you wish.
  
Start: <code>KSP.x86_64</code>
+
==64-bit on Steam==
 
+
===Source of the problem===
Start with localization: <code>LC_ALL=C ./KSP.x86_64</code>
+
Steam installs both 32- and 64-bit versions of KSP, but even on 64-bit systems launches the 32-bit by default.
 
+
===Solution===
In case of '''Steam''': <code>LC_ALL=C %command%_64</code>
+
Tell Steam to launch the 64-bit version instead by editing the launch parameters.  Right-click on the game in your Steam library listing and go to "properties".  In the "General" tab (which should be the one that opens by default), click the "Set launch options..." button.  In most cases, this box will be empty - insert the text <code>%command%_64</code> and click OK. If there is text in the box (because you've added flags, you're using Bumblebee, or you followed the instructions above for non-English localised systems), you'll need to insert the same text at the start (if <code>%command%</code> doesn't already appear) or change <code>%command%</code> to <code>%command%_64</code> (if it does).
  
 
==Joystick==
 
==Joystick==
The joystick has to work by default. If your joystick is not available for the game, check the availability for Linux: <code>ls -l /dev/input/js* /dev/js*</code>. If the command is not replied with any file, that means there is noe driver installed. If you have driver install it, for example in case of Fedora install <code>kernel-modules-extra</code> package. If the driver is installed, plug in the joystick, and try again!
+
The joystick has to work by default. If your joystick is not available for the game, check the availability for Linux: <code>ls -l /dev/input/js* /dev/js*</code>. If the command is not replied with any file, that means there is no driver installed. If you have the driver install it, for example in case of Fedora install <code>kernel-modules-extra</code> package. If the driver is installed, plug in the joystick, and try again!
  
 
==External Links==
 
==External Links==

Latest revision as of 18:26, 17 March 2017

This section contains information about Kerbal Space Program on operation systems based on GNU/Linux.

Running on non-English localized systems

Source of the problem

KSP doesn't work on some localization, because English uses decimal fractions with a decimal point (3.1415), and other languages use a comma (3,1415). As a result of this, the Unity engine is attempting to use one method for writing and another method to read.

Command line on Steam

For starting KSP in English localization use this command line:

LC_ALL=C ./KSP.x86

for the 64-bit version:

LC_ALL=C ./KSP.x86_64

The command lines can be used in console, placed in shell file, in the command or in the command line of menus. For the Steam version the file name has to be replaced with the %command%:

<code>LC_ALL=C %command%

for the 64-bit version:

LC_ALL=C %command%_64

(See the picture on the right)

Text is missing in menus in the game

Source of the problem

The game needs Arial and Arial Black fonts to be installed.

Solution

In case of Debian based systems (Ubuntu, Mint) install the "Microsoft TrueType core fonts" (ttf-mscorefonts-installer) package (or something similar), in case of AchLinux "ttf-ms-fonts" package, and so in case of other distros too.

Since KSP 1.1

Under Linux (all distributions) the Unity game engine encounter an occasional compatibility issue that cause few menus (including settings panel) to not show text at all under certain screen resolution.

Solution

You can try to launch the game with different screen resolution by manually editing the settings.cfg file of KSP (seems to work with few config) this file can be found at the root directory of KSP.

A solution that work with any screen resolution is to add the -force-glcore as launch option. Under Steam go to: Library -) right click on KSP -) Proprieties -) Set up launch options and add -force-glcore The game engine will try to run the game with the best OpenGL version possible and all available OpenGL extensions as explained in the Unity 3D documentation

With this option enabled you may encounter shadow glitches, try few different settings in-game in the setting panel to resolve the problem.

This issue has been reported but it seems that it will not be fixed until the next game engine release.

Text is unreadable, letters are replaced by squares

Source of the problem

If you have an ATI graphic card, you need to enable AMD compatibility mode. This is not a Linux-specific issue.

Solution

You have two ways to handle this problem :

  • From the settings in KSP launcher, select "advanced" then check "Run in AMD compatibility mode".
  • From Steam: go to Library, right click on KSP, select "Properties", click on "Set launch options..." and add -force-gfx-st

Desktop menus appear when clicking buttons in KSP

Source of the problem

Fullscreen windows are "click-through" under Gnome Shell. You have to disable unredirect feature.

Solution

Temporary fix (you have to re-enable this workaround every time you restart your session) :

  • Run 'Looking Glass' (Alt+F2, type 'lg', hit enter)
  • Enter 'Meta.disable_unredirect_for_screen(global.screen);'

Permanent fix :

  • create a .desktop file under "~/.config/autostart/" (for example, "gnome3_disable_unredirect.desktop")
  • edit the previously created file, add the content below and save it
[Desktop Entry]
Type=Application
Exec=/bin/bash -c "gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval 'Meta.disable_unredirect_for_screen(global.screen);'"

Note that:

  • you need to be root to create and edit the .desktop file
  • the .desktop file does not need to be executable
  • you have to restart your session for change to take effect, or apply the temporary fix

Mods

Source of the problem

There are no problems. Mods are usually compatible with each other, and you do not have to pay special attention of compatibility of mod.dll files.

64-bit version

Source of the problem

KSP can sometimes run out of memory, especially if you use many mods; the 32-bit application cannot handle memory over 4GB, and the 64-bit Linux version has a small bug, which can be fixed before use.

Solution

This solution modifies the KSP.x86_64 executable. Make a backup of it first, because if not applied correctly this can cause various errors and break the executable.

This works only on a 64-bit system. The command uname --hardware-platform replies x86_64 on 64 bit systems.

In the root directory is the executable named KSP.x86_64 which needs to be patched. First you need to change to the directory using cd depending on your installed directory. Two bytes need to be set to 0, depending on the installed version:

Version Positions
0.24 — 0.24.2 0099f587 and 0099f58c
0.23.5 090f377 and 090f37c
0.23 838077 and 83807c

For example for version 0.24.2 it looks like:

echo "0099f587: 00" | xxd -r - KSP.x86_64
echo "0099f58c: 00" | xxd -r - KSP.x86_64

Automatic script

Alternatively based on ksp_installer by Voidi, the following script will automatically search for the erroneous position and fix it. It'll also backup the original file as KSP.x86_64.unpatched if anything has gone wrong.

#!/bin/sh
position1=$(echo "obase=16; $(perl -n0777e 'print pos()-1,"\n" while /\x01\x00\x00\x00\xB8\x01\x00\x00\x00\xC3\x41\x56\x41\x55\x49/g' "./KSP.x86_64") - E" | bc)
if [ $position1 != "-E" ]
then
	echo "Patching Segfault out of the Rockets ..."
	cp -n "./KSP.x86_64" "./KSP.x86_64.unpatched"
	position2=$(echo "obase=16;ibase=16; $position1 + 5" | bc)
	echo "$position1: 00" | xxd -r - "./KSP.x86_64"
	echo "$position2: 00" | xxd -r - "./KSP.x86_64"
else
	echo "This seems to be not a vanilla KSP executable"
fi

From now, only your hardware limits the usable memory. Install as many mods as you wish.

64-bit on Steam

Source of the problem

Steam installs both 32- and 64-bit versions of KSP, but even on 64-bit systems launches the 32-bit by default.

Solution

Tell Steam to launch the 64-bit version instead by editing the launch parameters. Right-click on the game in your Steam library listing and go to "properties". In the "General" tab (which should be the one that opens by default), click the "Set launch options..." button. In most cases, this box will be empty - insert the text %command%_64 and click OK. If there is text in the box (because you've added flags, you're using Bumblebee, or you followed the instructions above for non-English localised systems), you'll need to insert the same text at the start (if %command% doesn't already appear) or change %command% to %command%_64 (if it does).

Joystick

The joystick has to work by default. If your joystick is not available for the game, check the availability for Linux: ls -l /dev/input/js* /dev/js*. If the command is not replied with any file, that means there is no driver installed. If you have the driver install it, for example in case of Fedora install kernel-modules-extra package. If the driver is installed, plug in the joystick, and try again!

External Links

KSP Linux compatibility forum

https://wiki.archlinux.org/index.php/Kerbal_Space_Program - KSP on Archwiki