Closed BlueAmulet closed 3 years ago
Greetings!
Doorstop and BepInEx are known to work with Valheim. The problem is that current builds of the game come with stripped mono base class library assemblies. In other words, some unused code was removed from game assemblies. In case of Valheim, many types used by BepInEx (and even example assembly in this repo) are stripped away which. Doorstop itself does its job fine.
At the moment, the fix is to restore the stripped assemblies by taking them directly from Unity Editor 2019.4.16.
I already did that as an example for Valheim:
Simply extract this archive into Valheim_Data\Managed
folder and overwrite when asked. After that BepInEx will indeed boot:
In general, I would suggest to contact the game developer and ask them to disable assembly stripping when building. Assembly stripping is not enabled by default in Unity which means that a developer for Valheim explicitly enabled it.
If you are a Unity game developer (or if you contact a developer for a Unity game): There are many reasons why assembly unstripping is not a good option for Unity games. Here is a list of them:
Managed
folder is 6.71 MB right now (with stripping). When stripping is disabled, the folder size goes up to just 16.1 MB. If just a 10 MB difference still sounds like a lot, the difference is just about 1% of the entire game size (about 1 GB). If you want to optimize your game size for stripping to really matter, optimize your assets first.Managed
folder becomes about 4.3 MB. The size of the compressed and stripped Managed
folder of Valheim is in turn 2.0 MB using LZMA. In other words, instead of downloading 10 MB you're downloading about 2 MB more. At the same time, most other assets like images and audio are much less compressible. As such, if you want to really save size, optimize your assets and not assemblies.All in all, if you're a developer, please do not enable assembly unstripping in Unity. If you are unsure how, it is extremely easy to do in Player settings:
I will close this issue as it is confirmed not to be Doorstop one. I'll however also pin this one for other Valheim modders to see until the developer stop shipping their assemblies stripped.
It seems that the unstripped_managed.7z
file you sent is missing some dlls from it that prevent using MonoMod with the game. In my case, as a Linux user, the missing dlls were System.Security.dll
, System.Numerics.dll
, and Mono.Posix.dll
. Someone else running on Windows apparently has copied all files from Unity and didn't find System.Security.dll
nor Mono.Posix.dll
in there, so it's possible Windows uses slightly different dlls.
As I already have mono installed, I was able to find the aforementioned files under /usr/lib/mono/4.5/
. I'm including them below for the convenience of anyone reading, but feel free to get them yourself from a source more trustworthy than a random stranger online. missing-unstripped-linux.zip
In the Windows Unity installation they're in 2019.4.16f1\Editor\Data\MonoBleedingEdge\lib\mono\4.5
It seems that the unstripped_managed.7z file you sent is missing some dlls from it that prevent using MonoMod with the game.
Thanks for the info. I updated the archive in the original message to include those missing DLLs.
Valheim is a 64bit Unity 2019.4.16 game. With Doorstop_x64_3.0.2.2, the game just crashes immediately With Doorstop_x64_3.1.0.0, the game starts, but the targetAssembly appears to not be running at all I have tested with BepInEx (with the newer 3.1.0.0 dll) and the example Doorstop.dll (moved to the game folder per the path in doorstop_config.ini), doorstop_is_alive.txt did not appear I have tested Doorstop as winhttp.dll and version.dll, neither worked Doorstop itself appears to work, setting redirectOutputLog=true does result in an output_log.txt, just not the targetAssembly