You are viewing a potentially older version of this package. View all versions.
Scoops-LethalSponge-1.1.8 icon

LethalSponge

A performance and diagnosis suite focused on rendering and memory.

Date uploaded a day ago
Version 1.1.8
Download link Scoops-LethalSponge-1.1.8.zip
Downloads 1946
Dependency string Scoops-LethalSponge-1.1.8

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2100 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2100

README

Lethal Sponge

Have you ever thought to yourself "Why does a game that looks like this, run so poorly?"

Me too.

Sponge is a fully clientside Performance and Diagnosis suite mod focused on making sure that Lethal Company runs as well and consistently as possible, while also helping you troubleshoot your modlist and find potential problem mods.

What does it do?

Sponge is split into two categories: Cleanup and Investigation.

Sponge Cleanup are a number of patches I've written for lethal company that will increase the baseline FPS, reduce stutters, and allow you to customize your graphics settings to reduce processing power requirements.

Sponge Investigation is a set of console readouts that are aimed at helping you find out what mods (or base game objects) might be causing memory leaks or frame drops.

What does it ACTUALLY do to improve FPS???

Currently, Sponge has the following performance features:

  • A complete re-write of Lethal Company's main outline/posterization shader that cuts down on 1 draw call per object on screen.
  • A rework of how Lethal Company hooks into Unity's Input System that fixes various input lag issues, including one where input lag would increase every time you loaded/started a game.
  • Asset De-duping to help VRAM and RAM usage.
  • Automatic LOD generation.
  • Various base lethal company script fixes to patch memory leaks and unnecessary calculations.
  • A number of camera patches so that only the main player camera is rendering graphically intensive effects. Security cams/the map cam have had their FPS limited and extra (usually unnoticeable) graphical effects disabled.
  • Numerous graphics options that allow you to reduce the level of graphical effects, usually ones that Lethal Company has set unusually high by default.
  • A patch to make Lights in game no longer effect volumetric fog at infinite distances.
  • A daily run of UnloadUnusedObjects, which will clean up various objects that were loaded into memory by moons/dungeons/monsters/etc.

Sponge for Players

For the average player, Sponge is mostly drag-and-drop. The default settings should increase FPS without affecting visual quality in any noticeable way. There are extensive configs for customizing what Sponge changes, so if anything conflicts with another mod or changes your experience in a way you don't like, it can be disabled or altered. For players who need even more extreme FPS help, Sponge features config options to lower graphics settings even further.

Sponge for Developers/Modlist Curators

For more advanced users, Sponge has a Verbose Logging config that can be enabled. This will reduce performance slightly and increase loadtimes while active, so only enable it while troubleshooting. This mode will attempt to track every object in your game and what AssetBundle it originated from. Sponge will perform daily readouts (optional, they can be run on command too) telling you what mods are potentially leaking memory. There are chat commands, including /sponge modelcheck and /sponge texturecheck which will give you a summary of every actively rendering model/texture in your game and what the largest/most dense ones may be. Using /sponge help in game will give you a list of commands.

NOTE:

Sponge as a tool is meant to help you narrow down potential mods. To truly find the root of memory leaks and FPS issues I recommend using Unity's Profilers. Sponge can be inaccurate due to name-overlaps between mods, so always double check using more intensive profilers once you've narrowed things down.

Never use Sponge as a reason to harass mod developers. Small memory leaks are common, and Unity can be a confusing beast to work with. If you find a significant memory leak that is effecting your gameplay, be sure to submit a bug report politely and professionally.

Planned Features

These are subject to change:

  • Watching initial feedback.
  • Improvements to the presentation and readability of Sponge's Evaluation logs.
  • The ability to change graphics settings in game, and save personal graphics settings not tied to Bepin config.
  • More base lethal company fixes.

Feedback is welcome!

