Skip to content

Commit

Permalink
Merge pull request #166 from techtonik/wiki
Browse files Browse the repository at this point in the history
Move wiki to docs/
  • Loading branch information
simons-public authored Aug 14, 2021
2 parents 060ceaa + 3f81f9d commit f52dbaa
Show file tree
Hide file tree
Showing 7 changed files with 297 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/Blacklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Blacklisting games

Gamefixes can be blacklisted from using the included gamefix by creating a local gamefix with a `main` that does nothing.

``` shell
echo 'main = lambda: None' > ~/.config/protonfixes/localfixes/GAMEID.py
```

For example, to bypass the included gamefix for *A Hat in Time*:

``` shell
echo 'main = lambda: None' > ~/.config/protonfixes/localfixes/253230.py
```
25 changes: 25 additions & 0 deletions docs/Gamefix-Utilities.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
- `util.protontricks('verb')`
- installs a winetricks verb
- `util.use_win32_prefix()`
- creates and uses a win32 (32bit) wineprefix
- `util.replace_command('original', 'replacement')`
- replaces text in the game's launch command
- `util.append_argument('argument')`
- adds an argument to the game's launch command
- `util.protonprefix()`
- returns the path of the current wineprefix used by Proton
- `util.set_environment('VARIABLE', 'value')`
- sets an environment variable
- `util.winedll_override('dllname', 'x')`
- override dllname where x is n for native, b for builtin, or '' for disable
- winedll_override shortcuts:
- `util.disable_dxvk()`
- `util.disable_esync()`
- `util.disable_d3d10()`
- `util.disable_d3d11()`
- `util.disable_nvapi()`
- `util.get_game_install_path()`
- returns the path to the current game
- `util.create_dosbox_conf('filename', conf_dict)`
- creates a config file filename with the dict conf_dict
_(needs to have '-conf' and 'filename' added with util.append_argument for dosbox use config)_
9 changes: 9 additions & 0 deletions docs/Home.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Welcome to the protonfixes wiki!

### [List of Fixes](https://github.com/simons-public/protonfixes/wiki/List-Of-Fixes)

### [Writing Game Fixes](https://github.com/simons-public/protonfixes/wiki/Writing-Gamefixes)

### [Known Issues](https://github.com/simons-public/protonfixes/wiki/Known-Issues)

### [Blacklisting](https://github.com/simons-public/protonfixes/wiki/Blacklist)
7 changes: 7 additions & 0 deletions docs/Known-Issues.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
These are known issues (usually wine related) that cannot be fixed by protonfixes.

### Installing MSI Files in Proton 3.16-3
There is an issue installing MSI files in Proton 3.16-3 that stems from a. If you are using Proton 3.16, please upgrade to a newer version.

