Okabintaro / SubmersedVR

A Subnautica VR mod aiming to bring full motion controler support and common VR mechanics to the game.
MIT License
227 stars 14 forks source link

It just doesnt work #91

Open stoneychildson opened 11 months ago

stoneychildson commented 11 months ago

I've tried many times , it worked once a long time ago and then randomly stopped working forever , bepinex loads in the background but when the game loads it's just plain old gross normal subnautica VR . Im stumped , what do i do . I tried deleting everything , reinstalling and going through the whole process but same issue , what do i do

karlheinz2k2 commented 11 months ago

Same here. Setup: Win10 + Quest 3 Headset

Have installed Bepines + SumbersedVR Tried a few times, did not work, normal movement with headset worked Then I added "-vrmode openvr" to the Subnautica icon in steam. Sumersed worked perfectly with the Qusest 3 Controllers. But since then it doesn't. Bepinex loads but have standard movement only (headset), the Quest 3 controllers do not work. Tried it with SteamLink and QuestLink. Nothing.

How to fix this?

Okabintaro commented 11 months ago

Can you post logs? Unfortunately I don't have a quest 3 to test myself with. The logs can be found in steamapps\common\Subnautica\BepInEx, when you open the local files by right clicking on the Subnautica in steam.

lexicompendium commented 9 months ago

I am using a Quest 2, not 3, but I have the same issue so I'm putting the logs here in case it helps. LogOutput.log

farmboy0 commented 9 months ago

[Error :SubmersedVR] SubmersedVR only supports SteamVR! Make sure to add -vrmode openvr to your games advanded launch options when using an oculus headset.

lexicompendium commented 9 months ago

I have added that line to the advanced options, so I don’t know what else to do. The game launches to my oculus and I can play, just without motion controls.

farmboy0 commented 9 months ago

Are you sure you extracted the plugin correctly? The folder SubmersedVR_0.1.6 shouldnt exist.

farmboy0 commented 9 months ago

I am not sure BepInEx will load dlls directly from the plugins directory you might need to put the dll into a subdirectory.

lexicompendium commented 9 months ago

You're right that I had extracted it incorrectly, but fixing it didn't seem to work. I've attached the logs from that attempt. By putting it into a subdirectory, do you mean putting the submersedvr.dll into one of the folders within the plugins forlder? and if so, do you know which one? LogOutput2.log

Okabintaro commented 9 months ago

From your latest log:

[Error :SubmersedVR] SubmersedVR only supports SteamVR! Make sure to add -vrmode openvr to your games advanded launch options when using an oculus headset.

Make sure to start the game from steamvr and not the oculus dashboard.

lexicompendium commented 9 months ago

I have been doing that, launching the game through steamvr on my desktop while the quest is linked. My exact process is that I set up the Quest Link, open Steam on computer, launch Subnautica in VR mode (with the -vrmode openvr script in the launch options), and then it automatically is broadcast to my oculus but without motion controls. Is there anything in that process I am doing wrong? Thank you all so much for your help, by the way, I really appreciate it

Okabintaro commented 9 months ago

Can you try opening steamvr inside the oculus dashboard and then starting subnautica from within steamvr there. Like don't use steam on the desktop but inside VR. There should be an application for Steamvr in the oculus link dashboard. If not then you might have to install steamvr first.

yunyuyuan commented 5 months ago

@Okabintaro I had the same issue, and I just tried your method above. It works like a charm!

Plat12 commented 3 months ago

@Okabintaro I have the same issue, I'm playing on a quest 3 and launching the game trough quest link using steamvr, I have the -vrmode openvr launch options selected yet bepinex outputs the following on bootup: [Warning:SubmersedVR] Game was not started in VR. Don't load and apply SubmersedVR patches. Regardless of how the game is started. I followed your advice to launch the game from within quest link but it doesn't function still.

Okabintaro commented 3 months ago

@Okabintaro I have the same issue, I'm playing on a quest 3 and launching the game trough quest link using steamvr, I have the -vrmode openvr launch options selected yet bepinex outputs the following on bootup: [Warning:SubmersedVR] Game was not started in VR. Don't load and apply SubmersedVR patches. Regardless of how the game is started. I followed your advice to launch the game from within quest link but it doesn't function still.

