Zaggy1024 / LC_OpenBodyCams

An open-source mod for Lethal Company to add a body/head camera that is displayed on the bottom right monitor in the ship, with the goal of appearing almost identical to the player's actual perspective while providing good performance.
https://thunderstore.io/c/lethal-company/p/Zaggy1024/OpenBodyCams/
MIT License
8 stars 0 forks source link

Screen Freezes When Looking At a Masked Player's Cam v1.1.0 #13

Closed ManGuyNY closed 2 months ago

ManGuyNY commented 5 months ago

Encountered a scenario in which the screen would freeze when a masked player was selected. Game would still respond, just the image would not change until you looked away from the front of the ship. Changing the selected player via the terminal's "switch" cmd to a non-masked player brings back expected behavior.

No errors in the log this time. I've attached a video of what I'm talking about.

https://github.com/Zaggy1024/LC_OpenBodyCams/assets/115581060/620e0b23-9e0c-4abc-b5e1-7ff5c82edfbd

Zaggy1024 commented 5 months ago

Hmm, I wonder if there's any possibility something is silencing the errors while it's still the same issue happening.

Could you send the latest version of your profile so I can attempt to reproduce this again?

Zaggy1024 commented 5 months ago

Potential fix went out in 54ac6a3, please update if it still occurs!

ManGuyNY commented 5 months ago

Hmm, I wonder if there's any possibility something is silencing the errors while it's still the same issue happening.

Could you send the latest version of your profile so I can attempt to reproduce this again?

I am running a ton of mods, so it's definitely possible something is conflicting. Here is my current profile: 018d6398-6b29-2ecf-8388-6f9ddfddf5a1 . I'll update here if I get that issue to occur again after the latest update. Cheers.

epicacrylic commented 5 months ago

I am having the same issue. Currently, 1.1.1 breaks the cameras when I look at them, even just myself. However, there must have been an implementation change because 1.0.8 works with no problems, but I update to 1.1.1 and the same freeze happens.

my profile as of writing is currently 018d70c8-d906-590e-9bd8-6066f47858aa so I'll see what comes from that

edit: 1.0.8 was just the latest version I had downloaded and just used it for awhile, but in going and cleaning/updating mods the latest version broke, just so it's clear why I was on such an old version lol

ManGuyNY commented 5 months ago

Can confirm the issue persists as of the latest version. Also worth noting that after taking off with the ship, leaving the masked player behind, my more company cosmetics started rendering in my first person view outside of the camera.

Zaggy1024 commented 5 months ago

Just made a few attempts on both profiles to try reproducing this, and I wasn't able to get it to happen. Is this something that happens only rarely to you both?

If it happens often, I'm wondering if this has something to do with MoreCompany, because that's the only mod from both profiles that I have to remove to be able to test this locally.

