Difference between revisions of "Linux"

From GTAMods Wiki
Jump to navigation Jump to search
(Game compatibility: Added V status for Wine)
m (Fix GTA 5 link)
 
(One intermediate revision by one other user not shown)
Line 61: Line 61:
 
|{{Icon|3}}||Good [https://appdb.winehq.org/objectManager.php?sClass=application&iId=936 AppDB]||Excellent [https://www.protondb.com/app/12100 ProtonDB]
 
|{{Icon|3}}||Good [https://appdb.winehq.org/objectManager.php?sClass=application&iId=936 AppDB]||Excellent [https://www.protondb.com/app/12100 ProtonDB]
 
|-
 
|-
|{{Icon|VC}}||Good [https://appdb.winehq.org/objectManager.php?sClass=application&iId=1369 AppDB]||Good [https://www.protondb.com/app/12110 ProtonDB]
+
|{{Icon|VC}}||Good [https://appdb.winehq.org/objectManager.php?sClass=application&iId=1369 AppDB]||Excellent [https://www.protondb.com/app/12110 ProtonDB]
 
|-
 
|-
|{{Icon|SA}}||Excellent [https://appdb.winehq.org/objectManager.php?sClass=application&iId=2599 AppDB]||Good [https://www.protondb.com/app/12120 ProtonDB]
+
|{{Icon|SA}}||Excellent [https://appdb.winehq.org/objectManager.php?sClass=application&iId=2599 AppDB]||Excellent [https://www.protondb.com/app/12120 ProtonDB]
 
|-
 
|-
 
|{{Icon|IV}}||Good [https://appdb.winehq.org/objectManager.php?sClass=application&iId=8757 AppDB]||Good [https://www.protondb.com/app/12210 ProtonDB]
 
|{{Icon|IV}}||Good [https://appdb.winehq.org/objectManager.php?sClass=application&iId=8757 AppDB]||Good [https://www.protondb.com/app/12210 ProtonDB]
Line 69: Line 69:
 
|EFLC||Excellent [https://appdb.winehq.org/objectManager.php?sClass=application&iId=12586 AppDB]||Good [https://www.protondb.com/app/12220 ProtonDB]
 
|EFLC||Excellent [https://appdb.winehq.org/objectManager.php?sClass=application&iId=12586 AppDB]||Good [https://www.protondb.com/app/12220 ProtonDB]
 
|-
 
|-
|{{Icon|V}}||Broken [https://appdb.winehq.org/objectManager.php?sClass=application&iId=16807 AppDB]||Excellent [https://www.protondb.com/app/12170 ProtonDB]
+
|{{Icon|V}}||Broken [https://appdb.winehq.org/objectManager.php?sClass=application&iId=16807 AppDB]||Excellent [https://www.protondb.com/app/271590 ProtonDB]
 
|}
 
|}
  

Latest revision as of 07:49, 13 July 2019

Introduction

To date there has not been any game in the GTA franchise released with a native Linux port. Similarly most modding tools distributed in executable form are Windows-compatible binaries. Documented here are various ways to run and mod GTA games under Linux, in particular using Wine and its forks. Known solutions are:

  • Run the game inside a virtual machine (eg. Virtualbox). This isn't recommended - the latency and resource overhead is likely to negatively impact the performance of the game.
  • Recreate the original executable as a Linux executable (eg. openrw). This obviously doesn't provide a solution for modding tools that are Windows executables. Additionally mods that work by manipulating the original executable won't work either.
  • Run the Windows executable using a compatibility layer (eg. Wine or Steam's fork of Wine Proton). Theoretically performance can be less, equal or better than performance in Windows, though crashes are possible if a required feature hasn't been implemented. This is currently the most reliable way of modding GTA under Linux.

Using Wine or a Wine fork such as Proton

With Steam

Using Wine with Steam can be awkward since the game is launched via Steam, so you need to run the Steam client for Windows in Wine too. Alternatively, use the Steam client for Linux and enable Steam Play in order to automatically use Proton (Valve's fork of Wine) for your games. You can enable it via Settings -> Steam Play inside the Steam client.

Without Steam

Consider using a seperate Wine prefix for each game. If you'd like to use Proton instead of Wine, install it from your package manager or build it from source.

Mod compatibility

The vast majority of GTA mods across the franchise are implemented through substitution - they either replace original content, or replace original original configuration in order to introduce new content. This includes vehicle, weapon and character mods. As long as you can run the vanilla, un-modded game under Linux, these mods will work under Linux too.

Since the fundamental obstacle to working under Linux are Windows executables, conflicts may arise when using mods that also target the executable. For example; Wine, unlike Windows, will not automatically use Alexander Blade's dinput8.dll from Script Hook V when executing GTAV.exe from the same directory - a DLL override needs to be configured.

Below is a table of mods that are either broken or require additional configuration to work.

Name Game DLL overrides Windows libraries and components
Script Hook V GTA V dinput8
Script Hook V .NET GTA V dotnet472, vcrun2017

Tool compatibility

Most tools are distributed as Windows executables. Some luck may be found running these through Wine, eg.:

$ wine imgtool.exe

If you try testing a tool, consider adding a report to Wine's AppDB to save time for others.

If you're developing a tool, consider making it Linux compatible, but most of all consider releasing the source code under a licence that allows the community to release it for Linux and develop/maintain it. Hundreds of modding tools have been developed for GTA over the last 20 years, but many have been lost to incompatibility, unreliability and a lack of portability.

Game compatibility

Note that some of the descriptions below may become outdated - please click the links to verify if functionality has improved (even better - update this page!).

Game Wine Proton (Steam Play)
GTA 1 Excellent AppDB Broken ProtonDB
GTA 2 Mixed AppDB Excellent ProtonDB
GTA III Good AppDB Excellent ProtonDB
Vice City Good AppDB Excellent ProtonDB
San Andreas Excellent AppDB Excellent ProtonDB
GTA IV Good AppDB Good ProtonDB
EFLC Excellent AppDB Good ProtonDB
GTA V Broken AppDB Excellent ProtonDB

Wine prefixes

A wine prefix is a directory in which a Windows environment exists (essentially a "C: drive" and registry). You can specify where Wine should find such an environment using the shell variable WINEPREFIX. A default environment will usually exist in ~/.wine and will default to that if WINEPREFIX isn't set. These prefixes don't take up much space, so some prefer to use a different prefix for every application they use (benefits include just deleting the environment without affecting anything else if it becomes unwieldy or mysteriously broken). Proton incidentally does exactly this - each Wine prefix lives in /path/to/steam/SteamApps/compatdata/<game ID>/pfx.

DLL overrides

If you have a DLL in your game directory that you want used before the default, you need add it as an override.

Run winecfg on the Wine prefix:

$ WINEPREFIX=/path/to/steam/SteamApps/compatdata/<game ID>/pfx winecfg

It may ask you to install Gecko a couple of times - just click Cancel. Under the Libraries tab, add the exact name of your DLL (without the file extension), and click Add. It should appear in the list - and should be marked native, builtin. This means it'll prefer your DLL over the one built into Wine.

Windows libraries and components

Sometimes a tool or mod you're trying to use requires a library. For example, The .NET plugin for Script Hook V relies on the .NET Framework v4.7.2 and the Visual C++ Redistributable for Visual Studio 2017 x64.

Run winetricks (you may have to install it from your package manager) on the Wine prefix:

$ WINEPREFIX=/path/to/steam/SteamApps/compatdata/<game ID>/pfx winetricks

Choose Select the default wineprefix - this means it'll use the WINEPREFIX variable or the default if that's missing, but it's not very clear. Choose Install a Windows DLL or component, then select the various items you're after. For example the .NET plugin for Script Hook V will need dotnet472 and vcrun2017.