Can you try starting SteamVR first in Quest Link and then from within SteamVR on the dashboard start Subnautica. That should guarantee the game being started in VR.

Plat12 commented 3 months ago

That's what I've been doing unfortunately:

Connect the headset Activate Quest link through the headset Boot up steamvr from the Qlink Boot up subnautica from Steamvr

it still doesn't detect the game being in VR

Okabintaro commented 3 months ago

That's what I've been doing unfortunately:

Connect the headset Activate Quest link through the headset Boot up steamvr from the Qlink Boot up subnautica from Steamvr

it still doesn't detect the game being in VR

That's weird. Only other thing I can imagine is that you played Subnautica on PC before and set it to always start in desktop mode. Normally steam will ask you if you wanna play in VR or not. But if you chose Desktop mode and remembered that using the checkbox maybe it's stuck in there.

Maybe try starting it from the desktop steam client while SteamVR is running and make sure it's doing the VR mode? I am not sure how you would clear the default desktop mode though.

Plat12 commented 3 months ago

Nope, never played before on this account. Could I somehow edit the .dll to not run those checks and apply the patches regardless? Could that fix it?

Plat12 commented 3 months ago

Here's the bepinex log with some personal info omitted:

[Message:   BepInEx] BepInEx 5.4.22.0 - Subnautica (26/05/2022 17:27:04)
[Info   :   BepInEx] Running under Unity v2019.4.36.870
[Info   :   BepInEx] CLR runtime version: 4.0.30319.42000
[Info   :   BepInEx] Supports SRE: True
[Info   :   BepInEx] System platform: Bits64, Windows
[Message:   BepInEx] Preloader started
[Info   :   BepInEx] Loaded 1 patcher method from [BepInEx.Preloader 5.4.22.0]
[Info   :   BepInEx] Loaded 1 patcher method from [Tobey.Subnautica.ConfigHandler.Patcher 1.0.2.0]
[Info   :   BepInEx] Loaded 1 patcher method from [Tobey.UnityAudio.Patcher 2.0.2.0]
[Info   :   BepInEx] 3 patcher plugins loaded
[Info   :Legacy Config Handler] Applying override mode: Default
[Info   :   BepInEx] Patching [UnityEngine.CoreModule] with [BepInEx.Chainloader]
[Info   :Unity Audio Patcher] Enabling Unity Audio...
[Message:Unity Audio Patcher] Unity Audio successfully enabled.
[Message:   BepInEx] Preloader finished
[Message:   BepInEx] Chainloader ready
[Message:   BepInEx] Chainloader started
[Info   :   BepInEx] 4 plugins to load
[Info   :   BepInEx] Loading [SubmersedVR 0.1.6]
[Warning:SubmersedVR] Game was not started in VR. Don't load and apply SubmersedVR patches.
[Info   :   BepInEx] Loading [File Tree 1.0.0]
[Info   :   BepInEx] Loading [Subnautica Config Handler 1.0.2]
[Info   :   BepInEx] Loading [Unity Audio Patcher 2.0.2]
[Message:   BepInEx] Chainloader startup complete
[Info   : Unity Log] OpenVR initialized!
[Info   : Unity Log] Created eye textures with a "separate" layout.  The "multi-pass" stereo mode will be used.