Whatever the case may be, any more information you can give me about what happens leading up to this, videos (especially longer ones that include what happened beforehand), logs, etc. would help a lot. Until I can reproduce it, I can only make shots in the dark trying to fix this and having you see if it still happens. :(

epicacrylic commented 5 months ago

If the logs didn't get flooded by every mod making something (especially the Skinwalker mod) I feel like testing this would be a lot easier.

epicacrylic commented 5 months ago

So I updated everything since I saw there was an update, and now I suddenly have a less game breaking problem? There is no longer a terrible freeze like before, and all that happens is only the arms are rendered in third person. So I guess something you changed fixed the issue?

Zaggy1024 commented 5 months ago

If you mean in 1.1.2, then perhaps it had something to do with ModelReplacementAPI. If the freeze was happening on respawn, perhaps that would explain it, but that update shouldn't have affected things for while watching a mimic.

epicacrylic commented 5 months ago

I was just now thinking that it might have been the ModelReplacementAPI. The five mods that I had update were:

IntroTweaks 1.4.4 -> 1.4.5 ModelReplacementAPI 2.3.6 -> 2.3.7 LethalCompany_InputUtils 0.6.2 -> 0.6.3 ExtraTerminalCommands 1.3.5 -> 1.4.0 OpenBodyCams 1.0.8 -> 1.1.2

and with process of elimination, it was most likely MRAPI, so I'll look into it momentarily

ManGuyNY commented 4 months ago

I don't run ModelReplacementAPI, but I no longer have the mask freeze bug. Now having a different issue that seems to occur when a player dies and the ship takes off. I get softlocked with "Wait for ship to land" but it never does. OpenBodyCams had some errors in the console, but they unfortunately did not get saved to the log T-T. I'll post them here, straight from the console, if I can reproduce the issue again.

Zaggy1024 commented 4 months ago

I'm assuming this issue isn't tied to masked players, so I'm closing this out in favor of a new issue. Please update the linked issue if you get those logs, thanks!

ManGuyNY commented 4 months ago

Just had this one happen again on the latest ver.

[Error  : Unity Log] NullReferenceException
Stack trace:
OpenBodyCams.BodyCamComponent.ResetCameraRendering () (at <a097b661be1e41d0a0cebd2b905a07fd>:IL_0096)
OpenBodyCams.BodyCamComponent.EndAnyCameraRendering (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Camera camera) (at <a097b661be1e41d0a0cebd2b905a07fd>:IL_0017)
UnityEngine.Rendering.RenderPipelineManager.EndCameraRendering (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Camera camera) (at <e27997765c1848b09d8073e5d642717a>:IL_000A)
UnityEngine.Rendering.RenderPipeline.EndCameraRendering (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Camera camera) (at <e27997765c1848b09d8073e5d642717a>:IL_0001)
UnityEngine.Rendering.HighDefinition.HDRenderPipeline.Render (UnityEngine.Rendering.ScriptableRenderContext renderContext, System.Collections.Generic.List`1[T] cameras) (at <b8abf62aeac646cea5c5cde032ff9314>:IL_04F1)
UnityEngine.Rendering.RenderPipeline.InternalRender (UnityEngine.Rendering.ScriptableRenderContext context, System.Collections.Generic.List`1[T] cameras) (at <e27997765c1848b09d8073e5d642717a>:IL_001C)
UnityEngine.Rendering.RenderPipelineManager.DoRenderLoop_Internal (UnityEngine.Rendering.RenderPipelineAsset pipe, System.IntPtr loopPtr, UnityEngine.Object renderRequest) (at <e27997765c1848b09d8073e5d642717a>:IL_0046)

[Warning: Unity Log] Render Pipeline error : the XR layout still contains active passes. Executing XRSystem.EndLayout() right now.

This time I (host) was masked and spectating my alive friend. Same screen freeze issue.

Zaggy1024 commented 4 months ago

In version 1.2.2, I've added some options that should help me to narrow down the cause much more easily, if you're willing to run with a debug option enabled. The explanation is in the Debugging section of the readme. Note that if you enable the BruteForcePreventFreezes option, you will have to watch the game console to see if the issue occurs, so it might be good to leave that off at first. If you can get me logs after reproducing the issue with ReferencedObjectDestructionDetectionEnabled enabled, hopefully I can finally resolve this. 🙏

The performance hit on my machine seems to be negligible from what I can tell, so hopefully you won't encounter any issues running those in normal gameplay.

ManGuyNY commented 4 months ago

Will do, appreciate your work on this mod.

chemified commented 4 months ago

LogOutput.log

Just had this happen to me. Hopefully this can help a little.

Unsure of how to reproduce however it happened after I had put on a mask, got masked and my body was teleported to the ship. After the body was teleported was when the freeze occurred.

Edit: Just wanna add that I am only now seeing the PrintCosmeticsDebugInfo and that was not enabled. However the other debug setting was set.

Edit 2: Here is the profile code. 018df415-dc80-806f-133b-7bd6e62de8a8 MoreCompany is also a common denominator here and probably has to do with the cosmetics perhaps? I've enabled the other debug setting so if I come across it again will post again here.

ManGuyNY commented 4 months ago

Unsure of how to reproduce however it happened after I had put on a mask, got masked and my body was teleported to the ship. After the body was teleported was when the freeze occurred.

Now that you mention it, both times this has happened to me occured when the masked player exits the facility. The first time my camera froze with the mask player clearly looking at the exit. The second time I had masked myself, and the camera did not freeze while I was spectating my friend until after I noticed the masked had left the facility.

Zaggy1024 commented 4 months ago

Edit 2: Here is the profile code. 018df415-dc80-806f-133b-7bd6e62de8a8 MoreCompany is also a common denominator here and probably has to do with the cosmetics perhaps? I've enabled the other debug setting so if I come across it again will post again here.

I think you were right there. I put out an update (v1.3.0) that should make the MoreCompany compatibility behave better around masked enemies. I believe the issue was also sometimes exacerbated or even caused by MaskedEnemyOverhaul alongside MoreCompany, but I think this update should affect your issue regardless.

Please comment here whether you still encounter the issue, hopefully this will be the end of it!