#Cull Factory: Stops rendering faraway rooms
1 messages Β· Page 3 of 1
what I'm thinking of would ideally be client-side
that looks to be synced
for what I'm thinking of to be client-sided, it would essentially just have to cull renderers and lights for items based on proximity to similar items, though, so I guess it can't really prevent item updates
maybe just stop rendering the scrap on the ship with a hotkey?
nah, I'd rather it be automatic
why make people press a button when the game can do it itself?
also, having items be invisible temporarily is ugly
sounds complex but very cool if it can work just like mc as you say
unfortunately I think it would be tricky to really emulate Minecraft's item grouping
I could do that, but then it would only really work in vanilla and mods that don't touch items
so I think it would just have to be a culling option, so I suppose it could fit into this mod after all
would be nice to also display the quantity of the item in the stack and the total value
but the main pain point is a bunch of dynamic lights, like the lamps, so that would probably help a ton
I think my strategy would just be to allow configuring a number of stacked items to display before they're culled
there's that mod that stops light from scrap producing shadows
that's also ugly :^)
yeah
the lamps' shadows look cool
if you don't tank your fps with a couple lamps, there's no reason for fps to tank with hundreds
unless you really like stacking shadow maps
ik you say you want it to function like vanilla but mods like shipmaid can move scrap in the ship to be exactly stacked on top of eachother, maybe that kind of mechanic could be used to group the scrap close to eachother into one pile and then stop rendering all but one
you could mass-disable mesh rendering of items on ship
I was actually meaning to create something akin to that
there's no need to move the items if they stop rendering
it just needs to have a certain radius to merge them within
or to cull them within, I should say
but will it show all off their scan nodes and values?
but also then if you try pick it up, you'll go for the one that's visible
and then one of the invisible ones will appear
that's one of the specific reasons I would only make it affect renderers and lights
and it'll be in a slightly different position
true
it can perhaps be an option to move them together, but really I don't see that as a problem
for small items all scattered around it would be quite annoying to quickly pick them up
if it's set up to show two or three of the same item, then it won't be super visible, and a similar thing happens in Minecraft if we use that analogue
does that affect lights?
I will test it right now
but if that's calling GetComponentsInChildren then that's not viable
and if you were trying to sell an exact amount to meet quota wouldn't you need to keep moving the scrap away from the pile until you find the one with the right value you want to sell
we have to cache the components or it will be prohibitively slow
I mean, you kinda have to do that in vanilla already
sure but you can see em at least
at least if you're stacking the items close enough to where they would be culled
you can see where the scan nodes are relative to each other even if they're culled
it's essentially the same thing in my eyes
wouldnt you still need to walk a bit to drop it far enough to not stack
I think you're thinking of the radius being way larger than I am
the radius I'm thinking of would be like .1 meters max
right
you could probably turn around and drop it and it wouldn't stack
fair
since its an issue in vanilla we could really do with an improvement to the node system and being able to pick up the right item you want in a pile
obviously with that setting it would only really help with organized ships but I feel like that's generally what you'd see with long runs
not sure how to solve that without breaking mod compatibility
could make a looting UI similar to Fallout 4 and break every mod that tries to check for an item on the floor lol
im surprised no one has made a mod to stack the node UIs on top of eachother so they dont overlap and have a way of scrolling through the list and selecting the one you want to pick up
hmm, true, I suppose it could activate a UI upon scanning
but the only nice UX I can think of is scrolling to select, and that seems like it could be annoying given that the game uses scroll for selecting items in the hotbar
and also prone to conflicts
by grouping same items or sorting by price or smth
perhaps it could be on a separate button from scan, but
buttons is not a great plan
yeah or maybe disable scrolling through hotbar when scrolling through the UI but idk if that would work well
or two buttons on keyboard to go up or down the list
https://thunderstore.io/c/lethal-company/p/Dreamweave/CompanyBuildingEnhancements/ does that already when selling
right, but then if you accidentally scan multiple while you're in a bad situation and have to select a weapon?
yeah in the terminal right
i figure it would only allow use of the UI while aiming at the scrap
this would be so hard to pull off without conflicts
if it's an entirely independent UI i don't see it needing to conflict
yeah for sure
but when hovering over items?
controls would mess up completely π¦
what if you wanted to change current slot when looking at an item to get it to different slot?
my feeling on the subject is that it's probably something that would need to be implemented in vanilla first so that everyone is forced to adapt to it
mod compatibility is incredibly difficult when you're not messing with something that other mods are likely to mess with lol
difficult as in time consuming really
yeah
you would need to turn them off somehow
yet another layer of abstraction
yeah, I kinda figured I'd have to take care of that
definitely something where I'll have to brainstorm the most efficient method
it might honestly not even be viable, since mods can spawn items whenever they want
it's not really reasonable to scan for items throughout the whole scene ever
you want to do something like this? https://www.curseforge.com/minecraft/mc-mods/get-it-together-drops
hmm, not really
that could be a separate option though
what I'm thinking of would just track items in the scene, run through them and pool ones that are within a certain radius and keep only an arbitrary subset of them visible
ooh, okay
what i thought was just grouping same items in the same spot and letting you pick them up one-by-one from lowest value
thing is, for portal occlusion culling, I'll already have to start tracking every item entering and leaving the facility to be able to determine which ones have lights attached that cast shadows so that I can occlude those shadows when the player is separated from the item by a wall
cause i could get that system working fairly easy
which would prevent flashlights shining through walls
right
that would be great
oh you think that wouldn't be too difficult? I thought about that but I couldn't imagine a grouping system that wouldn't cause mods to be unable to find individual items correctly
maybe you thought of something I didn't
or maybe you weren't thinking of setting any items inactive/hidden
i mean - I was thinking about doing that on the ship (based on previous convo here), cause i've got the base system working already
akin to shipmaid
but I haven't thought of that in dungeon context
to be fair, it's not nearly as important in the dungeon
you'd have to have a mod get pretty crazy for that to be an issue
true
but I would have to imagine that on the ship it's possibly more likely that a mod might care about an item on the floor
I would assume that setting items inactive would cause them not to be counted in the ship value for example
so this would work kinda like https://thunderstore.io/c/lethal-company/p/GiGaGon/ScrapMerging/ - every item would be still separate (so no conflicts there), but only one would be visible and interactable (with lowest value) and they would all be stacked in the same spot, so they wouldn't jump from place to place on interaction
yeah, there could be some problems with that
if it's just disabling the renderer, light and grabbableobject component and not the scannode, perhaps that would work
not sure 
for lights, though, I would personally prefer to try to emulate there being multiple lights by adjusting the intensity, but I wonder if that would scale in a very predictable way
i would need to test this more extensively (and build that system in the first place) - turning off items & disabling lamps/apparatice wouldn't be too difficult, but my project has hit dead end a long time ago π₯²
yeah
then once it's all working it turns out that I've been working on the item culling and we both release at the same time and cause all items to disappear on the ship :^)
that would be an oopsie
not sure if/when I would start trying to experiment with it though, I have some other fairly sizeable features I want to look into
like that dynamic light occluder stuff
yeah, this is very much outside of this mod's scope
i'm gonna think about doing that tho
yeah, if I put it in CullFactory it'll be purely visual
maybe you'll beat me to it
save me the trouble lol
i'm not making any promises π
moreover what i'm doing in my project is such horseshit it's not gonna be usable anyway lmao
ok π
hey, even if it's a proof of concept it might prove the concept
that's right
I wasn't sure if I would be able to get portal occlusion culling working, now here we are
only doing something moves anything forward

