diff --git a/README.md b/README.md
index 207df06..377e1d7 100644
--- a/README.md
+++ b/README.md
@@ -15,26 +15,41 @@ A tool aimed at enhancing the experience when playing the game on linux through
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 --fix-camera -- %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%`
+ - 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 ersc_launcher.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%`
+
+ - Example for enabling HDR using gamescope on Linux (reported to work on Plasma 6.1):
+
+ `ENABLE_GAMESCOPE_WSI=1 DXVK_HDR=1 gamescope -W 3440 -H 1440 -f -r 165 --hdr-enabled -- python er-patcher --all --rate 165 -- %command%`
+
3. Launch the game through steam. `er-patcher` automatically launches a patched version of `eldenring.exe` with EAC disabled.
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.
## Features
-| Argument | Description |
-| --------------------------------------- | ------------------------------------------------------------------------------- |
-| `-r RATE` or `--rate RATE` | Set a custom framerate limit (default: 60). |
-| `--with-eac` | Run game with EAC (Use at own your risk) |
-| `--fix-camera` | Disable camera auto-rotation. |
-| `--all` | Enable all options except `--rate` and
gameplay changes like `--fix-camera`. |
-| `-u` or `--ultrawide` | Remove black bars. |
-| `-v` or `--disable-vigniette` | Remove the vigniette 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 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). |
## Windows Support
@@ -45,6 +60,8 @@ The patcher works just as well on windows. The following launch option line work
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.
+Note 2: Ensure Vertical Sync is turned off for Elden Ring in Nvidia Control Panel / AMD Radeon Software / Intel Graphics Command Center, otherwise the custom framerate limit feature won't work.
+
## 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.
@@ -55,7 +72,8 @@ When the game is launched through steam, the tool creates a patched version of `
- frame time limit adjustment
- black bar removal
- [Flawless Widescreen](https://www.flawlesswidescreen.org)
- - vigniette and ca removal
+ - vignette and ca removal
- animation distance increase
- [DarkSouls3RemoveIntroScreens](https://github.com/bladecoding/DarkSouls3RemoveIntroScreens): intro logo skip
-- [EldenRingMods](https://github.com/techiew/EldenRingMods) + [EldenRingFpsUnlockAndMore](https://github.com/uberhalit/EldenRingFpsUnlockAndMore): camera fix
+- [EldenRingMods](https://github.com/techiew/EldenRingMods) + [EldenRingFpsUnlockAndMore](https://github.com/uberhalit/EldenRingFpsUnlockAndMore)
+ - disable rune loss
diff --git a/er-patcher b/er-patcher
index a74707c..2e51c39 100755
--- a/er-patcher
+++ b/er-patcher
@@ -1,6 +1,5 @@
#!/usr/bin/env python3
-import os
import sys
import subprocess
import argparse
@@ -8,32 +7,53 @@ from pathlib import Path
import struct
import re
from shutil import rmtree
+import os
+import time
+def cleanup(game_dir_patched):
+ if game_dir_patched.exists():
+ eldenring_path = game_dir_patched / "eldenring.exe"
+ while eldenring_path.exists():
+ try:
+ os.remove(eldenring_path)
+ break
+ except PermissionError:
+ # eldenring.exe is still running, retry in 3 s
+ time.sleep(3)
+ except Exception as e:
+ print(f"er-patcher: could not delete {eldenring_path}: {e}")
+ break
+ rmtree(game_dir_patched)
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.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("--fix-camera", action='store_true', help="Disable camera auto-rotation.")
- parser.add_argument("--all", action='store_true', help="Enable all options except rate adjustment and gamplay changes like `--fix-camera`.")
+ 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-vigniette", action='store_true', help="Disables the vigniette overlay.")
+ 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.")
patch = parser.parse_args(patcher_args)
+ if patch.with_eac and patch.executable != "eldenring.exe":
+ print("er-patcher: --with-eac is mutually exclusive with --executable")
+ sys.exit(1)
+
game_dir = Path(".")
with open(game_dir / "eldenring.exe", "rb") as f:
exe_hex = f.read().hex()
if patch.rate != 60 and patch.rate > 0:
- r_pattern = "c7 43 20 89 88 88 3c eb 43 89 73 18 eb ca 89 73 18".replace(" ", "")
+ r_pattern = "c7 43 1c 89 88 88 3c eb 6d 89 73 18 eb c7 89 73 18".replace(" ", "")
if (res := re.search(r_pattern, exe_hex)) is not None:
r_addr = res.span()[0] + 6
r_patch = struct.pack('= 10:
+ (game_dir_patched / f).hardlink_to(f)
+ else:
+ f.link_to(game_dir_patched / f)
# start 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 "eldenring.exe")
+ 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())
- # cleanup
- rmtree(game_dir_patched)
+ # try to remove game_dir_patched
+ cleanup(game_dir_patched)