Graphics and Memory Leaks are tricky subjects, so while my testing group has seen great improvements with Sponge, the same may not be true for everyone. If Sponge effects your game in an adverse way, please let me know. Also if you know a place where base lethal company is doing something a little silly, let me know and I'll see about adding a fix for it to Sponge.

By nature of what it is doing, some features of Sponge may be incompatible with some mods. I haven't run into anything yet, but if you find a Sponge feature is disrupting another mod, let me know.

Known issues

  • VR may have issues, if so, try disabling Use custom shader and Fix input actions. Please send logs if you encounter VR errors since I cannot test VR myself.
  • The custom shader replacement is still in progress and is not 1:1 with base lethal company's look.

Credits

CHANGELOG

[1.1.8]

  • The meshCombiner (used for LODs) will now skip over invalid meshes and not bother throwing exceptions.

[1.1.7]

  • fixComplexMeshes has expanded to include More Company Cosmetics. This can be toggled with the new fixComplexCosmetics config, and scrap/tools can be toggled with the new fixComplexGrabbable config.
  • If minimalLogging is false, fixComplexMeshes will report what Mesh names, GameObject names, and vertex counts it is fixing.
  • Added new fixComplexMeshesGameObjectBlacklist, so that specific GameObject names can be exempt from fixComplexMeshes. This will sometimes be more accurate/unique than fixComplexMeshesBlacklist.
  • Improved performance of fixComplexMeshes slightly.
  • Fixed LODs conflicting with model swap mods by adding a re-check of LODs on 'SyncScrapValuesClientRpc'.
  • Added a new vSyncCount config to the Rendering section, for changing what VSyncCount level is used when the game is set to "Use monitor (V-Sync)".

[1.1.6]

  • Improved Texture dupe checking.
  • Improved Audio dupe checking.
  • Changed De-Dupe to be off by default. I think this is about as accurate as I can make it and there's still going to be some false positives. I still recommend it for anyone who has heavy VRAM/RAM limitations, as it will help with that.

[1.1.5]

  • Improved Texture dupe checking.
  • Added generateLODMeshes, false by default, to enable generating meshes for LODs. With this change the LOD system will no longer simplify meshes by default and will only handle reducing lighting quality and culling at distance. This should help with load times, as the simpler LOD meshes weren't accomplishing much anyway.
  • Added JetpackItem to generateLODsBlacklist by default.

[1.1.4]

  • Added generateLODsBlacklist to disable LOD generation for specific GameObjects. Extension Ladders and Lockpickers are on there by default.
  • Added fixComplexMeshesBlacklist to disable simplification for specific meshes. Use this if there's an overly complex mesh that you don't want simplified.
  • Changed default value of cullStart from 0.02 to 0.01, this should fix pop-in on very small items.

[1.1.3]

  • Mesh Deduping will no longer dedupe collision meshes that are marked as non-readable.

[1.1.2]

  • Audio Deduping now takes into account Length, Frequency, and Channels.
  • Texture Deduping will now never dedupe Font Atlases.

[1.1.1]

  • Fixed mesh deduping to also consider isReadable when comparing meshes.
  • Fixed mesh simplification to preserve isReadable when simplifying.
  • Added "scavengerplayermodel" to deDupeTextureBlacklist defaults.

[1.1.0]

  • Added new Deduping system, to remove duplicate assets from mod loads. Relevant configs are in the new Dedupe category. Every mod that uses a base game asset loads another copy of it into memory, and this system goes through and unloads those extras. I'll be revising and expanding this system over the next updates, if there are any issues please report them on the Github or Discord thread.
  • Added new Texture Resizing system. Relevant configs are in the new Textures category. This will resize textures that are over a certain size and reduce VRAM usage.
  • Added new Automatic LOD and Mesh Simplification system. Relevant configs are in the new Meshes category. I'll be revising and expanding this system over the next updates, if there are any issues please report them on the Github or Discord thread. Currently the system only works on GrabbableObjects (scrap and tools).
  • Added cameraRenderTransparent config (true by default), which sets whether the ship/security cameras should render transparent objects.
  • Added compensationMoonBlacklist config (empty by default), which is a list of moons where volumetricCompensation will be disabled while outside. Use this for modded moons that become too foggy with volumetricCompensation.
  • Changed minimalLogging config to default to true.
  • Changed lightVolumetricDistCap config to default to 250f instead of 150f, it was a bit overtuned for default.