### Trigger Axis
On Proton 3.16 some games may treat the XBox and Steam Controller trigger axis as a joystick input causing controls to drift upwards and to the left (this can be observed by running '/tmp/proton_$USER/run control' and looking at the Test Joystick tab under Game Controllers.
64 changes: 64 additions & 0 deletions docs/List-of-Fixes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
- A Hat in Time
- Age Of Empire 3: Complete Collection
- Age of Mythology: Extended Edition
- BIT.TRIP RUNNER
- Banished
- Batman Arkham Asylum
- Batman Arkham City
- Battlefield: Bad Company 2
- BioShock 2 Remastered
- Borderlands 2
- Call of Duty (2003)
- Chantelise - A Tale of Two Sisters
- Chronophantasma Extend
- Civilization 4 (Beyond the Sword)
- Crashday Redline Edition
- Crysis
- Cuphead
- DMC Devil May Cry
- Dark Sould Prepare To Die Edition
- Dark Souls Remastered
- Default gamefix for running from Steam launch options
- Divinity Original Sin 2
- Doom 2016
- EVE Online
- FINAL FANTASY IX
- Fallout: New Vegas
- Forts
- Killer is Dead at Launch
- Little Nightmares
- Metal Slug
- Metal Slug 2
- Metal Slug 3
- Oddworld: Abe's Oddysee
- Oddworld: Munch's Oddysee
- Order of Battle: World War II
- PixARK
- Plants vs. Zombies: Game of the Year
- Portal Knights
- Potatoman Seeks the Troof
- Puyo Puyo Tetris
- Recettear: An Item Shop's Tale
- Retro/Grade
- RiME
- Rise of Nations: Extended Edition
- Rising Storm/Red Orchestra 2 Multiplayer
- STAR WARS Jedi Knight - Jedi Academy
- STAR WARS Jedi Knight II - Jedi Outcast
- SUGURI 2
- Sacred 2 Gold
- Serious Sam Double D XXL
- Serious Sam: The Random Encounter
- Sleeping Dogs: Definitive Edition
- Spacewar
- Stealth Inc 2: A Game of Clones
- Strange Brigade
- Styx: Master of Shadows
- Tesla Effect
- The Elder Scrolls V: Skyrim Special Edition
- The Evil Within(268050)
- Thief 2
- Thief Gold
- Titan Quest Anniversary Edition(475150)
- Tomb Raider I
- You Need a Budget 4
49 changes: 49 additions & 0 deletions docs/Proton-user_settings.py-examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
### Example using a copy of the default user_settings.sample.py renamed to user_settings.py
To just enable protonfixes, all that must be done is to add the `import protonfixes` line to the bottom of the file.
```python
#to enable these settings, name this file "user_settings.py"

user_settings = {
#logs are saved to $HOME/steam-$STEAM_APP_ID.log, overwriting any previous log with that name
"WINEDEBUG": "+timestamp,+pid,+tid,+seh,+debugstr,+module",

"DXVK_LOG_LEVEL": "info",

#Enable DXVK's HUD
# "DXVK_HUD": "devinfo,fps",

#Use wined3d for d3d11 instead of dxvk
# "PROTON_USE_WINED3D11": "1",

#Disable d3d11 entirely
# "PROTON_NO_D3D11": "1",

#Disable in-process synchronization primitives
# "PROTON_NO_ESYNC": "1",
}

import protonfixes
```


### Example with protonfixes debugging turned on

```python
#to enable these settings, name this file "user_settings.py"
user_settings = {
#logs are saved to $HOME/steam-$STEAM_APP_ID.log, overwriting any previous log with that name
"WINEDEBUG": "+timestamp,+pid,+tid,+seh,+debugstr,+module",
"DXVK_LOG_LEVEL": "info",
#Enable DXVK's HUD
# "DXVK_HUD": "devinfo,fps",
#Use wined3d for d3d11 instead of dxvk
# "PROTON_USE_WINED3D11": "1",
#Disable d3d11 entirely
# "PROTON_NO_D3D11": "1",
#Disable in-process synchronization primitives
# "PROTON_NO_ESYNC": "1",
}

from protonfixes import debug
import protonfixes
```
130 changes: 130 additions & 0 deletions docs/Writing-Gamefixes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
## Writing Game Fixes
Game fixes are written in python and are named by the Steam game ID with the extension .py. For example, the file `377840.py` will be loaded when the game FINAL FANTASY IX is run. Gamefixes can be added to the `~/.config/protonfixes/localfixes/` directory. Here are some things to consider when writing fixes:

- Only import libraries that are part of the Python standard library for portability.
- Use docstrings and comment thoroughly. There will likely be people without python experience making game fixes and good commented examples will help
- Do not use any hard-coded paths, Steam may not always be installed in the same location.
- Check your gamefix with pylint. You can safely disable warning C0103, modules named by Steam ID will never conform to snake_case naming style.
- Check over at https://github.com/GloriousEggroll/protonfixes. Although the gamefixes there may rely on features in proton-ge, some may work with little or no modification.

### Testing
When testing, local fixes can be added to `~/.config/protonfixes/localfixes/`. They should be imported the same way as an included fix would be. For example, `~/.config/protonfixes/localfixes/377840.py` would be loaded for FFIX. Please feel free to submit working gamefixes to improve the project.

If you mess up your Proton prefix and you want to start fresh, just delete the directory in `~/.local/share/Steam/compatdata/GAMEID`, Proton will recreate it automatically

### Debugging
Proton output can be seen in either `/tmp/dumps/${USER}_stdout.txt` or the terminal you started Steam from. To add additional `protonfixes` debugging information, add the following line above `import protonfixes`:
```python
from protonfixes import debug
```
This will add information like this:
```
ProtonFixes[27351] DEBUG: ---- begin protontricks debug info ----
ProtonFixes[27351] DEBUG: Proton Python Version:
ProtonFixes[27351] DEBUG: /usr/bin/python3
ProtonFixes[27351] DEBUG: 3.7.0 (default, Jul 15 2018, 10:44:58)
[GCC 8.1.1 20180531]
ProtonFixes[27351] DEBUG: ---------------------------------------
```
Although the environment variables are dumped, the sensitive variables like SteamUser and SteamAppUser are filtered out.


### Gamefix utilities
These helper functions can be used in a game fix by importing the util submodule:
```python
from protonfixes import util
```

- `util.protontricks('verb')`
- installs a winetricks verb
- `util.use_win32_prefix()`
- creates and uses a win32 (32bit) wineprefix
- `util.replace_command('original', 'replacement')`
- replaces text in the game's launch command
- `util.append_argument('argument')`
- adds an argument to the game's launch command
- `util.protonprefix()`
- returns the path of the current wineprefix used by Proton
- `util.set_environment('VARIABLE', 'value')`
- sets an environment variable
- `util.winedll_override('dllname', 'x')`
- override dllname where x is n for native, b for builtin, or '' for disable
- winedll_override shortcuts:
- `util.disable_dxvk()`
- `util.disable_esync()`
- `util.disable_d3d10()`
- `util.disable_d3d11()`
- `util.disable_nvapi()`
- `util.get_game_install_path()`
- returns the path to the current game
- `util.create_dosbox_conf('filename', conf_dict)`
- creates a config file filename with the dict conf_dict
_(needs to have '-conf' and 'filename' added with util.append_argument for dosbox use config)_


---
### Example game fixes
`377840.py` - Changing the executable launched and setting an environment variable
```python
""" Game fix for FINAL FANTASY IX
"""
#pylint: disable=C0103

from protonfixes import util
from protonfixes.logger import log

def main():
""" Changes the proton argument from the launcher to the game
"""

log('Applying fixes for FINAL FANTASY IX')

# Fix crackling audio
util.set_environment('PULSE_LATENCY_MSEC', '60')

# Replace launcher with game exe in proton arguments
util.replace_command('FF9_Launcher.exe', 'x64/FF9.exe')
```

`410900.py` - Running a winetricks verb
```python
""" Game fix for Forts
"""
#pylint: disable=C0103

from protonfixes import util
from protonfixes.logger import log

def main():
""" Uses winetricks to install the ole32 verb
"""

log('Applying fixes for Forts')

util.protontricks('ole32')
```
`15700.py` - Example using a win32 prefix

*Oddworld doesn't actually require a win32 prefix or dotnet35, but I used it for testing since it's 32bit*
```python

from protonfixes import util
from protonfixes.logger import log

def main():
""" Adds -interline to arguments, uses a win32 prefix, and installs dotnet35
"""

log('Applying fixes for Oddworld: Abe\'s Oddysee')

# Adding -interline fixes slow video but adds scanlines
util.append_argument('-interline')

log('Using a win32 prefix')
util.use_win32_prefix()

# Make sure any winetricks are run after changing to a win32 prefix
util.protontricks('dotnet35')
```


0 comments on commit f52dbaa

Please sign in to comment.