i think some mods check for grabbableobject
when looking for items to do whatever their mod does
I think that should be fine? unless they expect the grabbableobject to actually do something over time when they call a function
disabled components are still accessible
How much will this improve productivity?
yeah as long as they can find it its probably ok
the item culling? it'll help with framerates in late game
dont think they need to use it, just look for it to know what kind of item it is
right
Sounds good
if that's true of the vast majority of mods, then compatibility may not be a huge problem
The hardest thing is to make it client friendly
can you cull scrap when not looking at it
unity does that for us, except for lamps because they have lights and cast shadows
cool
if by looking at it you mean have it visible on the screen though, that's a whole other beast
what other kind of looking at it is there
culling items is on my brain's roadmap for CullFactory, but that will only do something inside the facility
oh you mean like looking in its direction through a wall
Unity does frustum culling by default, meaning that if an object is within the field of vision, whether visible or occluded by a wall, it will be rendered
yeah alright
if such an object casts light with shadows, though, all bets are off for what will be culled
so if im in the facility and look up im rendering all scrap in the ship
quite likely, yeah
bruh
lmao
who is working on portal culling?
portal occlusion culling is already in the mod that this thread is about
Maker of this mod!
i think i'm gonna cook something in regards to this
i thought cullfactory only effects the rooms and not items
at the moment, that's true
but it should be possible to cull items as long as I can track which ones are in the facility
cull by distance?
no, by visibility
the portals can be used for dynamic culling as well as for determining visibility of static tiles
?
this is GrabbableObject property
ah
not good enough, then I have to Object.FindObjectsByType<GrabbableObject>() every frame
this is pain
that will explode the framerate
we already kind of track items entering and leaving the facility due to how depth culling was implemented before, so we're partway there, the only issue is if mods spawn items after the level is generated
but you'd never need to render an item at the distance between the facility and the ship anyway so couldnt that be an easy way to avoid rendering ship scrap while inside
or if they teleport an item in/out
would not caring about mob's spawned items be a good enough solution?
since the vast majority is generated before landing
oh mob spawned items should be easy enough to handle in a fairly decent way I would think
items opened out of giftboxes?
lmao
If mods spawn in scrap after the game loads, does that scrap end up not being visible for everyone?
Or just not get culled?
Understood
technically, I could probably track what items are where just by running a transpiler over every class in the entire game, but that would kill startup times
Do enemies even spawn scrap? Or are we talking about stuff like enemies killed scrap (with the loot bodies mod or whatever itβs called)?
Nutcrackers and their shotguns are the only vanilla one I believe
but I know there are mods that do it too
tricky part is checking for the items after they're spawned and not before, that timing could vary from mod to mod
a brute-force way is to hook into the postfix of Object.Instantiate and do type checking there but yeh
since GrabbableObject is networked, the hook can be in the networked spawn method
but that only takes care of items when they're spawned, any mod can set isInFactory whenever they want
so it would have to be a spawn hook and a transpiler across every class which I'm not willing to do
although that does create more work for me if I don't 
hm I wonder if it's possible to write a single transpiler and tell harmony to apply the patch to all classes
well, I think you have to do it by getting every class from every assembly and calling the patch on each of them
but it's very slow
iirc, AC does that, which is why it takes forever to start up (time to get crucified for bringing that up)
ah, advancedcompany?
yeah
I understand why they do it though, it's kind of the most performant way to allow everything in the game to be customized
oh damn i did not know that
also technically I could just not track what's in the facility and instead track every item in the world and run culling on ones that have isInFactory == true, but I worry that that would be very slow in late game with hundreds or thousands of items in the ship
perhaps that could be mitigated by moving things between lists for inside and outside based on that flag, that way the branch predictor can actually do its job
wouldn't culling ship items based on distance from the ship be more effective?
so if you're further than X meters you just cull everything?
that would be a solution for when you leave the ship, sure
but I wouldn't really consider that a good solution, since that doesn't solve the issue of framerates while inside the ship
what I'd really like to do is cull the entire surface while the player is inside the facility, but that's a separate thing from the issue of tens of stacked items causing bad fps
there's a few ways I can see myself implementing that, but yeah, if the scene hierarchy doesn't lend itself to that it might be quite tricky
what would be really cool is to make a portal for the ship door as well
that way I can run through everything inside the ship and cull it when it's out of view
in practice, though, that may not matter too much
especially if I implement item group culling
i was meaning to ask - does portal culling work with ship screen now?
cause using depth culling made the screen black
both should work as of 1.7.2
you're the goat
also, 1.8.0 dropped just a bit ago with fixes for custom interiors
although scoopy beat me to it so now I have to remove those interiors from the whitelist in the next update lol
is portal good to use now @austere stirrup
yes
ty
Bunker interior doesn't seem to be playing perfectly nice with CullFactory
On PortalOcclusionCulling
The spots where things bug out seem to be pretty specific, and only momentary, but when they do it's kinda jarring
could you send a video of the spots where that's happening?
I'd have to go back to that moon but I can try, Windows screen recording isn't great for 4k monitors
also, if you can find where CullFactory says which interior is loading, you could try adding that to the list of interiors to use the fallback portals in and see if that helps
gotcha
the easiest way for me to investigate these things is to get a seed and moon for me to go to with your code
note that the setting does apply immediately in-game, no need to restart
Just adjusted with LethalConfig, will try Bunker Interior again
If it still has issues will try to record but no promises
Also, on an unrelated note, putting Boombas outside the facility is a mistake
They are shockingly fast 
Having to reduce the filesize rq but got a recording for ya
That should show the problem pretty extensively
This was with Fallback Portals
So I think it's an issue of the portals being too big
It functioned basically identically without fallback portals so I don't think those did much in this scenario
It's almost always on corners of vision where I presume the game thinks they're out of view
Except that one spot I showed
Not sure what's up with that, perhaps the portal is too wide?
Or thick
idk
it being too wide should in theory make it render, not sure what's up with that if it was using the fallback
I'll look into it
Ty! It's nothing really gamebreaking, and I can certainly just disable it / switch to DepthCulling when in this interior
But I figured you'd wanna know

