Playing in Linux: Difference between revisions

From OniGalore
Jump to navigation Jump to search
m (Iritscen moved page Linux Oni to Playing in Linux without leaving a redirect: clearer name)
(solution for the sound problem, though it turns out to be due to my testing with a VM, so probably no one needs this advice but me)
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
There is no official support for Oni on a Linux family of OSes.<br/>
{{UpdatedForOniX|1.0.0}}
Nevertheless, it is still possible to run the game on Linux.<br>
{{Hatnote|If you are looking for help running Oni on the Steam Deck, see [[Playing on the Steam Deck]] for much simpler instructions.}}
[[Anniversary Edition/Installer/Updater]] can be made to run as well.
There is no official support for Oni in the Linux OS family. Nevertheless, it is still possible to run the game on Linux. The [[Anniversary Edition]] Installer can be made to run as well.


==Requirements==
==Installing the needed packages==
; [https://www.winehq.org Wine]
; Wine
: An application used as a compatiblity layer in order to run Windows applications on a Linux machine.
: A compatibility layer for running Windows applications on a Linux machine.
: For maximum convenience, it is recommended to install the Wine directly from an official repository of the given Linux distribution (it is natively supported by a wide array of distros).
# Open a Linux terminal and search for Wine packages. You need to know what your package manager is: apk, apt, dnf, emerge, pacman, yum, zypp…. Tell the package manager to search for "wine" and look for a 32-bit Wine package in the results. The package might be called "wine32" or "wine.i686". If you don't see either of those options, you may need to enable 32-bit architecture with a command such as (in Ubuntu) <code>sudo dpkg --add-architecture i386</code> followed by <code>sudo apt update</code>, then search again. In order to install Wine, the package manager may also need to install a ton of dependencies if this a fairly new Linux install, but it will probably not take too long.
: Wine 5.5 was tested to be be capable of flawlessly running Oni and AEInstaller.


; [https://wiki.winehq.org/Winetricks Winetricks]
; Winetricks
: Helper script for configuring various parts of Wine-created compatibility environments.
: A helper app for configuring various parts of Wine-created compatibility environments.
: In some distros, Winetricks is installed alongside the Wine itself.
# In some distros, Winetricks is installed alongside Wine itself. However it generally needs to be installed as a separate package, so search for "winetricks" and install it if it already hasn't been.
: In other distors, it needs to be installed as a separate package.


; A legacy JAVA Runtime Environment offline installer for 32bit (aka x86) version of Windows XP.
You'll need this for installing the Anniversary Edition, if you want it (the game can be patched to run without installing the AE; this is covered below):
: Max compatible version is '''7u65'''.
; A legacy Java Runtime Environment offline installer for the 32-bit (AKA x86) version of Windows XP
: Unfortunately, the [https://www.oracle.com/java/technologies/javase/javase7-archive-downloads.html official Oracle download page] requires a subscription in order to download legacy versions of JRE.
: The maximum compatible version is '''7u65'''. An installer for 7u25 is still hosted [https://javadl.oracle.com/webapps/download/AutoDL?BundleId=78825 here].
: An obscure link through legacy Sun Microsystems website (former developer of the JAVA platform) was found. The link ( [https://javadl.sun.com/webapps/download/AutoDL?BundleId=78825 click here] ) can be used to download a JRE 7u25 offline installer.


==How to prepare "Oni" WINEPREFIX==
==Preparing the Wine prefix==
# Open a Linux terminal and create a new WINEPREFIX (a new instance of the Wine compatibility environment) by executing the following sequence of commands:
# Open a Linux terminal and create a new Wine prefix (an instance of the Wine compatibility environment) with these commands:
#: <code> export WINEARCH=win32 </code>
#: <code>export WINEARCH=win32</code>
#: <code> export WINEPREFIX=/full_path_to_the_folder_where_this_WINEPREFIX_will_be_located </code>
#: <code>export WINEPREFIX=/full/path/to/prefix</code> (where you want the prefix to be stored, e.g. "~/Documents/Wine/Oni"; the game itself can be installed somewhere else on your hard drive – this is just the compatibility layer for it).
#: <code> winecfg </code>
#: <code>winecfg</code>
# The sequence of commands from the step 1 creates a new 32bit WINEPREFIX in the requested folder and opens a "Wine configuration" GUI tool.
# This creates a 32-bit Wine prefix in the requested folder and opens a "Wine configuration" GUI tool. In the GUI tool, under the "Applications" tab, change the target Windows version to "Windows XP" and click "OK".
#: In the GUI tool, on the "Applications" tab, change the target Windows version to the "Windows XP". Then click on the OK button.
# Still in the same terminal (with all the export symbols defined), tell Winetricks to execute the necessary configuration changes:
# Still in the same terminal (with all the export symbols defined) run Winetricks script to execute necessary configuration changes:
#: <code>winetricks corefonts msacm32</code>
#: <code> winetricks corefonts msacm32 </code>
# '''If you're going to install the AE''': Still in the same terminal (with all the export symbols defined), use the "cd" command to navigate to the folder with the Java Runtime Environment installer. Install the JRE into the given Wine prefix like this (assuming the installer is named "jre-7u25-windows-i586.exe"):
# Still in the same terminal (with all the export symbols defined) use '''cd''' command and navigate to the folder with the Java Runtime offline installer (let's assume the installer is named "jre-7u25-windows-i586.exe").<br/>Install the JRE into the given WINEPREFIX.
#: <code>cd /full/path/to/JRE/installer</code>
#: <code> cd /full_path_to_the_JRE_offline_installer </code>
#: <code>wine jre-7u25-windows-i586.exe</code>
#: <code> wine jre-7u25-windows-i586.exe </code>
# The "Oni" Wine prefix is now ready. Remember, that in order to run either Oni or the AE Installer, the path to this prefix file must be specified (exported). If it is not specified, then the Wine session will use a default prefix file, one which is probably set to represent 64-bit Windows 7 or 64-bit Windows 10 (which is quite sensible for most applications, but unfortunately not good enough for Oni).
# The "Oni" WINEPREFIX is now ready.<br/>Remember, that in order to run either Oni or AEInstaller, path to this WINEPREFIX must be specified (exported).<br/>If it is not specified, then the WINE application will use a default WINEPREFIX, and that one is probably set to represent 64bit Windows 7 or 64bit Windows 10 (which is quite sensible for most applications, but unfortunately not good enough for Oni).


==How to install Oni==
==Installing Oni==
# Insert Oni installation medium into the CD/DVD drive (if installed from the CD, 00's style ^_^).
Skip to the next section if you have an existing installation of Oni.
# Open a Linux terminal, export "Oni" WINEPREFIX, navigate to the folder with contents of the mounted CD drive and initiate the installation process.
# Insert your Oni CD-ROM into the disc drive (if installing from the CD, 2001-style ^_^).
#: <code> export WINEPREFIX=/full_path_to_the_folder_where_Oni_WINEPREFIX_is_located </code>
# Open a Linux terminal, export the "Oni" prefix file, navigate to the folder with the contents of the mounted CD, and initiate the installation process.
#: <code> cd /full_path_to_the_contents_of_the_Oni_installation_medium </code>
#: <code>export WINEPREFIX=/full/path/to/prefix</code>
#: <code> wine OniSetup.exe </code>
#: <code>cd /path/to/Oni/CD</code> (you may have to open the CD in your file manager to see its path, e.g. /run/media/[user name]/001228_1801/ or /media/[user name]/001228_1801/)
#: During the installation process, it is recommended to '''NOT''' place the game inside the WINEPREFIX compatibility environment folder (do '''not''' place it anywhere on the faux "C:\" drive).
#: <code>wine onisetup.exe</code> or <code>wine OniSetup.exe</code> (the capitalization of the EXE varies)
#: Instead, choose an appropriate place somewhere in the Linux machine directory tree. Linux machine directory tree should be by default mapped as a different faux drive (usually it is mapped as drive "z:\")
# During the installation process, it is recommended to '''NOT''' place the game inside the prefix file's compatibility environment folder (that is, do '''not''' place it anywhere on the faux "C:\" drive). Instead, choose an appropriate place somewhere in your Linux machine's directory tree. The computer's native directory tree should be mapped by default as a different faux drive (usually "Z:\").
# The game should install without problems. Ignore the warning regarding DirectX 7, it is harmless.
# The game should install without problems. When GLSetup runs and offers to install OpenGL, make sure to say '''"No"'''.
# DO NOT RUN THE GAME YET!!!<br/>An attempt to run the raw Oni on a modern system is almost guaranteed to fail as Oni will most probably unceremoniously crash.<br/>The game needs to be patched via AEInstaller.
# DO NOT RUN THE GAME YET!!! An attempt to run an unpatched copy of Oni on a modern system is almost guaranteed to fail. The game needs to be patched via the AE Installer.


==How to install AEInstaller==
==Installing AE Installer==
This is a rather straightforward process.
This is a rather straightforward process which builds on an Oni installation.
# Download the latest Windows version of the AEInstaller from the Oni Mod Depot ( [http://mods.oni2.net/node/79 click here] ).
# Download the latest Windows version of the AE Installer from the Oni Mod Depot ([http://mods.oni2.net/node/79 click here]).
# Open a Linux terminal, export "Oni" WINEPREFIX, navigate to the folder with the AEInstaller and initiate the installation process.
# Open a Linux terminal, export the "Oni" prefix, navigate to the folder with the AE Installer, and initiate the installation process.
#: <code> export WINEPREFIX=/full_path_to_the_folder_where_Oni_WINEPREFIX_is_located </code>
#: <code>export WINEPREFIX=/full/path/to/prefix</code>
#: <code> cd /full_path_to_the_AEInstaller </code>
#: <code>cd /full/path/to/folder/with/AE/Setup</code>
#: <code> wine Anniversary-Edition-Setup-vXX.YY_ZZ.exe </code>
#: <code>wine Anniversary-Edition-Setup-vXX.YY_ZZ.exe</code>
#: During the AEInstaller installation, there will be a prompt to provide Oni installation directory.
# During the AE Installer installation, there will be a prompt to provide Oni's installation directory. Navigate to the appropriate directory. Your Linux system's directory tree should be mapped to "/".
#: Navigate to the appropriate directory. Linux machine directory tree should be mapped as a drive "/".
# At the end of the installation, the AE Installer will be automatically executed and will attempt to fetch updates. During the fetching process, it may appear that the AE Installer has hanged. That is not true, it just does not indicate that there is work being done in the background. Be patient.
# At the end of the installation, the AEInstaller will be automatically executed and will attempt to fetch updates.
#: During the fetching process, it may appear that the AEInstaller has hanged. That is not true, it just does not signalize that there is some work being done in the background. Be patient.


==How to launch AEInstaller==
==Launching AE Installer==
# AEInstaller will be automatically launched once - during the installation process of the AEInstaller. Nice.
The AE Installer will be automatically launched after it is installed. However, any other time you want to launch the AE Installer, open a Linux terminal, export the "Oni" prefix, navigate to the folder with the '''AEInstaller2Updater.jar''' file, and launch the .jar file through Wine Java Runtime Environment:
# However, to normally launch the AEInstaller as a user, open a Linux terminal, export "Oni" WINEPREFIX, navigate to the folder with the '''AEInstaller2Updater.jar''' file and launch the jar file through Wine JAVA Runtime Environment.
: <code>export WINEPREFIX=/full/path/to/prefix</code>
#: <code> export WINEPREFIX=/full_path_to_the_folder_where_Oni_WINEPREFIX_is_located </code>
: <code>cd /full/path/to/folder/with/AE/Installer</code>
#: <code> cd /full_path_to_the_AEInstaller2Updater.jar </code>
: <code>wine start /ProgIDOpen jarfile AEInstaller2Updater.jar</code>
#: <code> wine start /ProgIDOpen jarfile AEInstaller2Updater.jar </code>


==Patch Oni via AEInstaller==
==Patching/modding Oni via AE Installer==
# Let the AEInstaller do its magic. ^_^
Simply let the AE Installer do its magic. ^_^


==How to launch patched Oni==
==Launching patched Oni==
There are two possible ways to launch Oni.
There are two possible ways to launch Oni:<br>
# Launch the game through the AEInstaller application.
A. Launch the game through the AE Installer application.<br>
# Open a Linux terminal, export "Oni" WINEPREFIX, navigate to the folder with the patched Oni.exe file and launch it via Wine.
B. Open a Linux terminal, export the "Oni" prefix, navigate to the folder with the patched Oni.exe file, and launch it via Wine.
#: <code> export WINEPREFIX=/full_path_to_the_folder_where_Oni_WINEPREFIX_is_located </code>
: <code>export WINEPREFIX=/full/path/to/prefix</code>
#: <code> cd /full_path_to_the_patched_Oni.exe </code>
: <code>cd /full/path/to/folder/with/patched/Oni/EXE</code>
#: <code> wine Oni.exe </code>
: <code>wine Oni.exe</code>


==????==
==Troubleshooting==
# PROFIT! ^_^
;Gunfire kills the frame rate
Some users experience a large drop in frame rate when certain actions occur such as firing a gun. This is a sound-related bug which indicates that you didn't follow step 3 under "Preparing the Wine prefix" :-) Make sure to install msacm32 with winetricks.
 
;Sound stutters so badly that it's mostly inaudible
This is only known to happen if you are running Linux inside of a VM, particularly Fedora Linux. The audio server, pipewire, does not allow enough headroom for virtualization. This can be fixed by making a copy of the config file:
:<code>mkdir -p ~/.config/wireplumber/main.lua.d</code>
:<code>cp /usr/share/wireplumber/main.lua.d/50-alsa-config.lua ~/.config/wireplumber/main.lua.d</code>
…and then editing ~/.config/wireplumber/main.lua.d/50-alsa-config.lua to change this portion of the file as follows:
  ["vm.node.defaults"] = {
    ["api.alsa.period-size"] = 2048,
    ["api.alsa.headroom"] = 16384,
  },
You may be able to get by with the numbers 1024 and 8192, but if that doesn't work, try raising them to the above figures. Unfortunately, the higher the numbers, the more latency Oni's sound will have.
 
[[Category:Oni Support]]

Latest revision as of 14:58, 23 July 2023

If you are looking for help running Oni on the Steam Deck, see Playing on the Steam Deck for much simpler instructions.

There is no official support for Oni in the Linux OS family. Nevertheless, it is still possible to run the game on Linux. The Anniversary Edition Installer can be made to run as well.

Installing the needed packages

Wine
A compatibility layer for running Windows applications on a Linux machine.
  1. Open a Linux terminal and search for Wine packages. You need to know what your package manager is: apk, apt, dnf, emerge, pacman, yum, zypp…. Tell the package manager to search for "wine" and look for a 32-bit Wine package in the results. The package might be called "wine32" or "wine.i686". If you don't see either of those options, you may need to enable 32-bit architecture with a command such as (in Ubuntu) sudo dpkg --add-architecture i386 followed by sudo apt update, then search again. In order to install Wine, the package manager may also need to install a ton of dependencies if this a fairly new Linux install, but it will probably not take too long.
Winetricks
A helper app for configuring various parts of Wine-created compatibility environments.
  1. In some distros, Winetricks is installed alongside Wine itself. However it generally needs to be installed as a separate package, so search for "winetricks" and install it if it already hasn't been.

You'll need this for installing the Anniversary Edition, if you want it (the game can be patched to run without installing the AE; this is covered below):

A legacy Java Runtime Environment offline installer for the 32-bit (AKA x86) version of Windows XP
The maximum compatible version is 7u65. An installer for 7u25 is still hosted here.

Preparing the Wine prefix

  1. Open a Linux terminal and create a new Wine prefix (an instance of the Wine compatibility environment) with these commands:
    export WINEARCH=win32
    export WINEPREFIX=/full/path/to/prefix (where you want the prefix to be stored, e.g. "~/Documents/Wine/Oni"; the game itself can be installed somewhere else on your hard drive – this is just the compatibility layer for it).
    winecfg
  2. This creates a 32-bit Wine prefix in the requested folder and opens a "Wine configuration" GUI tool. In the GUI tool, under the "Applications" tab, change the target Windows version to "Windows XP" and click "OK".
  3. Still in the same terminal (with all the export symbols defined), tell Winetricks to execute the necessary configuration changes:
    winetricks corefonts msacm32
  4. If you're going to install the AE: Still in the same terminal (with all the export symbols defined), use the "cd" command to navigate to the folder with the Java Runtime Environment installer. Install the JRE into the given Wine prefix like this (assuming the installer is named "jre-7u25-windows-i586.exe"):
    cd /full/path/to/JRE/installer
    wine jre-7u25-windows-i586.exe
  5. The "Oni" Wine prefix is now ready. Remember, that in order to run either Oni or the AE Installer, the path to this prefix file must be specified (exported). If it is not specified, then the Wine session will use a default prefix file, one which is probably set to represent 64-bit Windows 7 or 64-bit Windows 10 (which is quite sensible for most applications, but unfortunately not good enough for Oni).

Installing Oni

Skip to the next section if you have an existing installation of Oni.

  1. Insert your Oni CD-ROM into the disc drive (if installing from the CD, 2001-style ^_^).
  2. Open a Linux terminal, export the "Oni" prefix file, navigate to the folder with the contents of the mounted CD, and initiate the installation process.
    export WINEPREFIX=/full/path/to/prefix
    cd /path/to/Oni/CD (you may have to open the CD in your file manager to see its path, e.g. /run/media/[user name]/001228_1801/ or /media/[user name]/001228_1801/)
    wine onisetup.exe or wine OniSetup.exe (the capitalization of the EXE varies)
  3. During the installation process, it is recommended to NOT place the game inside the prefix file's compatibility environment folder (that is, do not place it anywhere on the faux "C:\" drive). Instead, choose an appropriate place somewhere in your Linux machine's directory tree. The computer's native directory tree should be mapped by default as a different faux drive (usually "Z:\").
  4. The game should install without problems. When GLSetup runs and offers to install OpenGL, make sure to say "No".
  5. DO NOT RUN THE GAME YET!!! An attempt to run an unpatched copy of Oni on a modern system is almost guaranteed to fail. The game needs to be patched via the AE Installer.

Installing AE Installer

This is a rather straightforward process which builds on an Oni installation.

  1. Download the latest Windows version of the AE Installer from the Oni Mod Depot (click here).
  2. Open a Linux terminal, export the "Oni" prefix, navigate to the folder with the AE Installer, and initiate the installation process.
    export WINEPREFIX=/full/path/to/prefix
    cd /full/path/to/folder/with/AE/Setup
    wine Anniversary-Edition-Setup-vXX.YY_ZZ.exe
  3. During the AE Installer installation, there will be a prompt to provide Oni's installation directory. Navigate to the appropriate directory. Your Linux system's directory tree should be mapped to "/".
  4. At the end of the installation, the AE Installer will be automatically executed and will attempt to fetch updates. During the fetching process, it may appear that the AE Installer has hanged. That is not true, it just does not indicate that there is work being done in the background. Be patient.

Launching AE Installer

The AE Installer will be automatically launched after it is installed. However, any other time you want to launch the AE Installer, open a Linux terminal, export the "Oni" prefix, navigate to the folder with the AEInstaller2Updater.jar file, and launch the .jar file through Wine Java Runtime Environment:

export WINEPREFIX=/full/path/to/prefix
cd /full/path/to/folder/with/AE/Installer
wine start /ProgIDOpen jarfile AEInstaller2Updater.jar

Patching/modding Oni via AE Installer

Simply let the AE Installer do its magic. ^_^

Launching patched Oni

There are two possible ways to launch Oni:
A. Launch the game through the AE Installer application.
B. Open a Linux terminal, export the "Oni" prefix, navigate to the folder with the patched Oni.exe file, and launch it via Wine.

export WINEPREFIX=/full/path/to/prefix
cd /full/path/to/folder/with/patched/Oni/EXE
wine Oni.exe

Troubleshooting

Gunfire kills the frame rate

Some users experience a large drop in frame rate when certain actions occur such as firing a gun. This is a sound-related bug which indicates that you didn't follow step 3 under "Preparing the Wine prefix" :-) Make sure to install msacm32 with winetricks.

Sound stutters so badly that it's mostly inaudible

This is only known to happen if you are running Linux inside of a VM, particularly Fedora Linux. The audio server, pipewire, does not allow enough headroom for virtualization. This can be fixed by making a copy of the config file:

mkdir -p ~/.config/wireplumber/main.lua.d
cp /usr/share/wireplumber/main.lua.d/50-alsa-config.lua ~/.config/wireplumber/main.lua.d

…and then editing ~/.config/wireplumber/main.lua.d/50-alsa-config.lua to change this portion of the file as follows:

 ["vm.node.defaults"] = {
   ["api.alsa.period-size"] = 2048,
   ["api.alsa.headroom"] = 16384,
 },

You may be able to get by with the numbers 1024 and 8192, but if that doesn't work, try raising them to the above figures. Unfortunately, the higher the numbers, the more latency Oni's sound will have.