diff --git a/README.md b/README.md index 78392d7..a0ab918 100644 --- a/README.md +++ b/README.md @@ -1,64 +1,55 @@ # Elden Ring Proton Patcher - -A tool aimed at enhancing the experience when playing the game on linux through proton or natively on windows. - -## Warning - -**This tool is based on patching the game executable through hex-edits. However it is done in a safe and non-destructive way, that ensures the patched executable is never run with EAC enabled (unless explicity told to do so). Use at your own risk!** +A tool aimed at enhancing the experience when playing the game on Linux via Proton or natively on Windows. It safely patches `eldenring.exe`, that is created in a temporary subdirectory and deleted on shutdown, via hex-edits, ensuring the patched executable is run without EAC if no `--with-eac` flag is set. Use it at your own risk. ## Dependencies -- Python >= 3.8 +- Python ≥ 3.8 ## Usage 1. Copy the file `er-patcher` to the game directory. -2. In steam, set the game launch options to `python er-patcher ARGS -- %command%` See [Features](#features) for available options. - - Example: `python er-patcher --all --rate 30 --disable-rune-loss -- %command%` - - Example using the [seamless co-op](https://www.nexusmods.com/eldenring/mods/510) mod: `python er-patcher --all --executable launch_elden_ring_seamlesscoop.exe -- %command%` - - Example using [MangoHud](https://github.com/flightlessmango/MangoHud) and wine fullscreen FSR: `python er-patcher --rate 144 -uvca -- env WINE_FULLSCREEN_FSR=1 MANGOHUD=1 MANGOHUD_CONFIG=histogram %command%` -3. Launch the game through steam. `er-patcher` automatically launches a patched version of `eldenring.exe` with EAC disabled. +2. Set the game's launch options to `python er-patcher ARGS -- %command%` in Steam. See [Features](#features) for available options. + - Example: `python er-patcher --all -r 30 --disable-rune-loss -- %command%` + - Example with [MangoHud](https://github.com/flightlessmango/MangoHud) and Wine fullscreen FSR: `python er-patcher -r 144 -uvca -- env WINE_FULLSCREEN_FSR=1 MANGOHUD=1 MANGOHUD_CONFIG=histogram %command%` + - Example with the [Seamless Co-op](https://www.nexusmods.com/eldenring/mods/510) mod: `python er-patcher --all -x launch_elden_ring_seamlesscoop.exe -- %command%` +3. Run the game on Steam. `er-patcher` automatically runs a patched `eldenring.exe` without EAC. -Note: There might be some distros (e.g. older Ubuntu releases) that launch python 2 instead of 3 when running `python`. In that case you'll need to replace `python` with `python3` in the launch option line. +Note: Some distros (like old Ubuntu versions) run Python 2 instead of 3 when running `python`. You must use `python3` in that case. ## Features -| Argument | Description | -| --------------------------------------- | --------------------------------------------------------------------------------------------------------- | -| `-r RATE` or `--rate RATE` | Set a custom framerate limit (default: 60). | -| `-x EXE` or `--executable EXE` | The executable to launch, relative to the games folder.
Mutually exclusive with `--with-eac`. | -| `--with-eac` | Run game with EAC (Use it at your own risk).
Mutually exclusive with `--executable`. | -| `--disable-rune-loss` | Disable losing runes upon death. | -| `--all` | Enable all options except `--rate`, `--executable`, and
gameplay changes like `--disable-rune-loss`. | -| `-u` or `--ultrawide` | Remove black bars. | -| `-v` or `--disable-vignette` | Remove the vignette overlay. | -| `-c` or `--disable-ca` | Disable chromatic abberation. | -| `-a` or `--increase-animation-distance` | Fix low frame rate animations at screen
edges or for distant entities. | -| `-s` or `--skip-intro` | Skip intro logos at game start. | -| `-f` or `--remove-60hz-fullscreen` | Remove the 60Hz limit in fullscreen
mode (not needed with proton). | +| Argument | Description | +| --- | --- | +| `-r RATE` or `--rate RATE` | Set a custom frame rate limit (default: 60). | +| `-x EXE` or `--executable EXE` | The executable to run, relative to the game's folder.
Mutually exclusive with `--with-eac`. | +| `--with-eac` | Run game with EAC (use it at your own risk).
Mutually exclusive with `--executable`. | +| `--disable-rune-loss` | Disable rune loss upon death. | +| `--all` | Enable all options but `--rate` and gameplay changes like `--disable-rune-loss`. | +| `-u` or `--ultrawide` | Remove black bars on non-16:9 aspect ratios. | +| `-v` or `--disable-vignette` | Remove the vignette. | +| `-c` or `--disable-ca` | Remove chromatic aberration. | +| `-a` or `--increase-animation-distance` | Fix low frame rate animations for distant entities or at screen edges. | +| `-s` or `--skip-intro` | Skip intro logos on startup. | +| `-f` or `--remove-60hz-fullscreen` | Remove 60 Hz lock in fullscreen (unneeded on Proton). | +## Windows support -## Windows Support +The tool works just as well on Windows. This launch option line works if you installed Python from Microsoft Store: -The patcher works just as well on windows. The following launch option line works in case you e.g. installed Python from Microsoft Store: +`python er-patcher -r 165 --all -- %command%` -> `python er-patcher --rate 165 --all -- %command%` +Note: It opens a Python console that closes by itself on shutdown. Use `pythonw` if you find it annoying. `python` needs to be in PATH for Windows to find it. -Note: This spawns a python console which will close by itself after the game has finished running. If you find this annoying you can try using `pythonw` instead. In any case `python` needs to be in PATH for windows to find it. - -## How it works - -When the game is launched through steam, the tool creates a patched version of `eldenring.exe` in a temporary subdirectory while leaving the original intact. As long the flag `--with-eac` is not set, the tool modifies the steam launch command to launch the patched executable instead of `start_protected_game.exe`, thefore ensuring that the patched exe is never run with EAC enabled. After the game is closed, the patched executable is removed. - -## Credits +## References +- [DarkSouls3RemoveIntroScreens](https://github.com/bladecoding/DarkSouls3RemoveIntroScreens) + - Intro logo skip - [EldenRingFpsUnlockAndMore](https://github.com/uberhalit/EldenRingFpsUnlockAndMore) - - frame time limit adjustment - - black bar removal -- [Flawless Widescreen](https://www.flawlesswidescreen.org) - - vignette and ca removal - - animation distance increase -- [DarkSouls3RemoveIntroScreens](https://github.com/bladecoding/DarkSouls3RemoveIntroScreens): intro logo skip + - Black bars removal + - Custom frame rate limit - [EldenRingMods](https://github.com/techiew/EldenRingMods) + [EldenRingFpsUnlockAndMore](https://github.com/uberhalit/EldenRingFpsUnlockAndMore) - - disable rune loss + - Disable rune loss +- [Flawless Widescreen](https://www.flawlesswidescreen.org) + - Animation distance increase + - Chromatic aberration and vignette removal diff --git a/er-patcher b/er-patcher index f328e0d..26d7699 100755 --- a/er-patcher +++ b/er-patcher @@ -13,19 +13,19 @@ if __name__ == "__main__": patcher_args = sys.argv[1:sys.argv.index("--")] - parser = argparse.ArgumentParser(description="Patch Elden Ring executable and launch it without EAC.") + parser = argparse.ArgumentParser(description="Patch `eldenring.exe` and run it without EAC.") - parser.add_argument("-r", "--rate", type=int, default=60, help="Modify the frame rate limit (e.g. 30, 120, 165 or whatever).") - parser.add_argument("-x", "--executable", action='store', type=str, default="eldenring.exe", help="The executable to launch, relative to the games folder.") - parser.add_argument("--with-eac", action='store_true', help="Run game with EAC (Use at own your risk)") - parser.add_argument("--disable-rune-loss", action='store_true', help="Disable losing runes upon death.") - parser.add_argument("--all", action='store_true', help="Enable all options except rate adjustment and gamplay changes like `--disable-rune-loss`.") - parser.add_argument("-u", "--ultrawide", action='store_true', help="Removes black bars when using a resolution with an aspect ratio other than 16:9.") - parser.add_argument("-v", "--disable-vignette", action='store_true', help="Disables the vignette overlay.") - parser.add_argument("-c", "--disable-ca", action='store_true', help="Disables chromatic abberation.") - parser.add_argument("-a", "--increase-animation-distance", action='store_true', help="Increase animation distance.") - parser.add_argument("-s", "--skip-intro", action='store_true', help="Skip intro logos.") - parser.add_argument("-f", "--remove-60hz-fullscreen", action='store_true', help="Remove 60hz lock in fullscreen.") + parser.add_argument("-r", "--rate", type=int, default=60, help="Set a custom frame rate limit (default: 60).") + parser.add_argument("-x", "--executable", action='store', type=str, default="eldenring.exe", help="The executable to run, relative to the game's folder. Mutually exclusive with --with-eac`.") + parser.add_argument("--with-eac", action='store_true', help="Run game with EAC (use it at own your risk). Mutually exclusive with `--executable`.") + parser.add_argument("--disable-rune-loss", action='store_true', help="Disable rune loss upon death.") + parser.add_argument("--all", action='store_true', help="Enable all options but `--rate` and gameplay changes like `--disable-rune-loss`.") + parser.add_argument("-u", "--ultrawide", action='store_true', help="Remove black bars on non-16:9 aspect ratios.") + parser.add_argument("-v", "--disable-vignette", action='store_true', help="Remove the vignette.") + parser.add_argument("-c", "--disable-ca", action='store_true', help="Remove chromatic aberration.") + parser.add_argument("-a", "--increase-animation-distance", action='store_true', help="Fix low frame rate animations for distant entities or at screen edges.") + parser.add_argument("-s", "--skip-intro", action='store_true', help="Skip intro logos on startup.") + parser.add_argument("-f", "--remove-60hz-fullscreen", action='store_true', help="Remove 60 Hz lock in fullscreen (unneded on Proton).") patch = parser.parse_args(patcher_args) if patch.with_eac and patch.executable != "eldenring.exe": @@ -128,7 +128,7 @@ if __name__ == "__main__": (game_dir_patched / d).mkdir(parents=True) # hard link game files to game_dir_patched; symbolic links would be easier - # to handle but by default windows 10 doesn't allow them + # to handle but windows 10 does not allow them by default game_files = [f for f in game_dir.rglob("*") if f.is_file()] for f in game_files: if f.name in ["eldenring.exe", "er-patcher"]: @@ -139,7 +139,7 @@ if __name__ == "__main__": else: f.link_to(game_dir_patched / f) - # start patched exe directly to avoid EAC + # run patched exe directly to avoid EAC steam_cmd = sys.argv[1 + sys.argv.index("--"):] steam_cmd[-1] = Path(steam_cmd[-1]).parent.absolute() / game_dir_patched / ("start_protected_game.exe" if patch.with_eac else patch.executable) subprocess.run(steam_cmd, cwd=steam_cmd[-1].parent.absolute())