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

Low FPS when in late game #2

Closed MrAngularVelocity closed 5 months ago

MrAngularVelocity commented 5 months ago

Hello, tried this out the other day and noticed a significant drop in my FPS. I'm not 100% sure it was from the bodycams, but there was a lot of loot (including lamps) and blood on the floor.

I would like to request an option to disable the camera if the player spectating is inside the ship.

It's also a great feature to try to hide the cosmetics, to avoid obstruction of the camera. We use advance company for our cosmetics and noticed the spectated player's cosmetics became visible after awhile. Maybe because it's possible to edit them mid game. In any case, if you think it would improve performance, I would love an option to ignore all cosmetics in the camera, but maybe that would require rendering twice.

Anyways, just some thoughts! The bodycams are cool, but they're pretty performance heavy later in runs.

Zaggy1024 commented 5 months ago

Hello, tried this out the other day and noticed a significant drop in my FPS. I'm not 100% sure it was from the bodycams, but there was a lot of loot (including lamps) and blood on the floor.

I would like to request an option to disable the camera if the player spectating is inside the ship.

I assume you mean disabling the camera when the player being viewed enters the ship? That sounds like a decent idea to me, although I'm curious how much that will help. I've always thought that just the sheer number of objects being updated causes most of the performance reduction. It sounds easy enough to add, though, so I can ask you to report back on your findings with that.

I haven't had enough chances to try this mod out on long games with lots of loot, so I'm interested to hear people's performance stories.

It's also a great feature to try to hide the cosmetics, to avoid obstruction of the camera. We use advance company for our cosmetics and noticed the spectated player's cosmetics became visible after awhile. Maybe because it's possible to edit them mid game. In any case, if you think it would improve performance, I would love an option to ignore all cosmetics in the camera, but maybe that would require rendering twice.

It actually seems odd to me that you wouldn't be seeing AdvancedCompany cosmetics on the body cam always. I only just pushed out version 1.0.10 with explicit support for hiding/showing AdvancedCompany cosmetics based on the bodycam view. Could you check on that version and see if the issue persists?

MrAngularVelocity commented 5 months ago

Thanks for the update! I'll definitely try it out.

I was on version 1.0.7 I believe. I also probably thought it was already hiding cosmetics until I noticed clipping later and assumed it broke during the game. From the description I thought it only hid cosmetics from the spectator player, and not all cosmetics. I think hiding all cosmetics is better too, at least as an option.

And the reason I though turning off the cam when the player is in the ship is because I notice a huge frame increase (>20%) when walking out of the ship and seeing the camera screen frozen (happens in vanilla too). Glad to hear it's easy enough to implement. The thought came because the heaviest load is when we're 8 players in the ship, all with cosmetics, and a bunch of loot on the floor, including lamps and aperatuses that all cause shadows. This rarely, if ever will happen outside the ship when someone needs to view the monitor anyways. It might also be worth just switching to the internal ship camera when the player is inside, but you already disable it for performance (good idea). So it's up to you what to try. I can test it for you.

I've been managing a modpack and have been trying to isolate resource hogs. You body cam mod is the best one by far, so anything to improve the performance will be adopted by other communities too.

MrAngularVelocity commented 5 months ago

Just wanted to update that I noticed a big impact on performance with 1.0.14.

I usually test my FPS on experimentation day 1, in the ship and on the surface, just for consistency.

Without the mod (generalfixes and advancedcompany installed) Ship: 85 Surface: 105

v1.0.7 Ship: 67 Surface: 103

v1.0.14: Ship: 50 Surface: 70

Turning off the monitor in the ship also didn't seem to do much. so I'm not sure if you'd be able to maintain the gains from the idea we discussed.

I am also using modified settings: Resolution 80 FOV 50 Render distance 10

I wish you luck

Zaggy1024 commented 5 months ago

Thanks for the thorough report! I'll try to look into this now.

I assume this testing was solo on a new save? What are your machine's specs like?

Zaggy1024 commented 5 months ago

Disregard those questions, I've pushed out a fix for the performance regression. Thanks for reporting it!

In the future, though, please do open new issues for such things, I'll use this issue to track progress on the feature adding an option to disable the camera while the body cam target is in the ship. I'll probably look at that next if I don't get any more bug reports.

Zaggy1024 commented 5 months ago

@MrAngularVelocity version 1.0.19 has the feature you suggested where the body cam will turn off if its target is inside the ship. Please let me know how that works for you, especially performance-wise!

Zaggy1024 commented 5 months ago

Closing this since I haven't gotten an update, hopefully the feature was enough to alleviate the performance issues.

MrAngularVelocity commented 5 months ago

Hi Zaggy!

Firstly, thank you for the feature turning off the monitor. Testing with the radar booster and there's already a 20% increase!

I did notice the best performing version is on 1.0.24 and afterwards the game has a lot of lag again. Losing 20%, even with the monitor off.

This is with the latest version of generalimprovements [1.1.7] (without all the additional monitors) if that matters.

Thanks again. I kept it in this thread because it's a similar issue.

Zaggy1024 commented 5 months ago

It would be good to open a new issue for this, since it's a new regression. That sounds like maybe the camera isn't turning off correctly for you, I wonder if I can reproduce that here. I'm pretty sure I had checked that it was disabling correctly, but I'll have to make sure.

Zaggy1024 commented 5 months ago

Hi Zaggy!

Firstly, thank you for the feature turning off the monitor. Testing with the radar booster and there's already a 20% increase!

I did notice the best performing version is on 1.0.24 and afterwards the game has a lot of lag again. Losing 20%, even with the monitor off.

This is with the latest version of generalimprovements [1.1.7] (without all the additional monitors) if that matters.

@MrAngularVelocity I've been seeing reports on Discord that GeneralImprovements has had a regression in performance, could you check whether this is caused by that instead of OpenBodyCams?

MrAngularVelocity commented 5 months ago

I've noticed it too. Their update 1.1.4 onwards has a big performance hit. I don't think it's caused by openbodycams, but I had a unique setup last week where I was testing with the steam deck. It's possible I updated between testing