toebeann / gib

A simple TUI application for automating the installation of BepInEx on macOS
ISC License
8 stars 0 forks source link

Steam reports "Unknown Error" when trying to launch Subnautica after installing BepInEx with gib. #11

Open nik875 opened 2 months ago

nik875 commented 2 months ago

Screenshot 2024-08-18 at 12 35 39 PM

Not sure what's going on here, it's a very vague error. This happened as I was running gib once it reached the test phase. I am running on M1 Mac with the latest Subnautica version. I had also attempted to create the experimental vanilla game shortcut, and this gets a bit further by opening a window but eventually causes the same cryptic error.

I am also a developer so I can lend a hand in fixing this if someone points me in the right direction, but as of now the error is very undescriptive and I'm not sure where to start.

nik875 commented 2 months ago

It would also be nice for official uninstallation instructions to be posted detailing how to revert to the Vanilla state before gib touched anything.

toebeann commented 2 months ago

Unknown error being vague is a steam thing, in this context it will usually mean that the launch options aren't correct, nothing gib can do to clear that up for you. Usually only happens on gib prior to v0.3 if you manually copied the launch options from terminal, ignoring the notice that you don't need to do that since gib automatically put the launch options in your clipboard.

If I were you, try gib again from square one as today I released gib v0.3 that streamlines everything, sets up the launch options for you, and adds the option to create a shortcut to launch the game vanilla (though with Subnautica I believe that vanilla shortcut doesn't work, limitation with the game itself unfortunately)

As for instructions on uninstall, yes this is planned. Unfortunately my free time isn't infinite, but it's one of the next things I'll spend time on :) - but typically, for steam games just wipe the launch options in properties and the game will launch vanilla, regardless of whether BepInEx files are present. For non-Steam games, you just launch the game without Steam and it will be vanilla. And if you want to clean up the now unused BepInEx files, just delete all the files and folders in the game folder that came from your BepInEx pack - which will depend on the BepInEx pack itself, and varies.

I'll likely try to automate this process in the future - the plan is to make gib a GUI app to allow for additional features without a complicated and intimidating terminal interface :)

nik875 commented 2 months ago

I didn't touch the launch options at all, just entered the paths and proceeded through the install. This was on the latest version of gib (to the best of my knowledge, I used the curl command in the README). I see the last commit was about an hour ago and I ran it after that time, so I assume the version was updated. I will go ahead and try again just in case.

I've also tried reinstalling the game and fully deleting the Subnautica directory in Steam/steamapps/common, but neither fixes the game and reverts to Vanilla state. Could you let me know how I could get it working again in Vanilla as well?

toebeann commented 2 months ago

I edited my previous comment to give more info, but essentially if you just clear the launch options for Subnautica (right click on steam, properties, launch options is right there in front of you), then the game will launch vanilla. If not, then try verify files with steam, but gib shouldn't have touched the app itself so this shouldn't be necessary.

Unsure how/why your launch options ended up incorrect, been testing with Subnautica myself. You on M-series chip or Intel? Can you copy and paste the steam launch options set by gib here?

nik875 commented 2 months ago

Alright so more info:

toebeann commented 2 months ago

Shouldn't matter where you ran the command, I've ran it in a variety of locations myself. It is supposed to copy the files over, setting permissions appropriately as it does - not symlink. I'm on intel, might be a quirk I've not encountered. Can't really test without an M-series Mac unfortunately, but I'll spend some time looking through docs etc and see what I can do

nik875 commented 2 months ago

You're right, it was copied and not symlinked, sorry about that.

It seems to be the full path actually, not just the Downloads folder:

./Subnautica
├── Subnautica.app
│   ├── Contents
│   │   ├── Frameworks
│   │   ├── Info.plist
│   │   ├── MacOS
│   │   ├── MonoBleedingEdge
│   │   ├── Plugins
│   │   └── Resources
│   └── SNAppData
│       ├── SavedGames
│       └── SavedGamesBackup
└── Users
    └── NikhilKalidasu
        └── Downloads

14 directories, 1 file

Within Users:

└── NikhilKalidasu
    └── Downloads
        └── source-builds
            └── bepinex
                ├── BepInEx
                │   ├── config
                │   │   ├── BepInEx.cfg
                │   │   ├── Tobey.FileTree.cfg
                │   │   └── Tobey.UnityAudio.cfg
                │   ├── core
                │   │   ├── 0Harmony.dll
                │   │   ├── 0Harmony.xml
                │   │   ├── 0Harmony20.dll
                │   │   ├── BepInEx.Harmony.dll
                │   │   ├── BepInEx.Harmony.xml
                │   │   ├── BepInEx.Preloader.dll
                │   │   ├── BepInEx.Preloader.xml
                │   │   ├── BepInEx.dll
                │   │   ├── BepInEx.xml
                │   │   ├── HarmonyXInterop.dll
                │   │   ├── Mono.Cecil.Mdb.dll
                │   │   ├── Mono.Cecil.Pdb.dll
                │   │   ├── Mono.Cecil.Rocks.dll
                │   │   ├── Mono.Cecil.dll
                │   │   ├── MonoMod.RuntimeDetour.dll
                │   │   ├── MonoMod.RuntimeDetour.xml
                │   │   ├── MonoMod.Utils.dll
                │   │   └── MonoMod.Utils.xml
                │   ├── patchers
                │   │   └── Tobey
                │   │       ├── ConfigHandler
                │   │       │   ├── Tobey.Subnautica.ConfigHandler.Configuration.dll
                │   │       │   └── Tobey.Subnautica.ConfigHandler.Patcher.dll
                │   │       └── UnityAudio
                │   │           ├── Tobey.UnityAudio.Patcher.dll
                │   │           └── Tobey.UnityAudio.Shared.dll
                │   └── plugins
                │       └── Tobey
                │           ├── ConfigHandler
                │           │   └── Tobey.Subnautica.ConfigHandler.Plugin.dll
                │           ├── File Tree
                │           │   └── Tobey.FileTree.dll
                │           └── UnityAudio
                │               ├── Tobey.UnityAudio.Plugin.dll
                │               └── chime.wav
                ├── changelog.txt
                ├── doorstop_config.ini
                ├── doorstop_libs
                │   ├── libdoorstop_x64.dylib
                │   ├── libdoorstop_x64.so
                │   ├── libdoorstop_x86.dylib
                │   └── libdoorstop_x86.so
                ├── run_bepinex.sh
                └── winhttp.dll
toebeann commented 2 months ago

So it just created a Users/X/Downloads folder in Subnautica rather than copying anything over? Very strange...

toebeann commented 2 months ago

Can you confirm what the paths were that you filled in the prompts of gib?

nik875 commented 2 months ago

Path to run_bepinex.sh: ./run_bepinex.sh

Path to Unity game app: /Users/NikhilKalidasu/Library/Application Support/Steam/steamapps/common/Subnautica/Subnautica.app

nik875 commented 2 months ago

image

I changed the path in the launch options to go down the full directory path to the copied over run_bepinex.sh and got this error also.

toebeann commented 2 months ago

Path to run_bepinex.sh: ./run_bepinex.sh

Don't use a relative path please, hasn't been tested. Just highlight the file and cmd+c it, then cmd+v in terminal. If it doesn't accept that (or if cmd+c doesn't give an absolute path in your terminal because it's not the built in macOS terminal, and each terminal handles this differently and I am not supporting every terminal app ever...), opt+cmd+c.

Please be aware this is still a v0, so if you are doing things that deviate from the instructions (i.e. providing a path in a way that wasn't described in the instructions), this is quite likely to lead to issues

toebeann commented 2 months ago

image

I changed the path in the launch options to go down the full directory path to the copied over run_bepinex.sh and got this error also.

Yeah I didn't suggest trying to workaround it for a reason xD, the things gib has to take care of under the hood to make apple happy is a lot more than just copying the files over

nik875 commented 2 months ago

Yep using the absolute path fixed the problem, thanks! It would be nice to have that clarification in the README.

The only remaining issue now is that when I try running the game with BepInEx, it has been stuck on a black screen for the past several minutes. About how long does it normally take to start up?

Although this is more of an issue with the mod and not gib, so understandable if you want to close this issue now.

toebeann commented 2 months ago

The only remaining issue now is that when I try running the game with BepInEx, it has been stuck on a black screen for the past several minutes. About how long does it normally take to start up?

Although this is more of an issue with the mod and not gib, so understandable if you want to close this issue now.

Yeah when you start up with just BepInEx it's very fast for me. So that will be whatever mods you have, and that will vary from mod to mod. Could also be that the mod itself just doesn't support macOS, not all will "just work" on macOS, depends on the mod.

nik875 commented 2 months ago

The only mod should be BepInEx itself, so the issue is definitely there.

toebeann commented 2 months ago

Yep using the absolute path fixed the problem, thanks! It would be nice to have that clarification in the README.

Thanks for letting me know, yes I'll add a caveat about relative paths until I have time to fix it, but be aware it's a v0 (i.e. still a work in progress) and deviating from the instructions is bound to cause issues. If you deviated from the instructions and something didn't work, your first thought as a user - especially a developer! - should be to try again, doing it exactly the way the instructions describe ;)

toebeann commented 2 months ago

Oh, and I'll leave this issue open until I've fixed the relative paths issue :)

toebeann commented 2 months ago

The only mod should be BepInEx itself, so the issue is definitely there.

Might be an M-series issue as it's having to emulate intel then, running everything through Rosetta. For me on intel - which is what BepInEx was made for - it's very fast indeed.

nik875 commented 2 months ago

Agreed that it's probably an M-series issue. However the Vanilla shortcut has the same problem. It gets a bit further and I see the opening photosensitivity warning before it returns to a black screen and gets stuck. Ideally the Vanilla shortcut should not be using any mods at all including BepInEx, so not sure what's going on there.

toebeann commented 2 months ago

Agreed that it's probably an M-series issue. However the Vanilla shortcut has the same problem. It gets a bit further and I see the opening photosensitivity warning before it returns to a black screen and gets stuck. Ideally the Vanilla shortcut should not be using any mods at all including BepInEx, so not sure what's going on there.

I mentioned earlier in this thread that the vanilla shortcut doesn't work for Subnautica - it's a game-specific issue. The vanilla shortcut is experimental and may not work for all Steam games, as gib will have told you :)

