Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
simons-public committed Oct 8, 2018
1 parent 67d8671 commit bbb1772
Showing 1 changed file with 37 additions and 18 deletions.
55 changes: 37 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,43 @@
# protonfixes

A module for applying fixes at runtime to unsupported games with Steam Proton without changing game installation files. The idea is to include seperate fixes that are only loaded when a game matching that ID is run. This should keep the individual game fixes from affecting any other games. Applying the fixes at runtime should also allow fixes to persist after game updates.
![Screenshot](https://github.com/simons-public/protonfixes/raw/master/media/splash.png)

A module for applying fixes at runtime to unsupported games with Steam Proton without changing game installation files. The idea is to include seperate fixes that are only loaded when a game matching that ID is run. This should keep the individual game fixes from affecting any other games. Applying the fixes at runtime should also them to persist after game updates.

Current fixes include:
- Final Fantasy IX
- Oddworld: Abe's Oddysee
- Forts
- Styx: Master of Shadows

Current utilities available:
- 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

## Installation

### Requirements
### Optional Requirements
**Winetricks**

If you want to be able to use fixes with winetricks it must be installed and be in your $PATH. Fixes that do not use winetricks will still work without winetricks being installed.

*Winetricks can take a long time to load*

If you want to use a win32 (32bit) prefix, you need to have wine installed and be in your $PATH. Currently creating a 32bit prefix with Proton wine doesn't work because wineserver is already running by the time `user_settings.py` is loaded.
**Wine**

If you want to use a win32 (32bit) prefix, you need to have wine installed and be in your $PATH. Currently creating a 32bit prefix with Proton wine doesn't work because the wineserver is already running by the time `user_settings.py` is loaded.

**Splashscreen**

For the splashscreen to work, you need to have `cefpython3` installed. It can be installed with pip using `sudo pip install cefpython3`. The splashscreen can help let you know that protonfixes is running a long task, for example installing `dotnet35`.

### Install from PIP
```
Expand All @@ -26,14 +49,14 @@ If you want to use a win32 (32bit) prefix, you need to have wine installed and b
# sudo python setup.py install
```
### Add to user_settings.py
In the steamapps/common/Proton* directory, add the following line to `user_settings.py`:
In the steamapps/common/Proton* directory, add the following line to the `user_settings.py` file:
```
import protonfixes
```
If there is no `user_settings.py` file, make a copy of the `user_settings.sample.py` file.
If there is no `user_settings.py` file, make a copy of the `user_settings.sample.py` file included with Proton.

## Writing Game Fixes
Game fixes written in python and are named by the Steam game ID with the extension .py. For example, the file `gamefixes/377840.py` will be loaded when the game FINAL FANTASY IX is run. Here are some things to consider when writing 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
Expand All @@ -44,14 +67,14 @@ Game fixes written in python and are named by the Steam game ID with the extensi
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.

## Example game fixes
`377840.py` - Changing the executable launched
`377840.py` - Changing the executable launched and setting an environment variable
```python
import os
import sys
from protonfixes import util


def main():
""" Changes the proton argument from the launcher to the game
""" Bypass the launcher and fix audio
"""

print('Applying FINAL FANTASY IX Game Fixes')
Expand All @@ -60,9 +83,7 @@ def main():
os.environ['PULSE_LATENCY_MSEC'] = '60'

# Replace launcher with game exe in proton arguments
for idx, env in enumerate(sys.argv):
if 'FF9_Launcher' in env:
sys.argv[idx] = env.replace('FF9_Launcher.exe', 'x64/FF9.exe')
util.replace_command('FF9_Launcher', 'x64/FF9.exe')
```

`410900.py` - Running a winetricks verb
Expand All @@ -75,8 +96,7 @@ def main():

print('Applying fixes for Forts')

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

Expand All @@ -90,16 +110,15 @@ def main():
"""

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

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

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

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

## Contributing
Expand Down

0 comments on commit bbb1772

Please sign in to comment.