BepInEx icon indicating copy to clipboard operation
BepInEx copied to clipboard

Unable to get BepInEx 5.4.20, 5.4.21 to load in Valheim public beta on Steam Deck

Open StevenWolfe opened this issue 2 years ago • 9 comments

What happened?

I'm running the Valheim public beta, default/no compatibility on Steam Deck. I've downloaded the unix build of BepInEx 5.4.21 and unzipped it to the game directory, and made the shell script executable:

cd ~/.local/share/Steam/steamapps/common/Valheim
unzip ~/Downloads/BepInEx_unix_5.4.21.0.zip
chmod +x run_bepinex.sh

And I've updated the launch options in Steam to ./run_bepinex.sh %command%. When the game starts it stays at the Steam loading screen until I hit "Abort", and afterwards I'm not finding BepInEx/config/ in the game directory.

Here's the result (that little .bashrc? You can ignore that little guy): image

Also attempted...

Running the shell script directly

After the above failed, I tried running the shell script directory. I configured it with valheim.x86_64 as the executable. When I run the script I see the following output:

/home/deck/.local/share/Steam/steamapps/common/Valheim/valheim.x86_64
Found UnityPlayer, hooking into it instead

At that point the output ends and I get an exit code of 1. Again afterwards I don't see the BepInEx/config/ directory.

Emulating the Steam invocation of the shell script

With the above changes to the shell script reverted, I tried to capture the %command% contents by configuring Launch Options to be echo "%command% | tee command.txt.

This gives me command.txt with:

/home/deck/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=892970 -- /home/deck/.local/share/Steam/ubuntu12_32/steam-launch-wrapper -- 
'/home/deck/.local/share/Steam/steamapps/common/SteamLinuxRuntime_soldier'/_v2-entry-point --verb=waitforexitandrun -- '
/home/deck/.local/share/Steam/steamapps/common/SteamLinuxRuntime'/scout-on-soldier-entry-point-v2 -- '
/home/deck/.local/share/Steam/steamapps/common/Valheim/valheim.x86_64'

And when I try combining that with the bepinex shell script I get an error:

$ ./run_bepinex.sh /home/deck/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=892970 -- /home/deck/.local/share/Steam/ubuntu12_32/steam-launch-wrapper -- 
'/home/deck/.local/share/Steam/steamapps/common/SteamLinuxRuntime_soldier'/_v2-entry-point --verb=waitforexitandrun -- '
/home/deck/.local/share/Steam/steamapps/common/SteamLinuxRuntime'/scout-on-soldier-entry-point-v2 -- '
/home/deck/.local/share/Steam/steamapps/common/Valheim/valheim.x86_64'

/home/deck/.local/share/Steam/ubuntu12_32/steam-launch-wrapper
/home/deck/.local/share/Steam/ubuntu12_32/steam-launch-wrapper: symbol lookup error: /home/deck/.local/share/Steam/steampapps/common/Valheim/doorstop_libs/libdoorstop_x64.so: undefined symbol: dlopen

BepInEx Distribution

Stable from GitHub

Log outputs

None generated, BepInEx does not appear to start at all.

Environment

- OS: Steam Deck
- BepInEx: 5.4.21
- Game: Valheim

StevenWolfe avatar Dec 06 '22 16:12 StevenWolfe

Greetings!

Because of how Valheim is packaged, the normal base BepInEx distribution from GitHub will not work on it without extra configuration. I suggest giving BepInExPack for Valheim a test which has the necessary files and configuration to run on Valheim. Unfortunately, however, I don't own a Steam Deck to be able to test if one would require some extra steps on it beyond those described in the pack's README. You might even be able to use r2modman or Thunderstore Mod Manager which can handle automatic installation and configuration of BepInEx on different OSs.

ghorsington avatar Dec 06 '22 16:12 ghorsington

Greetings!

Because of how Valheim is packaged, the normal base BepInEx distribution from GitHub will not work on it without extra configuration. I suggest giving BepInExPack for Valheim a test which has the necessary files and configuration to run on Valheim. Unfortunately, however, I don't own a Steam Deck to be able to test if one would require some extra steps on it beyond those described in the pack's README. You might even be able to use r2modman or Thunderstore Mod Manager which can handle automatic installation and configuration of BepInEx on different OSs.