toebeann commented 2 months ago

Some more info:

The way the vanilla shortcut works is to simply run the game's .app directly, without running the run_bepinex.sh script. Doing this means we're not launching the game through Steam's API, so the Steamworks API doesn't get injected into the game, and some games - including Subnautica - close and restart the game when they detect this. Unfortunately, this leads to it launching the game directly with Steam (with launch options), which means it ends up running the run_bepinex.sh script as per the launch options, and BepInEx gets injected.

Unfortunately, for the time being there doesn't seem to be a simple way around this - if we inverted it so that the shortcut was for launching modded and the standard launch via steam was vanilla, then those games that restart themselves when the Steamworks API isn't injected, when they restart, they'd be vanilla when you wanted modded.

For those games, the only option you have really is to manually clear the launch options if you want to run vanilla, and put them back if you want to run modded (or run gib again and let it set the launch options for you).

If/when I eventually make gib a GUI app instead of a glorified terminal script, I'll probably aim to include some functionality to handle swapping between vanilla and modded by changing the launch options accordingly, rather than using shortcuts.

toebeann commented 2 months ago

@nik875 Re: vanilla shortcut for Steam games, I just wanted to let you know that I have just released gib v0.3.4 which now uses an improved methodology for providing the vanilla shortcut, making use of the --doorstop_enabled flag used in BepInEx packs which use doorstop v4 or newer. I have also updated my BepInEx packs for Subnautica and Subnautica: Below Zero to use doorstop v4.

So, if you want to make use of the vanilla shortcut functionality I advise you to:

  1. Remove any vanilla shortcuts from Steam that were created previously (I have not yet added functionality for gib to update the shortcuts if they already exist)
  2. Download the latest version of my BepInEx pack for Subnautica
  3. Run gib: curl -fsSL https://cdn.jsdelivr.net/gh/toebeann/gib/gib.sh | bash
  4. Press y then Enter when asked if you would like a vanilla shortcut 😄

Do note that I still haven't had time to look into the relative path issue, so make sure to use absolute paths!