[1.0.9]

  • Updated Config values to allow setting all values back up to LC defaults.
  • If a value is set to max/LC default, then it will not be changed by Sponge. This should allow better compat with other mods that effect these values.
  • Removed a leftover instance of Camera.render.
  • Fixed ship cameras not updating properly while spectating and using patchCameraScript.

[1.0.8]

  • Fixed lights with 0 base range having their fade distance set to 0 with changeLightFadeDistance enabled. Now there is a minimum fade distance of 5m.

[1.0.7]

  • Made the WIP shader the new default replacement. You can access the previous shader with useLegacyCustomShader, if you preferred it. For people who were using the WIP shader, make sure to re-enable useCustomShader.
  • Cleaned up the camera-finding methods.
  • Fixed a typo in reflectionAtlasSize description.

[1.0.6]

  • Many more changes to the WIP Shader, text on the monitor should be more readable. This is approaching "good enough" level for me now, and if there aren't any major issues before next update it will likely be graduating from WIP.
  • Added a new initial call to UnloadUnusedAssets upon reaching the main menu if unloadUnused is enabled.
  • Fixed the security camera monitor by the ship door not updating if the other monitors were not in view.

[1.0.5]

  • Added volumetricCompensation config in Rendering (on by default) that will modify light intensity and fog thickness to account for the changes in the custom shaders. This should match vanilla's look more closely, especially in regards to fog density.
  • Many changes to the WIP Shader, mainly fixing the color format and HSL calculations to fix artifacting.
  • Fixed minimalLogging doing the opposite of what it said. (adding logging when true, removing when false)
  • Fixed useWIPCustomShader requiring useCustomShader.

[1.0.4]

  • Added a new WIP shader (off by default, set using useWIPCustomShader) with more of that 'lethal company charm'. It's still not there yet, but this should be a little closer. It's disabled by default while I work out the visual stylings.
  • Added minimalLogging config under Investigation. This will disable the readout of how many objects were cleaned up/how many objects are loaded total, which may reduce the stutter when cleanup occurs on day rollover.
  • Fixed the interior camera using the exterior camera's framerate settings, which could cause it not to work if you had one set to limited framerate and the other not.
  • Moved InputActions initialization later, which should hopefully solve issues with mouselook not working when fixInputActions was enabled.
  • Removed /sponge shader chat command when useCustomShader is disabled, to avoid confusion.

[1.0.3]

  • Added a new chat command '/sponge shader' that will toggle between base lethal company's shader and sponge's replacement.
  • Added more values to reflectionAtlasSize (whoops, didn't realize I initially tested with LethalPerformance on and thought their default was LC default.)
  • Added config to set the security camera clip plane.
  • Added configs to disable the camera quality overrides for the Ship/Security/Map cameras.
  • Split the framerate configs for Ship/Security cameras.
  • Changed camera fps configs so that if they are set to 0 the cameras will run at full framerate.
  • Reworked Lethal Company's ManualCameraRenderer fps limiting to be more performant (Thanks Zagster)
  • Fixed a compatibility issue with ModelReplacementAPI

[1.0.2]

  • Reworked custom pass to work better with additional cameras, fixes compatibility issues with Imperium and TooManyEmotes.
  • Fixed NRE when Remove posterization shader was disabled but Use custom shader was not.

[1.0.1]

  • Reworked how the new Posterization shader is implemented to avoid compatibility errors with Diversity.

[1.0.0]

  • Initial Release.