Преглед изворни кода

add some proton and game support notes

Casey DeLorme пре 3 година
родитељ
комит
8a1e0cbc61
2 измењених фајлова са 96 додато и 19 уклоњено
  1. 57 19
      notes/proton.md
  2. 39 0
      notes/proton/diablo-2.md

+ 57 - 19
notes/proton.md

@@ -1,7 +1,7 @@
 
 # proton
 
-Steam began providing direct linux support for gaming.
+**Steam began providing direct linux support for gaming!**
 
 In the process they forked Wine and began adding, and back-porting, significant improvements.
 
@@ -10,9 +10,9 @@ Most importantly, the project is open source!
 
 ## [Glorious Eggroll](https://github.com/GloriousEggroll/proton-ge-custom)
 
-This person has created an excellent fork of proton, allowing custom modifications and patches specific to popular games.
+This person has created an excellent fork of proton, allowing custom modifications and patches specific to popular, yet unsupported, games.
 
-You should almost always favor GE builds.
+**You should almost always favor GE builds.**
 
 
 ## [protondb](protondb.com)
@@ -22,22 +22,6 @@ A third party website for people to add, review, and provide supplemental instru
 Basically the answer to [winehq](https://www.winehq.org/).
 
 
-## non-steam games
-
-You can add and run non-steam games using steam and set them up to run with proton!
-
-This process is a bit convoluted:
-
-1. Create a directory inside `~/.local/share/Steam/steamapps/common` for your game to be installed in.
-2. Add an executable (eg. the installer) to that directory.
-3. Add a game in steam, specify the proton version, and then select that installer to run it.
-4. During the installation set the path to be the `~/.local/share/Steam/steamapps/common` directory you setup for the game; during installation this will also create a high numbered directory in `~/.local/share/Steam/steamapps/compatdata`, which will change anytime you modify the target of the steam app.
-5. Change the executable to the correct one after the installer is complete (_this will rename the game in steams library_).
-6. You can add an icon to the application if you have one.
-
-_These instructions need some work due to how the proton/winepath directory creation works._
-
-
 ## launch options
 
 Under `Set Launch Options` you can add various environment variables and common flags to improve performance.
@@ -55,3 +39,57 @@ The `%command%` is required if you add anything, and is the command that will ru
 The flags `-USEALLAVAILABLECORES`, `-high`, and `-vulkan`, are randomly supported by various games, and thus your mileage may vary.
 
 _Another option is to use `PROTON_USE_WINED3D=1`, which suggests using OpenGL instead of DXVK for DX10/DX11 games, which may provide better performance in select cases._
+
+
+## non-steam games
+
+While it is possible to run a non-steam game using proton, adding a game to the Steam UI is absurdly complex.
+
+_To add a non-steam game to steam you need to know the post-installation path for the executable, including any options, and possibly if/when you substitute windows path separators.  After, you need to create a placeholder windows binary, which will create the proton prefix computed off the target and some other properties, find that, manually run from command line the installation to create the expected files and replace the temporary executable._
+
+There is a javascript file showing [how to compute a non-steam application id](https://blog.yo1.dog/calculate-id-for-non-steam-games-js/), but the main take-aways are that the label and target provided are what determines the computed identifier.
+
+Fortunately it is still possible to use proton without needing to mess around with the Steam UI, and you can subsequently launch games using bash scripts.
+
+
+### execution
+
+Steam Proton has some customizations that extend outside of wine configuration.
+
+- `STEAM_COMPAT_DATA_PATH` is a path to a "bottled" environment (eg. `$HOME/.local/share/Steam/steamapps/compatdata/<id>`), and uses the steam game identifier for naming by default.
+- `WINEPREFIX` lives inside `${STEAM_COMPAT_DATA_PATH}/pfx`
+- `WINEPATH` must be set when running `winetricks` or `winecfg` to the proton path (eg. `$HOME/.local/share/Steam/compatibilitytools.d/Proton-5.21-GE-1/dist/bin`).
+
+**_Executing a windows binary must be done from the same path as that binary and giving the full path to that binary, although both linux and windows paths are acceptable._**  While some executables may appear to work without being in the same path, you may experience strange and unexpected behavior as a result.
+
+
+### complex UI instructions
+
+**While these instructions are "accurate", I have only gotten them working once and failed a dozen times after.**
+
+You can add and run non-steam games using steam and set them up to run with proton!
+
+It can be a bit convoluted for a few reasons, here are two:
+
+1. The execution of proton from command line may be necessary to install the game
+2. Preemptive knowledge of install paths may also be required to properly setup the target
+
+This identifier will then be used for creating a `STEAM_COMPAT_DATA_PATH`, which is basically an isolated wine environment (colloquially referred to as a "wine bottle"), and is where consistent modifications such as those performed by winetricks as well as the windows registry often modified during installations exist.
+
+_The aforementioned problem of not knowing the path prior to installation, and needing to use the same prefix after installation due to registry dependencies creates a chicken vs egg situation._
+
+If you do not know the final target path then here is the recommended solution:
+
+1. Create a temporary folder to export `STEAM_COMPAT_DATA_PATH` to while installing with proton.
+2. With the terminal in the installer executable path, and the `STEAM_COMPAT_DATA_PATH` exported as an environment variable, enter the full path to the proton command (eg. `~/.local/share/Steam/compatibilitytools.d/Proton-5.21-GE-1/proton run /full/path/to/installer.exe`), and install to the standard `Program Files` path within `STEAM_COMPAT_DATA_PATH`.
+3. Convert the relative path to the final executable from `Program Files` to get your target path, which can then be used to create a `~/.local/share/Steam/steamapps/common` compatible path to setup and install your game to.
+
+If you do know the final target path, or once you learned it from the above steps:
+
+1. Create a directory inside `~/.local/share/Steam/steamapps/common` for your game to be installed in.
+2. Copy any placeholder executable (eg. the installer or even a shell script) to the final path within the `common/` directory.
+3. From steam add a non-steam game and set the placeholder executable as the target, and edit the properties in order to set the label and enable a specific steam proton version (so that it runs using proton).
+4. Launch the application from steam once in order for it to create the new `~/.local/share/Steam/steamapps/compatdata/<id>` path, then close it.
+5. From a terminal run the installer but this time setting the `STEAM_COMPAT_DATA_PATH` to the newly created `compatdata/` folder based on the application identifier, and install to the `~/.local/share/Steam/steamapps/common` path you chose for your application.  _For this you may need to delete the temporary folder and/or placeholder executable._
+6. Bonus points if you have and want to set an icon to the application.
+

+ 39 - 0
notes/proton/diablo-2.md

@@ -0,0 +1,39 @@
+
+# diablo 2
+
+Easy to install and run, but no dice getting it working through the steam interface.
+
+
+## installation
+
+The files provided by blizzard are actually downloads for the installers, so you can run those with wine if you like.
+
+When ready you may create a your installation then run each installer back-to-back:
+
+	export STEAM_COMPAT_DATA_PATH="$HOME/.local/share/Steam/steamapps/compatdata/d2"
+	export WINEPREFIX="${STEAM_COMPAT_DATA_PATH}/pfx"
+	export WINEPATH="$HOME/.local/share/Steam/compatibilitytools.d/Proton-5.21-GE-1/dist/bin/"
+	"$HOME/.local/share/Steam/compatibilitytools.d/Proton-5.21-GE-1/proton" run /path/to/D2/Installer.exe
+	"$HOME/.local/share/Steam/compatibilitytools.d/Proton-5.21-GE-1/proton" run /path/to/D2-LoD/Installer.exe
+
+_You may select a path within or outside of the prefix at your discretion, though I recommend keeping it self-contained unless you know how to get it linked up to the Steam UI._
+
+> It is highly recommended that you use `winecfg` to set a virtual desktop because these games are old and have really small resolutions which will disrupt your display in full screen mode, and be barely visible in windowed mode, but can be maximized if in windowed mode within a virtual desktop.
+
+It is common to enable ladder-only runewords by downloading [Runes.txt](#) and placing it into the installation path at `Diablo II/data/excel/Runes.txt` then adding `-direct -txt` flags to the launch command.
+
+A launch script can be created (eg. `/usr/local/bin/d2`):
+
+	#!/bin/bash -x
+	export STEAM_COMPAT_DATA_PATH="$HOME/.local/share/Steam/steamapps/compatdata/4170773637"
+	cd "$HOME/.local/share/Steam/steamapps/common/Diablo II"
+	"$HOME/.local/share/Steam/compatibilitytools.d/Proton-5.21-GE-1/proton" run "$HOME/.local/share/Steam/steamapps/common/Diablo II/Diablo II.exe" -direct -txt -w
+
+_If you want you can also add `-seed#` to lock the single player maps from resetting, which can be especially helpful if you find a good map for specific activities._
+
+
+## dualbox
+
+Two separate installations are required if you want to dual-box, and they may need separate keys if you intend to play online.
+
+_I am uncertain whether local network play will function with the same key or not._