[Info   : Unity Log] AddressablesUtility.LoadSceneAsync loading scene: StartScreen in mode Single
[Info   : Unity Log] Initializing Steam services
[Info   : Unity Log] OnQuit behaviour queued for deferred registering, platform services aren't initialized.
[Warning: Unity Log] DontDestroyOnLoad only works for root GameObjects or components on root GameObjects.
[Warning: Unity Log] Can't set camera projection to orthographic when XR is running and rendering to the main view. Camera is no longer valid to use for rendering. Please check camera projection settings of all camera components in your scene.
[Info   : Unity Log] AddressablesUtility.LoadSceneAsync loading scene: MenuEnvironment in mode Additive
[Info   : Unity Log] Telemetry session started. Platform: 'Steam', UserId: '76561197960267366', SessionId: 392595295
[Info   : Unity Log] Loading game settings
[Info   : Unity Log] AddressablesUtility.LoadSceneAsync loading scene: XMenu in mode Additive
[Info   : Unity Log] changeset 72550, QualityLevel = 2
[Info   : Unity Log] OK Running Win64
[Info   : Unity Log] Application version: 1.21.72550
[Info   : Unity Log] SystemInfo: 
 deviceModel = To Be Filled By O.E.M. (To Be Filled By O.E.M.)
 deviceName = *********
 deviceType = Desktop
 deviceUniqueIdentifier = 996232ceb0e4469e709d9961100760ef0e6e4094
 graphicsDeviceID = 29679
 graphicsDeviceName = AMD Radeon RX 6650 XT
 graphicsDeviceType = Direct3D11
 graphicsDeviceVendor = ATI
 graphicsDeviceVendorID = 4098
 graphicsDeviceVersion = Direct3D 11.0 [level 11.1]
 graphicsMemorySize = 8147
 graphicsShaderLevel = 50
 npotSupport = Full
 maxTextureSize = 16384
 operatingSystem = Windows 10  (10.0.19045) 64bit
 processorCount = 12
 processorFrequency = 3693
 processorType = AMD Ryzen 5 5600X 6-Core Processor 
 supportedRenderTargetCount = 8
 supports3DTextures = True
 supportsAccelerometer = False
 supportsComputeShaders = True
 supportsGyroscope = False
 supportsImageEffects = True
 supportsInstancing = True
 supportsLocationService = False
 supportsRawShadowDepthSampling = True
 supportsRenderTextures = True
 supportsRenderToCubemap = True
 supportsShadows = True
 supportsSparseTextures = True
 supportsStencil = 1
 supportsVibration = False
 systemMemorySize = 32693
Okabintaro commented 3 months ago

Just to be sure. You put the launch option in the Subnautica Game and not in SteamVR?

I am out of ideas. I would maybe try reinstalling the game and see if you can run the game in SteamVR without the mod first.

Plat12 commented 3 months ago

yes, the launch option is in the Subnautica game, i already did a full reinstall :(. Is the editing of the .dll unfeasible?

Okabintaro commented 3 months ago

The mod only works if it's running the SteamVR runtime. Removing the check would break it even more I am afraid. You can try building the mod without it but it's there for a reason.

You could try another streamer for the quest like ALVR or Virtual Desktop which always uses SteamVR but I am not sure why it's not working for you.

Okabintaro commented 3 months ago

Oh, I heard steam link is pretty good too and super easy to setup.

Plat12 commented 3 months ago

i have ALVR. lemme try it

Plat12 commented 3 months ago

Still doesn't function with ALVR

Okabintaro commented 3 months ago

What does it do? If it doesn't start in VR at all your SteamVR setup seems to be broken.

Plat12 commented 3 months ago

It starts in VR, the main menu loads and the headset works but the controllers don't, and the time i managed to click the required buttons to start a new save from the main menu, the controllers still aren't detected in-game

Plat12 commented 3 months ago

it's exactly the same as with Qlink

Okabintaro commented 3 months ago

And you get the same log line with the game not being started in VR? The only way it could work is with SteamVR with alvr, so I am confused. I can build you a version without the check tonight but I am not sure it's gonna help.

Plat12 commented 3 months ago

Yep, same log line. The check-less version would be really helpful :)

Okabintaro commented 3 months ago

SubmersedVR.zip There you go, it's just the DLL but I removed the VR and runtime checks.

Plat12 commented 3 months ago

Thank you! Unfortunately it still doesn't work, here's the error:

[Info   :   BepInEx] Loading [SubmersedVR 0.1.7]
[Error  :  HarmonyX] Failed to patch static bool GameInput::GetButtonDown(GameInput+Button action): System.Exception: Parameter "button" not found in method static bool GameInput::GetButtonDown(GameInput+Button action)
  at HarmonyLib.Public.Patching.HarmonyManipulator.EmitCallParameter (System.Reflection.MethodInfo patch, System.Boolean allowFirsParamPassthrough, Mono.Cecil.Cil.VariableDefinition& tmpObjectVar, System.Collections.Generic.List`1[HarmonyLib.Public.Patching.HarmonyManipulator+ArgumentBoxInfo]& tmpBoxVars) [0x007ae] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Public.Patching.HarmonyManipulator.WritePrefixes (HarmonyLib.Internal.Util.ILEmitter+Label returnLabel) [0x00179] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.Public.Patching.HarmonyManipulator.WriteImpl () [0x0022c] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
[Error  : Unity Log] Exception: Parameter "button" not found in method static bool GameInput::GetButtonDown(GameInput+Button action)
Stack trace:
HarmonyLib.Public.Patching.HarmonyManipulator.EmitCallParameter (System.Reflection.MethodInfo patch, System.Boolean allowFirsParamPassthrough, Mono.Cecil.Cil.VariableDefinition& tmpObjectVar, System.Collections.Generic.List`1[HarmonyLib.Public.Patching.HarmonyManipulator+ArgumentBoxInfo]& tmpBoxVars) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.Public.Patching.HarmonyManipulator.WritePrefixes (HarmonyLib.Internal.Util.ILEmitter+Label returnLabel) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.Public.Patching.HarmonyManipulator.WriteImpl () (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
Rethrow as HarmonyException: IL Compile Error (unknown location)
HarmonyLib.Public.Patching.HarmonyManipulator.WriteImpl () (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.Public.Patching.HarmonyManipulator.Process (MonoMod.Cil.ILContext ilContext, System.Reflection.MethodBase originalMethod) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.Public.Patching.HarmonyManipulator.Manipulate (System.Reflection.MethodBase original, HarmonyLib.PatchInfo patchInfo, MonoMod.Cil.ILContext ctx) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.Public.Patching.HarmonyManipulator.Manipulate (System.Reflection.MethodBase original, MonoMod.Cil.ILContext ctx) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.Public.Patching.ManagedMethodPatcher.Manipulator (MonoMod.Cil.ILContext ctx) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
MonoMod.Cil.ILContext.Invoke (MonoMod.Cil.ILContext+Manipulator manip) (at <6733e342b5b549bba815373898724469>:0)
MonoMod.RuntimeDetour.ILHook+Context.InvokeManipulator (Mono.Cecil.MethodDefinition def, MonoMod.Cil.ILContext+Manipulator cb) (at <4e2760c7517c4ea79c633d67e84b319f>:0)
(wrapper dynamic-method) MonoMod.RuntimeDetour.ILHook+Context.DMD<MonoMod.RuntimeDetour.ILHook+Context::Refresh>(MonoMod.RuntimeDetour.ILHook/Context)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition.Trampoline<MonoMod.RuntimeDetour.ILHook+Context::Refresh>?1201442816(object)
HarmonyLib.Internal.RuntimeFixes.StackTraceFixes.OnILChainRefresh (System.Object self) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
MonoMod.RuntimeDetour.ILHook.Apply () (at <4e2760c7517c4ea79c633d67e84b319f>:0)
HarmonyLib.Public.Patching.ManagedMethodPatcher.DetourTo (System.Reflection.MethodBase replacement) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
Rethrow as HarmonyException: IL Compile Error (unknown location)
HarmonyLib.Public.Patching.ManagedMethodPatcher.DetourTo (System.Reflection.MethodBase replacement) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.PatchFunctions.UpdateWrapper (System.Reflection.MethodBase original, HarmonyLib.PatchInfo patchInfo) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
Rethrow as HarmonyException: IL Compile Error (unknown location)
HarmonyLib.PatchClassProcessor.ReportException (System.Exception exception, System.Reflection.MethodBase original) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.PatchClassProcessor.Patch () (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.Harmony.<PatchAll>b__11_0 (System.Type type) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.CollectionExtensions.Do[T] (System.Collections.Generic.IEnumerable`1[T] sequence, System.Action`1[T] action) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.Harmony.PatchAll (System.Reflection.Assembly assembly) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.Harmony.PatchAll () (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
SubmersedVR.Mod.Awake () (at <02d376fc0f4f4345878f2c6b6e3d3a27>:0)
UnityEngine.GameObject:AddComponent(Type)
BepInEx.Bootstrap.Chainloader:Start()
UnityEngine.InputSystem.InputSystem:.cctor()
Okabintaro commented 3 months ago

Yeah I am afraid it would break. Are you using some old version of Subnautica? Only most recent version will work.

Plat12 commented 3 months ago

v72550

Plat12 commented 3 months ago

@Okabintaro issue is completely resolved, i updated the game to the march 2023 version and it works flawlessly, thanks!!!