hmm, looks like changing the fallback list at runtime broke
if you add BunkerFlow to the fallback list and restart, it should work
we should be able to release an update tonight that resolves that issue and also makes BunkerFlow use the fallback by default
All these ideas about further optimising the game are great (with the scrap and such)
thanks for letting me know, yeah! I got some fixes into the repo now, so once fumiko is able to release an update that stuff should be resolved
Scoopys Variety Mod's interiors will be removed from the fallback list to coincide with the update that fixed the portal sizes on their end, and SewerFlow will now be in the fallback list instead
the fallback list will be hard-coded with optional overrides, though, since it's difficult to migrate options properly
i recently played on the bunker and did not experience this issue, unless it was something that was introduced in 0.7.2+
it's not, if it became an issue it's because of bunker updating
but I don't believe that happened, I think it's just only especially visible when you encounter hallways that are a bit misaligned like in the video
or any situation that makes you face a hallway from any angle but dead on really
SewerFlow is also Scoopy's
too many flows
It also doesn't help that I have a 4k monitor
If something is at the edge of FOV, I'm seeing it
lol I suppose so
Hey
Would yall say this mod is stable enough to use with custom interiors, radar boosters, and body cams?
custom interiors yes
depends on the interior though, some may be less stable than others
radar boosters and body cams, yes, absolutely
and yeah, custom interiors have been spotty
I'm hoping 1.8.1 will finally make things consistent
fwiw i just played on custom interiors for about an hour and a half and didn't notice any issues
oh, I didn't realize Dantor's was released, but I know its author saw me mention the door socket sizes before, so that makes sense
glad to know they're both working fine!
I did check PoolRooms and it seems like the door sockets are appropriately sized there too
CullFactory [0.8.0] threw two non-fatal errors at the end of dungeon generation for a sewer (scoopy [1.2.0]); wandered around the level without any apparent issue, but dropping it here (PortalOcclusionCulling w/ SewerFlow on fallback list)
oh yeah, I encountered that as well
it should be fixed in the next version, once we get that out
when that happens, it just means that the lighting influence won't be accounted for, so you might see some light pop-in
actually, it means the culling won't work, I lied
it doesn't create the list of all tiles when that fails
good that it doesn't cause error spam though
i noticed when using this like a week ago with the spectate enemies mod the mod kinda becomes useless as you cant spectate enemies properly anymore has this been fixed ?
should be up in hot minute π
we've been updating the mod a lot in the past week so chances are it should be fixed
yeah, hard to say how likely it's been fixed without knowing which version you were on, but it's worth checking again, and if you find that it still doesn't work please let us know
hello what's the recommended values for
β’ Use fallback portals for interiors =
β’ Skip fallback portals for interiors =
if i have the ff mods:
the defaults in 1.8.1 should be good for that list
I haven't tested the mental hospital yet, but I believe Dantor specifically made sure the doorways are compatible with portal occlusion culling
Are these interiors the only ones with problems in CullFactor when drawing and displaying?
the only one with known issues is MoreInteriors, but the necessary workaround should be enabled by default
if you don't change from the default settings, it should just work β’οΈ
that is the hope at least
trying to update from 0.8.0 to 0.8.1 and it's expecting some specific folder structure now?
[Error : Unity Log] DirectoryNotFoundException: Could not find a part of the path "D:\Game Launchers\Steam\steamapps\common\Lethal Company\BepInEx\plugins\fumiko-CullFactory\version".
Stack trace:
System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) (at <787acc3c9a4c471ba7d971300105af24>:0)
System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) (at <787acc3c9a4c471ba7d971300105af24>:0)
(wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
System.IO.File.Open (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) (at <787acc3c9a4c471ba7d971300105af24>:0)
CullFactory.Config.MigrateSettings () (at D:/Projects/CSharp/BepInEx/LethalCompany/CullFactory/CullFactory/Config.cs:160)
CullFactory.Config.Initialize (BepInEx.Configuration.ConfigFile configFile) (at D:/Projects/CSharp/BepInEx/LethalCompany/CullFactory/CullFactory/Config.cs:137)
CullFactory.Plugin.Awake () (at D:/Projects/CSharp/BepInEx/LethalCompany/CullFactory/CullFactory/Plugin.cs:20)
UnityEngine.GameObject:AddComponent(Type)
BepInEx.Bootstrap.Chainloader:Start()
UnityEngine.Rendering.HighDefinition.HDRenderPipelineAsset:OnEnable()```
is the expected location documented anywhere?
yeah I maintain it all manually
gotcha
I can see what folder it's looking for, but unclear if it's a specific file or all files
figured it was easiest to just ask
the version is a filename
but... that really shouldn't be a thing, I'll look into a better way to get the assembly path
this was kinda a last minute thing
understandable
going to keep using 0.8.0, let me know if you need anything or want a check on my end later
good luck
@glass juniper fyi, I'll let you take care of this, probably want to use either the currently-executing assembly location or just pull the config directory instead
I'm guessing this is not an issue if you use a mod manager?
i'd have no way to know, so i'm not sure why you're pinging me π
it shouldn't be
It was more to respond to the issue in general rather than to ask you
gotcha, please stop pinging me for threaded convos I can't help with, in any event π₯°
mr popular
roger
https://thunderstore.io/c/lethal-company/p/sfDesat/ViewExtension/ I assume this is like directly antithetical to this mod
eh, not really
CullFactory has its own far plane override that you can use as an alternative to that, but you can also leave that disabled and use both
increasing the render distance inside the facility shouldn't really matter that much unless there's a lot of dynamic stuff that isn't currently culled
yep, i've just pushed an update to fix this, should be up on thunderstore in a minute
@austere stirrup I'm going crazy
I check the compatibility of most mods by disabling and enabling others
FPS jumps constantly from 250-150
I'm trying to understand why this could be
That's it
I had 30 mods now
I'm gradually adding
But then itβs like after 40-50 modo
Console turns on low performance mode
And it starts working only at 100-140 fps
if you're gradually adding them, don't you have a narrow set of mods to check for issues?
but only client mods that change the HUD
I have them
I've already written down a list of things that could cause instability.
But the problem is different
World generation is different, seeds are different
And maybe that's the problem
In some places vanilla generates something successfully, in others it doesnβt.
This is the first guess
you can use the seed override in CullFactory to remove that variable
By the way, he doesn't help much
The problem here is much deeper
BepInEx-BepInExPack-5.4.2100
ShaosilGaming-GeneralImprovement-1.1.9
Rune580-LethalCompany_InputUtils-0.6.3
PotatoePet-AdvancedCompany-1.1.1
Zaggy1024-OpenBodyCams-1.1.5
Owen3H-IntroTweaks-1.4.5
Evaisa-HookGenPatcher-0.0.5
Evaisa-LethalLib-0.14.2
Rolevote-The_Fiend-1.0.4
x753-Mimics-2.4.0
AmesBoys-ImmortalSnail-0.6.1
NomnomAB-RollingGiant-2.5.1
jaspercreations-Scopophobia-1.1.1
Ccode_lang-SirenHead-0.2.1
SolidStone-ShockwaveDroneEnemy-0.2.1
x753-Peepers-0.9.6
Mikusch-SkullEnemy-1.0.4
rileyzzz-Skibidi_Toilet-1.0.2
Rdos-LethalGym-1.0.1
VersusWorks-Dynamo_Flashlight-0.1.2
Jordo-NeedyCats-1.1.1
Taker-CannabisCompany-1.0.3
AinaVT-YippeeScrap-1.0.7
Pinta-PintoBoy-1.0.4
ModusInteractive-Lethal_Trading_Cards-1.0.3
SillySquad-AmogusScrap-1.1.0
Theronguard-Emergency_Dice-1.1.13
Scintesto-Scavenger_Plushie-1.0.6
Scintesto-Monster_Plushies-1.0.4
Zaggy1024-PathfindingLagFix-1.2.1
DOkge-InventoryFixPlugin-0.0.1
SillySquad-BetterTotalScrap-1.1.0
Sv_Matt-HideModList-1.0.1
Hamunii-JetpackFallFix-2.0.1
NutNutty-SellTracker-1.2.1
AlexCodesGames-AdditionalContentFramework-1.0.3
AlexCodesGames-AdditionalSuits-2.0.0
BatTeam-LethalFashion-1.0.6
tinyhoot-ShipLoot-1.0.0
EliteMasterEric-Coroner-1.6.0
NotAtomicBomb-TerminalApi-1.5.1
fivetoofive-DetailedScan-1.2.2
kRYstall9-FastSwitchPlayerViewInRadar-1.3.2
Ozone-Runtime_Netcode_Patcher-0.2.5
Sligili-More_Emotes-1.3.3
TwinDimensionalProductions-CoilHeadStare-1.0.6
Hamunii-JetpackWarning-2.2.0
akechii-DiscountAlert-2.3.0
mrov-LethalRichPresence-0.5.8
willis81808-LethalSettings-1.4.0
willis81808-HackPad-1.1.3
Evaisa-LethalThings-0.9.4
malco-Lategame_Upgrades-3.1.1
ButteryStancakes-AccurateStaminaDisplay-2.0.0
Dev1A3-RecentlyPlayedWith-1.0.3
get it to run poorly, then keep that save backed up and set the seed override to the problematic seed and test mods
jeez
So far I have added these mods
Disabling them
Slightly improved performance
But there's nothing like that about them...
It's just items and HUD
anything can cause problems
it's code, if it's written poorly the game runs poorly
But the console doesn't show this
And it bothers me
The worst thing is that I can't see it
Itβs just that as soon as my game runs at 100-140 fps, then for my friends who have weak PCs, the game will automatically output a maximum of 40-60
with drawdowns
you really just have to remove variables to try to reproduce the problem
Yes, I would also like to know which ones exactly
find maps and seeds where it happens and see if you can get it to happen again
but I can't help you more than that advice
What is the name of the seed mod?
To constantly load the same
And check
I forgot the name
Oh great feature
but whatever you do, make sure to empty that config option out when you're done testing, it WILL break things
Well, with cullfactor enabled I got +20-30 fps
Still, yes, these mods themselves are heavy
From 250 fps to 200-220 they underestimate
With cullfactor enabled
on the same seed
sounds like it's time to report the issue to those mod authors π
Yes they rarely update them
the mods are too big, maybe they are working on something else
On Eva, I think it always supports its own library
the only way to find out is to ask
a profiler should hopefully be able to tell them what the issue is
so many open topics
But Late_GAme works, it responds
I'll try to write there
I wrote, I'll wait for an answer...
But somehow it seems to me that they will simply ignore me
20-30 fps eats up, it's a trifle
But in good large assemblies
This has a big impact on weak PCs.
I want everything to work stably
CullFactor is a temporary saver, but people don't know much about it. We have to constantly advise, attract more testers for it
if it works for people, word will get out, I'm not worried about making outreach
it had a rocky start, but I think it's in a state now that anyone can recommend it, at least until we break more things lol
As soon as CullFactory came out, I immediately realized that it was the future
Woke up, drank tea, went to test it
And I was in awe
I'm cold in Russia :Ρ
just kidding lol
Hey since you fellas play with CullFactory and I've not been up to date with development, does it and lc_office/custom interiors play nice now? π
LC_Office has played nice for quite a while now
the rest, as of the last few days, yes
until someone comes out with a new interior that breaks lol
all the new ones the last few days that I'm aware of work though
Brilliant, I've been wanting to add it to my pack since it launched, it's like better spray paint all over again π
@austere stirrup
By the way, I found the problem
Why sometimes the character was not displayed on the monitor
This is the culprit
Other players are clearly visible, but you canβt notice yourself, it doesnβt seem to be such a problem
yeah, it doesn't surprise me
anything that implements a way to see yourself could mess with that
haphaphwhpwhap
Oh my god, I found a mod
Which just kills FPS
Without it 240
With him 150-190
On the same seed :3
Although it just adds HUD mapping for paint and TZP
Nothing special
oh ouch
Already wrote xD
I remember when I saw this mod - I immediately started testing it and checking it
I haven't talked to Piggy for a long time, I've already made so many mods, I'm just shocked
unity makes it very easy to make poorly performing code
this is interesting and all but this thread isn't a general performance-troubleshooting/song-sharing thread
gotta keep it at least somewhat on topic
Is there any recommended config for this? @austere stirrup
use defaults, they're there for if you have issues
OK
does the mod description mean the player camera or bodycams from mods like headcams?
You can change it in the config
Head or Body
no i mean like, this stops rendering faraway rooms in the players pov, right? not just through cams?
cuz the wording's a little confusing for me on the description (it refers to cameras rather than povs or views)
yeah it also culls in the players' pov
we use "cameras" since that's the way that monitors/radars and the players see things, so that all the cameras that we can find all get the benefit
np!
cullfactory only stops rooms from rendering so if the 5 second long freezes aren't frequent, chances are there might be a mod or two causing that to happen, so that might require testing so you can disable the cause of the problem
if it's at the start of the landing then it might be the interior getting generated, which usually takes a bit to load and that can freeze the game for a while
Just to help give some advice here, sticking LC onto an SSD really helps with performance, Skinwalkers used to give massive stuttering on a HDD but moving the game location to an SSD made it playable. Hoping this helps!
sick sick! im not the one who freezes so i'll tell my buddy about this
yeah they're decently frequent
it happens everywhere for him; inside, outside, at the company, ship, etc
Quick question if you don't mind, are you using Skinwalkers in your current pack? π
we used to, but i took it out cuz we weren't getting any cool interactions out of it
currently we're using a semi-substitute in mirage (it does a lot more than just copy voices but yeah)
but i only have it set so masked characters mimic voices
also coil heads
Yeah I was going to mention Mirage as it supersedes skinwalkers in both performance and quality, i'm trying to think what else could cause the massive lag spikes though. definitely a better IO speed could help, does your friend clean his hard drive? Like is his C: drive >10% free space?
i don't know tbh, i could ask him though
On version 3.0.0 Skinwalkers works in RAM, if I'm not mistaken
if you want i can send you the pack we're using currently if you wanna look into it
But there is no information from them
I'm waiting for a better version of Skinwalkers
It does, however it also brings a mysterious crashing issue, I was troubleshooting with Rug but he said it wasn't worth the time
Use mirage, it's skinwalkers 2.0
Yep, think Skinwalkers but works better and has more features, very configurable
Here's the thread so this poor thread doesn't get flooded π https://discord.com/channels/1168655651455639582/1200695291972685926
Does this help performance outside the dungeon too? Been looking for performance mods since VR has been rough to use
hello @fair oyster, do you have a list of the mods that you found out reduces fps relevantly?
LG and LT do not reduce performance too much, but there is something in it...
Iβm not sure about the API, I thought it was simple, but itβs not true
thanks!
What in lethal Things reduces fps?
I don't know
The code itself
Or is he just interacting with something?
With generation - when it creates teleport traps
many options
Maybe at the start of the game it could make some lag yeah
And I donβt check at the beginning
And on one seed for 5 minutes
That's why things like this
loading into the seed for 5 minutes?
Kinda weird
No
I load quickly
I run around the map and inside the complex
Checking some things
And I keep an eye on the load
It is hard to explain
TME seems to reduce frames when i go on 3rd person but otherwise it works quite well
but yeah..idk abt what's going on with lethalthings but it causes an immense amount of fps drops inside the ship and in some exteriors
is this caused by this mod?
not a big deal but just reporting
Maybe something to do with scrap optimisation? (Unoptimised scrap could cause fps drops in ship (ESPECIALLY when combined with a helmet cameras mod), and if you noticed lower fps on certain moons that might be because the scrap spawned when you landed)
Check to see if the lag still happens without some of the scrap
.
Personally, I think cookie fumo ended up lagging my game a lot, but Iβm really not sure atm
no yeah i ended up removing lethal things a while ago :P
we were mostly using it for boomba and the decorations since we didn't like the new things you could buy off the ship store
Shame, I like boombas and teleporter traps
yeahh i miss those
I really do think itβs the scrap to be honest. Iβm not sure what else it could be
Iβm gonna try once I get home
for me it was the scrap + the item shop stuff
cuz i remember when i disabled those on the config the fps went up a ton
does anyone know if CullFactory works with Office yet?
no problem goat
still got a bunch of fps lag at the company without the items in the shop btw, still don't know what that was about
afaik it does now
Nice
I haven't heard anyone mention issues on it since 0.7.0 released
or probably 0.7.1 actually, I think 0.7.0 was broken
Does surface distance culling require a restart to take effect? I'm trying to mess with the values with LethalConfig with a very large open moon exterior and it doesn't seem to change anything π€
currently it's set up in such a way that it only updates when you enter/leave the facility
should be easy to make it update upon the setting changing, though
Howβs CullFactory with Dantorβs Mental Hospital and PoolRooms?
good, if my testing was any indication
Sweet
performance on Dantor's won't be stellar, since the portals are quite large, but it'll work and it should cull plenty still
Also does cullfactory remove the lag caused by rendering the backrooms mod if itβs being used
probably not
backrooms use their own way of generating the halls, so CullFactory does nothing to it
perhaps someday they'll switch to LLL and make it generate using DunGen though, then it'll work
worked perfectly with entering / leaving, thanks!
is it open source? I think it wasn't last I looked
Mod hasnβt been updated in two and a half months and the creator hasnβt posted here in a month
Uhh Iβll check
The source is available but nothing stating itβs open source
oh yeah, the "Source" tab on Thunderstore is a decompilation
anyways, I'm guessing that if Backrooms causes lag, it's probably doing something wrong other than just putting geometry in the world
so one would hope that if it's abandoned someone will remake it
Iβve heard itβs a source of lag
looking through the code, I don't see anything too suspicious, but I'm sure a profiler would give a better idea of the issue
really every modder should set up deep profiling and check if their mod is causing issues, but even I'm bad about that lol
I gotta do a pass on all of my mods soon
usually bad framerates are a CPU-side issue
just pushed a commit to make that work, it should be in whatever the next update may be
swank, thanks!
off topic question but how do you set a deep profile? google keeps recommending to me use unity's tools but that doesn't seem possible for an already existing .exe
it is possible actually, hold on
https://github.com/dnSpy/dnSpy/wiki/Debugging-Unity-Games#turning-a-release-build-into-a-debug-build
it takes a bit of setup, but it works
you'll have to launch the game with the -deepprofiling flag, then connect to it from the Unity editor
(note that it's not 32-bit, you'll want the x64 binaries)
it also doesn't require an asset-ripped Unity project, as far as I know, you just have to open the profiler however you can
so an empty project probably works
got it chief thanks
yeah, hope it helps you out!
just released an update that fixes changing far plane distances in-game π
Heyo! I have been directed here to let you know of a possible bug/compatibility issue with MoreInteriors. π
ah gotcha
for the time being you can add the dungeon generator for that interior into the fallback list in the config of cullfactory
you can check the plugin logs in the terminal for more info
Heey my theory was correct! WOOT! It was the distance, cull factory does stop rendering faraway rooms. π
Neeto.
Seems like there's an issue with Castle from Scoopy's Variety Mod as well
This was tested with the latest version of EQM
On my testing I'm actually not able to find the error with just EQM, so I'll ask if they had other mods on
while you're here, I had meant to reach out, but there's a specific fix that allows you to avoid needing to be on that fallback list, the door socket sizes need to be set up to encompass the possible visibility into the neighboring tiles if that makes sense
although I'm curious, is that interior in the video the bunker interior? that was supposed to be on the list already 
I wonder if I made some oversight in the fallback portal size calculation
that room and the section that it's culling looks very odd to me though
Is that a thing I didn't know?
We have ours set up so they are 5x5 wide doorways cause of the how wide they are
Will take a look
well, it's a specific requirement of CullFactory, although currently it's not entirely efficient with how some of the modded interiors have been designed
I'm hoping that Batby can give us a method to get the size of a doorway attached to each tile type so that I can take the minimum of the doorways on either side of a connection, then we will have the most efficient possible portal occlusion culling hopefully
what does this mean? that you were using depth culling with too low a range?
No my statement has caused confusion. Other then the change you have reccomended. My config is set to default settings.
and I assume you're on the latest version of CullFactory? the issue may actually still be present if so
unless something was wrong with our default list
if you happen to have your log saved from the session where that happened, I could say for sure, actually
sadly I do not but I will keep playing to try and recreate the issue.
@pliant sundial the thing I wonder is whether that doorway's center point is perhaps offset from the actual horizontal center of that side of the tile bounds, that would cause the calculation of the fallback portal bounds to be incorrect
I went through probably 6-8 rooms in a line and then hit this boundary where the visuals were culled. I was very far from the front door.
It also happened in the middle of the stairway room.
yes for the stairs it is since it is like an L shape
this is basically what I mean visually
ideally, that doorway should be perfectly aligned to the brown line at the center of the edge of the tile bounds
the green rectangles are the doors?
yes
hmmmm
the stairs is only tile set up this way
so they would have been around here?
that shouldn't be an issue because I would expect that to consider the camera to be inside the tile and just render it always
actually, I guess it's on the right side instead, but it should still be considered inside
so the area that is blocked is a blocker that dungen can remove or add in depending on if it connects it is called a scene blocker
the library tile in the mansion does it like this too but not as extended out
which part is blocked? can you point it out?
do you mean the doorways?
@stable mountain just found the tile in question, and I don't seem able to reproduce the issue, was your CullFactory up to date?
the patch notes don't mention it, but you need to be on 1.8.1 or newer or you will have issues on Bunker
ah, so the blocker you're talking about is a wall attached at the doorway
i also have my own LODs for each tile and they adjust automatic for the distance after generation
yeah, that fits my idea of how it works
ye
since the video was taken while inside the tile rather than standing outside one of the doorways like I thought it might be, I'm unsure what the issue might have been
yes it was
really what I need is a map seed to look at the exact generation that caused this
it'll appear in the logs if it happens again
let me see if I have it
issue i can think of is the difference in how mine is culled with LODs and Cull factory with the Occulion culling camera plane distance
yeah, I do wonder if it's your LOD setup
really, I would honestly not have the tiles pop out of existence based on LOD, that seems like it would be prone to issues given that the tiles are so large
ye i have adjusted it so it works for most distance plus the dark inside hides missing tile renders
yeah
I do not have the seed. But I do have more video.
also doors you can't always see thur the other side since doors spawn in
if the LOD is determined by the distance to the center of the tile, though, it might be a bit screwy
how are you determining what LOD scaling to use?
I assume it's not using visibility checks
i adjust manually
oh I thought you said you were setting it dynamically based on the size of the interior or something
i am doing test before uploading to make sure the size is correct
also it is per tile not overall
so each tile is set distance after generation
so the same hallway can still be rendered in on view an culled in another view
per tile is what I expected based on what I saw when you demonstrated it in-editor
I dont know if this will help. This is me entering the door
definitely doesn't hurt to have that context, but unfortunately it doesn't help me repro :(
ok looks like i need to adjust stairs view maybe
since the center point is at the bottom of the stairs
where the culling is targeting
0.8.3
I assume that the LOD group doesn't cull based on the view frustum but rather only distance?
yes
hmm
unless the value changes at runtime I wouldn't think that would be the issue
I should be seeing the same issue if the LOD distance is constant
ye i will test
I have increased my video reecording length so I should be able to catch the seed next time. How do I make sure I get the log you need. Do I have a time limit before the log is deleted/can it overwrite itself? How many logs are saved?
log is override each time game is launched and closed
this will get you the last entry, though discord may not let you post it so you would have to upload it somewhere
the log file is in your profile folder, so if you go to Locations -> Browse profile folder -> BepInEx, there'll be a file called LogOutput.log that is the log for the last launch of the game
@stable mountain Ok I might have been wrong about camera view and LOD
The LOD is based off the position of camera
not the directions of it
So while in tile it should render
So tested without cull factory it seems to work fine.
but with cull factory I need to test maybe it is like edge of camera need to see where it is culling the stair tile to test with in game stuff
CullFactory doesn't cull based off the tile at all by default, it's based on what is visible through doorways
here's a simplified explanation of what it does:
- Find the tile the player is in, make it visible
- For every door in view of the camera:
- Make the tile the door leads to visible
- Check if any doorways are visible to the camera through previous doors
- Make the tile those doorways lead to visible
- Recurse to step 4
The cull factory is based off camera what is directly in view
While LOD is based off where camera position is closet to the LOD group
essentially, yeah
but the weird thing here is, since the camera was within the stair tile, it should have been caught in step 1
I don't know why it would have been culled
unless the bounds of the stair tile are incorrect, but your editor screenshot seemed to show those bounds and they looked correct
Ye that is what I am wondering too
if we can get a seed where this happens, I can attempt to reproduce it and figure out why it was doing that
To add to this, this seems new, as I have video of me wandering around the Bunker and that room extensively and never saw that
it didn't happen for me either
I still kinda wonder if it was something weird with the LOD group
Zaggy may remember that from my bug report video showing the odd doorway clipping
This room was fine
Yeah I could check no worries I am sure i can narrow down issue π
Lucky it is not game breaking lol just rendering
If it is problem can just have the people temporarily put bunker on the exclusion list for cull factory config override and work on fix
It will still be good performance with out cull factory occlusion since LOD still there
Had people report better frames with just that
it's already in the list internally, that's the thing
But would be cool if we can get lethal to have 120 fps
Oh I didn't know that 
Thanks for letting me know 
Yeah for sure
it's a very odd issue though, I have no idea what could cause it other than messed up tile bounds
Yeah me neither
that kind of thing used to happen on the entry point for Sewer
Oh Scoopy had that issue
still can technically, but you have to try harder to get it to happen
the entry room's bounds don't actually block off the whole room, so you can have a room clip into it and get yourself trapped if you walk the wrong way
and there's no way to tell that it's happened before it does so you can just get screwed over
Oh weird
@austere stirrup how be the upcomin update to fix the disappearing interiors lmao, been a while since ive been here
well, from my testing it's all working fine, there's just the recent issue that SourceShard mentioned above
as of 1.8.1 it should have all been good
unless new interiors dropped
which if they do, please feel free to ping me and link them
the ones I've tested are:
- Scoopys (Castle, Sewer)
- Scarlet Devil Mansion
- MoreInteriors (Bunker)
- SCPFoundationDungeon
- Dantor's Mental Hospital
- Minecraft Stronghold
- PoolRooms
All worked, though my testing was brief
Mhm, I can confirm similar experiences for all but Dantor's and Stronghold, which I haven't tested
have multiple people had issues with the latest Bunker and CullFactory, or is it just one person?
as far as I know, one person in one particular spot in one particular seed
it remains to be seen how common that issue actually is, and whether it's an issue with CullFactory even
ah, gotcha
Yeah I haven't been able to recreate culling issue with problem either
could try it with ooblterra
since i THINK that also has an interior?
i believe you needa download it with github, not sure since im just waitin for the 1.0 release
I see
dont quote me on it lol
I'll see if I can look into that later
I have a question @austere stirrup
Mod for BackRooms
I noticed that CullFactory doesn't hide him at all, he sits and hangs out
Doesn't it give any load?
probably, but there's not much I can do about that
how were you able to tell that it's not culled?
I hope nothing was visibly popping
I just used a bug with the reactor
And when I fell down
I saw that the room was constantly rendered
And is waiting for me
Although it was very high
Old screenshot
But about the same, only I was x2 higher
I just installed a patch on this mod and now you can only get there with critical damage, thereβs a small chance, but itβs there
And somehow disable the rendering of these rooms - to increase performance, it would be good
Players love this mod, but the background load is not very...
honestly, I'm not really inclined to add a feature that prevents it from rendering in the background
the mod isn't maintained afaik, and it should really be redesigned to use DunGen imo
once it does use DunGen, the culling will work automatically, at least once I make sure CullFactory knows how to handle multiple dungeon flows at once
as it is, there's no reasonable way to set up proper occlusion culling for the Backrooms area
my opinion is that in its current state, the Backrooms mod should handle culling the renderers and lights itself, since it alone really knows whether a player is inside there
I agree with this
But at the moment there are no analogues of this mod...
And I'm very upset
well, I think you may have a better chance of getting what you want by asking the person making the patch for the Backrooms mod
We were working on our own version of backrooms but stopped since we saw someone else was making one we still have the project files
Could be a thing to add for additional flow for More Interiors
And have its own config
It was in addition to the bunker as a side one
Do you plan to improve further?
I would test this project
I will ask my friend who is the one that made the tile set but finishing up other maintenance tile set
π
With everything up to date I had the issue happen again. I will post video, seed and mod list if it helps. I do not have log though unfortunately.
Unable to post now will post later.
those three definitely should help (I hope)
pitching in, i tested Sewer, Bunker, Castle and SCP Foundation in my pack and experienced no issue across 3 seeds each
Sewer was on March/Vow, Bunker on Assurance/Offense, Castle on E Gypt/Atlas Abyss, SCP Foundation on Titan
Is there any information from Dantors_Mental_Hospital and CullFactor?
Itβs just that Dantors_Mental_Hospital itself is not optimized
Either CullFactor does not understand what needs to be rendered and what to hide...
works fine for me
Dantors_Mental_Hospital?
yes
How many mods are in your build?
145
hospital is unoptimized atm, someone already told you that in the other thread
yes I remember
I just always want to think that the reason is something else...
163 :3
:3
And this is without costumes, sounds and cosmetics
oh boy!
All mods are not based on mechanics, thatβs why Iβm checking...
even if it did, it can only do so much
there is an improvement to make in the portals to get it to be more efficient, but that requires an LLL API that doesn't exist yet
but even when that's available, I only expect that to help by a little
it's always possible to make it render enough that it drops the frame rate
I think I already talked about this.
The more the assembly consumes RAM (for example, installing most of the popular moons from LLL and LE), the FPS drops significantly. What could be the reason? @austere stirrup (Just interested in your guesses)
could be any number of things
and I honestly don't know too much about the behavior of RAM under pressure
Well, I have 2 assemblies, one with popular moons - the other not
And the difference is such that minus 1/4 of the total FPS
it could just be loaded assets that are perhaps unrelated to the framerate drop, or it could be that things are allocating large pieces of data in the code that they depend on and causing a lot of cache eviction
I would tend to doubt that it's related to RAM usage by the game
Most likely it's
I don't know if anyone's done it already, but if not, I guess I should probably write a guide to set up profiling in the Unity editor...
fumiko also has used dotTrace, but that's non-free unfortunately
I'm betting that a lot of mods that cause performance problems have pretty easy solutions that a profiler would point straight to
This would be useful to everyone who does
It's a pity that little is known about this...
Had a lockup while landing on Kast. All players froze and had to relaunch.
Edit: Save was also corrupted.
018dcdd3-0189-f0fd-89b4-9db48ffad9a5
What does CullFactor have to do with it? π―
I have no idea other then the error log showed it did
I would love to know the solution if you find out.
there's a solution I or fumiko can hopefully put together soon that will at least prevent this from causing the screen freeze
or two, actually
the likely cause is that some mod deleted an object attached to the interior generation
ideally no mods would do that, they should really deactivate objects instead, but there's really no reasonable way to prevent it
@glass juniper the (three actually) solutions we could try are:
- Just brute force null check every renderer and light in the interior to prevent errors, but we'll need to profile this to see if it impacts performance significantly. If it does, perhaps we could use a transpiler to make this optional at runtime with no perf impact.
- Move portal occlusion culling into
LateUpdate(), taking a union of all cameras' visibility. This also needs profiling, may be faster than the current approach tbh. It would prevent errors in the culling from causing the camera freeze, so that the game doesn't have to be forcibly exited, but obviously it would still error spam and cull incorrectly. - Add a diagnostic mode similar to the feature I added in OpenBodyCams to optionally track object destruction and check if those objects or their children are within the tiles. This would be useful for determining the mod conflict.
Pinging you here in case you can beat me to this, since I'm in the middle of a few other things that I don't see myself finishing too soon
I would like to report an issue even tho I'm not sure if there's a way to fix it because of how the mod works, but I noticed that the turret's laser can be seen through walls when using CullFactory.
It is especially visible with the mod: "TurretAlwaysLaser" (https://thunderstore.io/c/lethal-company/p/tolstj/TurretAlwaysLaser/)
Would there be some kind of workaround or way to have the laser blocked by walls even if they're not rendered to the client somehow?
for the moment, the only "solution" is to change the culling mode
I'm busy with another big performance project at the moment, so I don't have time to write the code we need to track all the dynamic lights inside the facility, but if I do, I believe the turrets' lasers should be covered by that
basically, at the moment, portal occlusion culling only knows of static lights in the scene, so it can only make walls visible that are supposed to block those static lights. however, since that doesn't include dynamic lights like flashlights and the lamp item, when those are in adjacent culled rooms, the walls that would block them are culled and they shine through the one-sided mesh of your current tile
Ah I see, that makes sense...
But I think my other issue was that when I changed the culling mode, the cams from the "OpenBodyCams" mod weren't working properly since it wasn't rendering the walls from someone else's POV.
Unless this has been fixed somehow I would be trading the "dynamic light" issue with the "BodyCams' " one π«€
unless you were on version 1.8.1+, I would expect that not to be the case with portal occlusion culling
and I believe depth culling also in that version, but I'm not entirely sure
Got it, I'll give it a try right now then to check!
Just to be sure, you mean to say that I have to replace this .cfg setting from the default "PortalOcclusionCulling" by "DepthCulling"?
yep
note that you may be able to see the culling happen visibly with that setting, but with a reasonable tile depth it shouldn't let lights shine through and might not be visibly popping
Got it, thanks! I'll give it a few playtests right away then!
another big performance project? π³
an update for PathfindingLagFix
currently in the process of determining its viability so not sure if it's going to actually be released
neat, hope that goes well for you
it's intended to allow the heavy pathfinding calculations that the AI do at regular intervals not to affect the frame rate as much, but currently I still seem to be causing a 1ms hit per frame while those are running
ideally it would have close to no effect on the frame rate, but
it's tricky, I gotta profile and find out what's affecting it the most, it's a very time consuming process
also unsure if it's stable in the version of unity that zeekers used
we shall see
Is there a way for you to log an easy to understand warning when a mod does this? It would help greatly for testing and for targeting problems related to stability. I would be extremely grateful!
yeah, we can add an option for that like in OpenBodyCams if we don't find the other options to be viable based on their effect on performance
that will be an opt-in thing, though, because the only way (that I know of) to track that is to check for that every single time something in the game is destroyed, and the dungeons can contain a lot of objects we would have to check against
it could cause inconsistent frame times to do that
Hmm what I meant more so is that even if you create a fix for the problem, this may be a problem in the future with other mods. So if you created a fix and also a warning system it would help diagnose other issues that may arise.
right
if whatever we choose isn't a blanket fix that will definitely be a priority
but again, it can't be on by default unfortunately
Hey that is all good. That is what test settings are for.
Thank you again for your assistance. I wish you error free testing on pathfinding fix. π
lol thanks, I'm sure it won't be unfortunately
multithreading is a fun thing and manual memory management makes it even more fun
the good thing is that I'm very persistent
This is the only way I succeed.
wym by this
oh I just meant the PathfindingLagFix v2 thing
(I'll reply to your DM and explain stuff about it in a bit, it'll take a while to type I think)
oh in that message specifically i was curious what you meant by tracking all the dynamicl ights inside the facility
oh, that, I see
well, I need to be able to determine where all the lights are in the interior that aren't part of the interior itself
might be very tricky to get that working, though, it's already been a bit of a pain to do stuff like that in OpenBodyCams and it'll be less visible when something goes wrong in the culling
obviously I could just find all Light components in the scene, but that would be disgustingly slow
fumiko used to have a couple patches that tracked what items were inside to determine where radar boosters are, I would need something similar
I could potentially make it automatic by injecting into every class in the game and checking when fields are set saying that something is inside or outside the facility, but I'm not a huge fan of that idea since it's probably not terribly fast to run a transpiler over so much code
might be the best option for compat though unfortunately
Honestly a FindObjectsOfType<Light> before and after dungeon generation isnβt as big of a sin as you might think but if you wanna be super massive big brain you might actually be able to patch Lightβs OnEnable class right before dungeon generate, have it add itself to a list via a singleton then unpatch afterwards (or just build in a bool check for the entire game ig its probably not that much of an added hit
oh we're already doing GetComponentsInChildren<Light> for tile contents
I'm taking about items you can bring into and out of the interior
if you mean doing that to catch all the lights that could enter, that would be the place to start yeah
but I still have to track things that are bought or otherwise spawned in unforseen ways by mods
oh for that i guess weβd go back to implementing that like couple dozen patches to make the inside/outside y position check more dynamic then just compare y pos on any light component gameobjects?
wait no
Bigger brain
hmm? I'm not referring to an issue with lll
y check shouldn't be necessary in CullFactory since other mods ought to set the flags correctly or other things won't work right
You could totally get away with a on trigger enter box around the entire dungeon with no collisons valid except for all light components
oh that's an idea
that certainly sounds nicer than an all-encompassing patch
I haven't messed with collision much at all but I would imagine I can just scale a cube around the union of all tiles' AABBs and then change some things with the collider?
or are those not even colliders, I actually don't know
more or less yeah
I love reading this and having only a coloring book level of understanding. Big brain people using big words.
currently dies with lc_office (only cullfactory and lc_office used (with dependencies))
~~ill also @glass juniper ~~
yeah, were trying to figure this out, erm, is there a way to keep cull factory from working on certain interiors?
actually dont answer that, i havent tried everything yet :P
checking if it does the same to poolrooms
currently cullfactory assumes all lights and doors in a room will always persist and doesn't get destroyed so if that does happen it throws errors
you are unable to enter
that shouldnt happen upon just walking into the interior though, no?
as expected it works
it seems to be an issue with 1.1.17 of office
since it worked fine today with .16
seemingly just this
yeah, nothing there immediately stands out to me as a reason for something in the dungeon to be destroyed
I can't look into it for a while though
we probably should have a blacklist for interiors that shouldn't activate culling though
we'll need it for Hadal
that would be useful! Tho why would hadal cause issues?
oh wow :P that sounds awesome, and yeah i see
direction-based culling isn't something this mod can do yet though, right?
As in culling everything off-screen, sorry, dont know terminology too well
only stuff in your view
Unity does that automatically
yeah that's the proper term
this sounds closer to what I meant yes
here is a video if its any help
Unity does frustum culling automatically better than any mod script could
(with just cull factory and office)
wooow I see, that's pretty useful
So this mod tries to cull the stuff behind walls that are front of you
portal occlusion culling does, yes
yeah, that looks about like what I would expect unfortunately
I might be able to sneak a look at it tomorrow morning but probably won't be able to fix it
maybe I can shoot Piggy a message about whatever's causing it though
although obviously fumiko could beat me to it too
a hacky fix i can do right now is to exclude tiles from culling operations once we find a null reference during visibility checks
should be fine to just add a null check for each renderer tbh, but we may want to print a warning once so that people can be aware it's happening and have an avenue to remove the check later if it turns out to be a perf bottleneck
yeah, that's probably a use case for the whitelist too
null checks are skipped if a dungeon generator is considered safe
but we'll visit that later, i'll see if i can get the null check working first
@austere stirrup someone said earlier that cullfactory assumes all lights and doors in a room don't get destroyed. Does that mean the door script shouldn't be destroyed or not even the door model can be destroyed?
script as in a component? as long as it's not a Renderer or Light being destroyed it's fine
I would tend to think that things that are being destroyed should be deactivated instead, but I don't know if there may be reasons for using Destroy() instead
Ahh so if I just deactivate the renderer gameobject, nothing will break with CF?
yeah, that should be the least problematic
Renderer.enabled is no biggie either, but Light.enabled will get screwed with by CullFactory (vanilla just uses SetActive() for those)
by using those fields I'm hoping to avoid having to save/restore states
doing that in OpenBodyCams was a bit of a pain
Understandable understandable. For what i will be doing, I probably would have destroyed the renderer
Now, I will just not
sounds good
I wish it wasn't tricky to make it Just Work β’οΈ but it's (presumably, I haven't measured this yet) faster if we assume nothing will change
null checks might be cheap enough for it not to matter though, we'll have to see
it's another call through to native in a hot loop though so I'm wondering
Worst case, give me a public function to remove renderers from whatever collection you are storing them in
Not necessary at all yet though
so you forsee it being an issue disabling instead of destroying? although an API like that doesn't sound terrible, it would probably have to iterate over every renderer in every tile in our cache when you call it which could be kinda slow
Oh I will be disabling them not destroying then. Sorry for the confusion
each tile can have renderers from another tile referenced in it so there's not an easy way to know what collections a renderer willb e in
right, but you said you would like an API
I'm not opposed to it, but abuse of such an API could cause some pretty ugly frame times
Oh if it's too much work then it's not necessary. It was the worst case. However, I would call it once so I don't see it causing frame drops
right, that's why I wouldn't be too opposed
at least given that people would have to create a soft dependency to do that I'm sure it wouldn't be common
not sure if it's worth the effort without a good reason though
Well you already argued the obvious fact that disabling the gameobject is much easier for everyone involved so ya, its probably not worth the effort now
But it looks like my mod won't break with yours. That's what I wanted to make sure of π
yeah, sounds good
hoping that can remain the case for other custom interiors but it does feel a little fragile at the moment
the camera callbacks are useful but also a footgun since they can freeze the game visually
just tested on the latest lcoffice version with null checks in place, it does work
i'll go ahead and test out the performance difference before and after this change now
With null checks: 251.8254ms / 10000 camera renders
Without null checks: 247.6951ms / 10000 camera renders
Difference: -1.67%
Setup:
- Moon: Titan
- Seed: 1
- Dungeon: LCOffice (v1.0.16)
- Office Length Override: 20
- Benchmark taken while standing still after entering through the exit
Uploaded! It should be available for clients very soon
https://thunderstore.io/package/download/fumiko/CullFactory/0.8.4/
i love it when the dungeon doesn't render so i can see where the apparatus is (latest Office on 0.8.4)
from testing, which interiors should go where?
nice, glad it wasn't too bad a hit
oh, does the apparatus room have issues too? the only place I saw issues was in the upper floor door
it does render when you enter it though right?
oh wait I misread I think
if you saw through the upper floor door that's a known issue with LC_Office
oh interesting