Thanks! I gave it a quick try and had a similar result, but will spend more time on it later to see if I made a simple mistake. If it doesn't work I'll try out the Thunderstore Mod Manager.

StevenWolfe avatar Dec 06 '22 16:12 StevenWolfe

Did you ever find a working solution? I am currently trying to get BepInEx working on my steam deck with no luck so far.

Edit: Tried the BepInEx pack version with the same result.

stingwraith avatar Dec 21 '22 16:12 stingwraith

This isn't Valheim or Deck exclusive. Recently steam has added the reaper to the commands they pass on %command%, so the script run_bepinex.sh doesn't work anymore since it expects 5 arguments instead of 7, the fix is to add the arguments.

--- run_bepinex.sh.old  2022-07-19 20:28:18.000000000 -0500
+++ run_bepinex.sh      2023-02-16 09:57:05.579718753 -0500
@@ -32,7 +32,7 @@
 # Special case: program is launched via Steam
 # In that case rerun the script via their bootstrapper to ensure Steam overlay works
 if [ "$2" = "SteamLaunch" ]; then
-    "$1" "$2" "$3" "$4" "$0" "$5"
+    "$1" "$2" "$3" "$4" "$5" "$6" "$0" "$7"
     exit
 fi

notfood avatar Feb 16 '23 15:02 notfood

This isn't Valheim or Deck exclusive. Recently steam has added the reaper to the commands they pass on %command%, so the script run_bepinex.sh doesn't work anymore since it expects 5 arguments instead of 7, the fix is to add the arguments.

--- run_bepinex.sh.old  2022-07-19 20:28:18.000000000 -0500
+++ run_bepinex.sh      2023-02-16 09:57:05.579718753 -0500
@@ -32,7 +32,7 @@
 # Special case: program is launched via Steam
 # In that case rerun the script via their bootstrapper to ensure Steam overlay works
 if [ "$2" = "SteamLaunch" ]; then
-    "$1" "$2" "$3" "$4" "$0" "$5"
+    "$1" "$2" "$3" "$4" "$5" "$6" "$0" "$7"
     exit
 fi

I have had the same problem over the past 2 days for Ultimate Chicken Horse. I fixed it by also adding more arguments like notfood explained, but for me it took 12 arguments instead of the normal 5.

LucyV4 avatar Feb 17 '23 07:02 LucyV4

This still seems to be a problem on SteamDeck. I was never able to get the Linux version of Bepinex, I could never get it to download/crest the config directory. But once I manually copied data in I ran into same problem described above. Adjusting the variables never resolved the issue. Switching to the windows pack and running the script did work! And I got messages that plug-ins loaded but only if I run the script directly and in desktop mode. But launching just start_bepinex.sh from the launch command line via steam the game does launch but no plug ins get loaded. I am looking for suggestions on how to get the data/logs etc to help troubleshoot this so it can be resolved for all SD users going forward.

docthomas avatar May 05 '23 00:05 docthomas

this issue is still present. @notfood was on the right track but sadly things seem to have changed slightly since his/her contribution. Right now, you have to change the launcher-script to the following:

if [ "$2" = "SteamLaunch" ]; then
    cmd="$1 $2 $3 $4 $5 $6 $0"
    shift 6
    exec $cmd "$@"
    exit
fi

I have also added the quotation marks around the $@ because without it the script fails for system paths that have spaces in them (the parameter list that is accessed with $ considers text after spaces as new parameters and thus cuts the path into multiple parameters)

Tercus avatar May 14 '23 00:05 Tercus

Adding to this as I just got a steam deck the other week, and have been trying to get mods working in valheim...spent hours scouring the internet and ending up here...tried the latest udpates and latest tweaks here to no avail. Anyone get this working or what?

wangmauler avatar Sep 14 '23 04:09 wangmauler

This is definitely still an issue running latest versions of BepInEx and BepInEx for Valheim. /bin/sh: symbol lookup error: doorstop_libs/libdoorstop_x64.so: undefined symbol: dlopen

xMinerv avatar Sep 27 '23 05:09 xMinerv