#Loadstone
1 messages · Page 2 of 1
thank you!!! :D
np
In particular, nightly has a new feature for object pooling rn that should increase load times after the first one or two loads, although I also expect it to be pretty buggy
that feature is actually off by default because it's got a lot of potential for bugs
tbh if the nightly is for testing then whats the point of having experimental features off by default
possible game breaking ones vs non game breaking idk
I have more work I want to do with it before I'll be turning it on by default
It has too many known issues and could cause a whole host of compatibility problems
I uploaded that to nightly mostly because I had other features I also wanted to release that had potential to help with some lag issues people have been having in larger lobbies
I could have left it out but I decided to just leave it in with a toggle so people wouldn't have to download it from here if they wanted to try it out
i mean yeah but isnt the point of a nightly to get feedback on experimental features? if you're using a nightly build you shouldn't be upset that your game is breaking
I have other features I want to get feedback on first is the main thing
And like I said, there's known issues with that particular feature that I really need to fix when I get a chance to
I'm mostly using nightly to test features that I think are just about ready to push, but need some more testing before I fully release them
I would say that
Once I push those features to main, I'll make object pooling be on by default
Async Dungeon only having compat issues with Enemy Escape in my pack is a pretty good thing
lol
Well, not fully sure
Have you tried disabling it to see if it works?
Nah I don't have anyone to test a few lands with atm, cus it happened after landing the ship the 3rd time
and idk if I could repro it solo
My pack likes to have issues occur in Multi usually
lmfao
I can pull the seed from the log file you sent to see if I can recreate the issue with it
If it's consistent on the same moon and seed, it'll be easy to reproduce
I'm starting work on a new optimization at the moment
Basically, the game makes over 10,000 checks to see if two given tiles can connect, which is just absurdly excessive
I'm planning on caching some of that data to make it significantly faster. Also, that data immediately gets sorted twice afterwards for some reason
I estimate a 10-15% performance boost once this optimization is done based on my profiling
The performance boost is likely going to be higher with certain modded interiors that might use tile tagging even more than vanilla
Oh, also, that's 10k checks on experimentation
Titan would be significantly worse, as it's exponential relative to the tile count
Basically yeah
It's comparing the tags on the next tile and every existing available doorway's associated tile's tags
It's running List.Contains over 40k times
And this is a $60 asset that Zeekers paid for! It's not even his fault it's so unoptimized
modding saving the game
:3
I've found 2 other pain points that the game has for level gen that I'm also gonna be working on
Although I think I might jump back to performance reports next
💀 $60
Performance report is unoptimized as well?
No, it's just not finished yet
That's fair
You will be a great asset to the company 
paid paid asset

What do you mean?
I'm just that weirdo that would prefer to write it myself than spend $60 on paid assets lol
I'm still working on the performance reports. The server isn't quite ready yet, and the client has 0 code for it
Oh...
I need to finish battling with AWS atm lol
Their documentation is really confusing and unhelpful for connecting to RDS
The Shader Zeekers uses is also a asset?
Maybe, but we have no good way to tell
It seems like he probably made it himself using shader graph
The water, hydrogere, post processing, and locusts/hornets/bees are custom shaders I believe
pretty brave of zeekers to also completely rip the design of the main characters off a fortnite skin
dude's a menace
he stole robots and fire exit from upturned
Yup yup
i swear no one makes original content these days
and the radar booster!
one is the HDRP shader, one is custom-made
Idk which one is the problem, but it was the first time i saw a log saying "Hardware not supported for volumetric materials", idk why this happens
That sounds like the fog, which is built in HDRP I think
😢 cursed to have advantage over Foggy moons
The fog is the only thing built in HDRP?
No, nearly every shader in the game is a default HDRP shader
It means your GPU isn't supported by HDRP volumetrics. Apparently a driver update might help, so give that a try
If not, then you might be stuck until you upgrade your GPU
Is there any chance to Zeekers change the shaders until the game really releases?
I think it's unlikely
Even if he did, there's nothing he can do to fix your specific error unless he completely redoes how fog works for GPUs that don't support volumetrics
Sad, is my GPUs fault anyway, gonna see what i can do about it
What GPU do you have?
Ah, yeah I'm not surprised that such a dated GPU doesn't support volumetrics. Even if volumetrics could be forced to work with it, it'd probably cut your framerate in half of worse
Well... i play LC at 30fps capped, taking more than that would make the game unplayable 😢
might be time for an upgrade
ok, got some optimizations in. Similar call count, ~60% faster
It could still be optimized further, but at this point it's the sorting that's killing performance for that part of the code
too much :c
windows 🤭
true
I use linux already 
Is the game that bloated? Imagine if a bunch of modders united to optimize the whole game
it'd be nice ot have an AIO one mod that compiles bug fixes and optimizations so i dont need like 10 different optimization and bug fix mods lol
could be yeah
Right? That would be a godsend
closest thing you’d get is an AIO optimization modpack
yeah
otherwise we'd need to somehow organize just about every single bug fix/optimization nerd into a singular project
How's the Async Dungeon stuff been going? Still looking into fixing the incompats?
I haven't really taken a look at it much deeper yet
It's unfortunately quite difficult to test and debug because of just how many mods there are and the fact that my normal debugging tools cause the game to simply not start at all
Yeah I still dunno what causes that
it's FixPluginTypesSerialization
Oof
that's causing lag when async dungeon is on?
oh
yeah
well I'll give it a try without that one and see if it works
@halcyon sable sounds like we need a replacement for that then
You can disable it but CSync and LLL may will not work
I wonder if a fork of it could be made that fixes it breaking debug tools
eeh
without unity source code it's hard to fix it manually
and before I message to lordfire to find a solution and #dev-general message yeah
For CSync this patch should fix it #1220488542585753631 message
But LLL it's not possible todo that
Have you hit up @granite heath about this
I have not
the code optimization I added was satisfactory enough for me for my purposes
any extra bonuses would be great of course, but removing the horrendous bubble sort was enough to save my dungeon's loading times
which sort are you referring to specifically?
cuz I've found a handful of unoptimized sorts
there's a couple probably, but the one that was heavily hurting my loading times was the bubble sort after grabbing all potential doorwaypairs
since my tiles were plenty, and they had a lot of doorways
that one's next on the chopping block for Loadstone
i saw 2000 pairs once in my analysis
the doorway pairs section is just super unoptimized lol
definitely lmao
this optimization was also part of that function, but targeting the process of actually get the doors and checking their tile's tags, rather than the sorting of the doors
i transpilied a simple linq orderby and called it a day, major performance difference
yeah lol
I'm planning on bundling it in with the same sort function that they're already using. They have a Linq sort already, but then they proceed to run a tiebreaker sort by hand right after
in the case of vanilla, it's spending way more time spawning in assets than it is doing door checks, but it definitely has the potential to get out of hand with an O(n^2) sort like that lol
forreal
since you are like the first person to really touch the dungen code, i wont be surprised if eventually your mod causes conflicts with mine later
since my mod messes with dungen a bit so i can get better results
so ill be watching you
this is my current list of things to optimize:
- DoorwayPairFinder.GetDoorwayPairs | 360 ms (23.6%) [87 calls]
- OrderDoorwayPairs | 174 ms (11.3%)
- Enumerable.ToList | 167 ms (10.9%) (I've done some work on this one already)
- DungeonGenerator.TryPlaceTile | 218 ms (13.2%) [1001 calls from AddTile]
- IsCollidingWithAnyTile | 107 ms (7.0%)
- TileProxy..ctor | 27 ms (1.7%)
- Dungeon.FromProxy | 499 ms (32.8%) [1 call] (The instantiate calls here are already modified by me to use object pooling, but aren't being cached well for some reason)
- Instaniate | 431 ms (28.3%)
- LogDebug (Instantiate Transparent) | 33 ms (2.1%)
- DungeonProxy.ConnectOverlappingDoorways | 139 ms (9.1%) [1 call]
- DungeonFlow.CanDoorwaysConnect | 91 ms (6.0%) [9345 calls]
- SelectManySingleSelectorIterator | 25 ms (1.6%)
whats your mod ladyraphtalia
this was from landing on Experimentation with just Loadstone and Lethal Config installed in the Unity Editor
ScarletDevilMansion
Touhou related
i think
slightly touhou related yes
oh yeahhh, that one
I've seen a couple "possible conflict" messages in logs before related to SDM, but so far none of them have been actual issues
just my conflict detection erring on the side of caution lol
@crisp relic optimise the fuck out of it then just modify dungen to do simulated generations async as soon as a new day starts so you can prep instantiation and pooling before the lever is even pulled 😜
my dungen patching code is here if you ever think its actually conflicting
https://git.touhou.dev/Raphtalia/SDM_LethalCompany_Mod/src/branch/main/ScarletMansion/ScarletMansion/DunGenPatch
true, I could definitely do that
run a simulated dungeon generation and instantiate everything behind the scenes, just a few per frame, as well as when a new moon is routed to
Also, I'm really hoping that Zeekers updates the unity version of the game soon
Newer versions of 2022.3 have an asynchronous instantiation function that I would love be able to tack on for the extra performance
I’d be very shocked if he ever did
yeah 😮💨
you have no idea how confused I was by the compiler failing to find InstantiateAsync. Unity says it's in 2022.3, but it's a super new feature, so I'm assuming it's not in the old version of 2022.3 that LC uses
it was made for unity 6000 and backported to lts 2022
m
and for experience of other it looks like will not help that much https://forum.unity.com/threads/asynchronous-object-instantiation.1547894/
I have been using Unity professionally since 2011 and in every project, I encounter the problem that Unity's async functionality is not fully...
I don't think it would help a ton for vanilla, but it could definitely help for mods with large texture files or meshes. In vanilla it won't help a ton because ~half of the instantiation lag comes from awakening the pro mesh meshes
still takes a lot of time in main thread
friend
you can instantiate them without awakening them 👀
right
even just to offload the work to another frame
or frame/s
yeah, that's true
and I can also pre-calculate the pro mesh meshes for most tiles and just save it to the prefab
and I'll probably look into that at some point
but I'm also working on like 3 other things for Loadstone atm lol
there's just so much code needs to be optimized lol
And also a lot of it is gonna need transpilers which take at least 3x longer to write and get working D:
That's from Addressables, not UnityEngine
it still calls regular Instantiate under the hood
the new InstantiateAsync method should perform the Produce and Copy methods of instantiation in the background, running the Awake portion on the main thread once the previous 2 operations finish
that's the bubble sort
on Experimentation
xD
Honestly surprised that 600k calls doesn't take longer than 27 ms
hmm, I really gotta figure out why so many FromProxy instances are being missed
ok well I found the answer, not sure what to do about it tho
the game is deleting the FromProxy things before I can process them for some reason
ok I think I found it
the dungeon will attempt to generate as many times as needed until it successfully generates a valid dungeon, and every time it retries, it destroys the previous dungeon, so many of those FromProxy assets were getting removed very early on
ok yup, that was it
now that I've fixed it, I've hit a new record of loading into experimentation in just 668 ms
however
now the entrances don't connect xD
ok I found out the issue
the SyncedObject isn't being spawned in properly
loading from orbit to experi in 668 ms??
the dungeon generation process in 668 ms
also, I've solved the issue I was having
I can't re-parent network objects without NFGO getting angry at me
it's a super easy fix luckily, just gotta remove a single patch lol
testing it rn
yup, doors work again
btw what does this mod do if u turn off async dungeon generation
this is without async dungeon :3
:3
but i was asking that since lunx is using it without async generation.. so i was wondering what it does outside of that
ah
the main thing is that it generates navmesh asynchronously
there's also a couple other minor improvements in the nightly branch that save a little bit of time here and there
i cant wait for it to make it onto stable version
i wish i could test nightly branch with friends, but they aren't really down for being labrats 😔
m
I think I might need to come up with a better way to measure how long it takes to load xD
so much time is spent in animations and waiting for LC's random wait blocks that he has for some reason
I refuse to believe that these numbers are accurate
but
uhhh
I just generated an entire Titan dungeon in 137 milliseconds
ok I have found some issues xD
Seems fine to me
151 ms to generate Titan
What are you doing with reparenting
Object Pooling
I have to null the parent to put it in the DontDestroyOnLoad scene, and then parent it to the place it's being "instantiated" at
issue is, you can't reparent networked objects directly like that
why does it have to be in ddol
so it doesn't get destroyed when the ship takes off
could also be in ship scene, no? don’t think that helps tho
yeah I suppose it could be
should be able to reparent since it’s dynamic?
idk, all I know is that NFGO throws an "IllegalParentException" if I don't parent it to an existing, just-now-spawned network object
so for now I'm just not pooling objects whose root is networked
so just spawn a pooling parent?
I could, but not many objects have that kind of setup. 11 was my last count
so for now I'm just not bothering with them
I could be so wrong but I think you might be causing issues your not immediately picking up
I don’t think it’s just root
A NetworkObject parenting solution within Netcode for GameObjects (Netcode) to help developers with synchronizing transform parent-child relationships of NetworkObject components.
there's definitely some finesse I'm gonna need to do to make networked objects behave properly
as is I don't think this setup is vanilla compatible
it should be
oh also
You can have NGO’s move to active scenes
If that helps at all
m
actually no you will want then ddol
100%
To keep them out of default FindObjectsOfType checks
anyways, clip of me loading on Titan in 1.52 seconds, of which only 147 milliseconds is spent generating the dungeon
I'd just like to mention that, the game has an intentional 0.8 seconds waiting time before actually generating the level. More than half of the time waiting now is waiting for the game's intentional slowdowns rather than level loading
oh wait right, needs to be mp4
MP4 version
This issue is now fixed
LOL
also, loading into Titan go nyoom :3
LLL helps with that too
Cus it prevents the unoptimized version of the Facility from spawning on it
XD
this is without LLL installed
m
I was just saying :3
:3
I'm about to push an update to nightly
it'll contain some new optimizations to DunGen's tile tagging system, as well as changes to Object Pooling (still off by default because it's not close to stable yet)
I doubt it, I haven't looked into that issue yet
Fair enough lol
the nightly update has been released!
here are the patch notes:
Loadstone Nightly v0.1.3
- Added the DunGen Optimizations module
- Improves particularly slow parts of DunGen's level generation algorithm. This module will be getting more updates and improvements in the future
- Updated Object Pooling
- Object Pooling is still experimental due to compatibility issues with other mods
- Object Pooling has received improvements to which objects it is able to pool
- Most tiles can now be pooled properly without issues
- Previously, tiles would be deleted due to DunGen regenerating the level from scratch when an error occurred
- Now, DunGen will properly release tiles when regenerating the level, substantially increasing performance
- Object Pooling has been updated to work better with NetworkObjects

for anyone wondering, this is related to the CullFactory issue from before. LoadstoneNightly with Object Pooling causes CullFactory to error, which then prevents Imperium from setting up the teleports to Main Entrance and Apparatus
so u gonna fix it on ur end?
Object Pooling is set to be disabled by default for a reason
It currently has known issues
that's weird, i'm testing the new nightly buiild rn and I have teleports to both of them
and on a custom moon
i mean lunx literally said it
object pooling is disabled by default, so u shouldn’t run into the issue
but what i meant by my question is if this was something that should be fixed on loadstone’s end or cullfactory’s
it might be a little helpful to at least let the cullfactory dev know what’s up and get some of their input
more like n
more like
It's 100% a Loadstone issue
I need to reset the tile information when reusing them, which I'm currently not
The cullfactory dev knows about the issue, and that it's an issue that I need to fix with Loadstone
Do you have cullfactory and object pooling? Also it'll only happen after re-landing in the same interior
I landed on cosmocos multiple times in a row and I always had entrance teleports
And yes I had object pooling enabled
And cullfactory
ah
that's really weird, because in vanilla it's pretty consistent
if I land on experimentation twice, the first time it works, every time after doesn't
just to check, did you restart after enabling object pooling?
ohhh wait
I think I know
turn off async dungeon
I'm patching a method that async dungeon completely overrides lol
I need to add a check for when both are enabled
yeah try it without async
if async is on, the tiles themselves won't be getting pooled
I'll try later if I can, since I'm not home
ight
actually, I just remembered, I have that specific patch separated out as its own module now. You can keep async dungeon on and just disable the Dungeon Realization module, which is the actual conflict. Disabling async dungeon would also disable that patch because it doesn't do anything without async dungeon
ok yeah, I just confirmed that's the issue
I'll push an update rq that makes tiles work when async dungeon is enabled
ok, v0.1.4 should fix the conflict between Dungeon Realization and Object Pooling
I kinda forgot about that particular issue because I've been testing with Async Dungeon off to make it easier to profile everything
@granite heath it seems that the time has come where I'm now breaking SDM lol
it seems like my initial caching is missing some of SDM's tiles when processing its dungeon flow
I think it's an easy issue to resolve at least
v0.1.5 just got released with a fix
if a tile that should be cached isn't, it'll cache it as it goes. I'd still like to cache the tiles initially rather than at generation time, but it's better than crashing
At what point does the dungeon flow prefab for SDM get instantiated and set up with its tiles? That particular error is showing that it found the dungeon flow, but didn't find one or more of the tiles that it contains
ohh the entrance vanilla tile
I'm setting the cache up in RoundManager Awake
It might be too early tho
definitely too early, i am messing with my dungeonflow and archetype files right before i generate the dungeon
i can probably easily fix it by adding all my tiles to a tileset so you can cache them
then ill fix it later
m
wait shit, one question. do you cache at every roundmanager awake
so rn my system uses Resources.GetObjectOfTypeAll to get all Dungeon flows, then scans the lines and nodes
yes the cache updates on awake
specifically im asking for the edge case where the player loads my dungeon (the dungeonflow gets modified), they leave to main menu and load back it. in that case the dungeonflow has been messed up and your code may cache bad data
o, btw, I have SDM in my dev testing profile now so I can check for compatibility with it now :3
It seems to be popular, and also performance heavy, and apparently has custom scripting going on a lot as well, so I figure if SDM works, just about every interior mod should
if the player quits to menu and goes back in, it'll recall awake which wil completely override the existing cache with the currently detected dungeon flows
okay so i just have to fix my assets after dungeon generation okay
worst case, i do a roundmanager awake before your mod to fix any of my dungeonflows tom-messery
which is probably the safest solution all around
yeah
I should prob also do my caching later
the caching I'm doing works for vanilla, but it's not quite soon enough for other mods
If I did my stuff right after DunGen picks the flow to use would that work?
well, to be specific
it would have to be after LLL calls its loadDungeon event function thingy
DungeonGenerator.OuterGenerate
is where I could put it safely I think
any later than that and I risk it running multiple times
I haven't looked at LC code in a fat minute, so I forget
But at least I can fix my dungeonflow just for you in roundmanager awake, before your mod
and in case you move your cache calls somewhere else, it would still work probably
lemme check where LLL does its stuff
because realistically I should move the cache to at least run after LLL does its setup
otherwise that's just asking for issues
yuh
i assume you released the update that broke my dungeon yes?
so i can test/add my fix to it tonight
I've also released a workaround patch
if it errors while using the cache, it'll produce an error log and set up the cache in the middle of generation
it's basically a catchall for anything that falls through the cracks
nice
so i can still see the error if my fix dont work? but i could see it not error which means my fix worked?
in theory yes
great
you can also downgrade to v0.1.4 of nightly to get the original error
also, I'm moving the caching to DungeonGenerator.Generate
by the time that gets called, the flow should realistically be set up, as that normally gets configured by LC before calling generate
mkay, ill just add multiple failsafes to make sure everything goes smoothly
ight
hopefully issues like that won't be getting pushed anymore since I have your layout in my testing tools
it's a good performance benchmark seeing as it takes twice as long as any vanilla layout, even with the extra optimizations you've added
plus it's a mod that I'm likely to conflict with more in the future
I'll keep you updated if/when more issues arise
xD
I think I have dungen on the brain lol
I typed dungen instead of dotnet to build my project
oh yeah, I keep forgetting
objectPooling keeps spawning in every single steam valve at once and completely breaking audio xD
I've confirmed that the late tag caching setup is working without causing any issues now :3
also, I have a ton of missing materials in SDM, any idea why?
missing mats? not entirely sure what you tryings to do
ohh
that's probably the navmesh surface stuff
i dont give them materials since they are culled out anyway
ah
ok yeah going in there as the player it's fine
it's just imperium freecam that shows it
oh yippee, another error
if I had to guess, this one is prob related to object pooling
which is why it's still off by default lol
I'm guessing that the DoorwayCleanup script got scooped up in Object Pooling, but some of the blockers got destroyed, causing it to just have invalid references and error
I wouldn't worry about this issue for the time being btw
Object Pooling still needs more work, and I'm gonna be making an API for it as well that you'd be able to hook into to register scripts that should or shouldn't be pooled, and how to treat certain scripts if they get pooled
it sounds probable, the doorwaycleanup script is a bit finicky
you'll also be able to tap into Loadstone's Object Pooling system as well if something would benefit from it :3
not entirely sure how it would help me yet, but time shall see
ye
it's best if you have a bunch of the same object that you're spawning in, or objects that have an intensive one-time setup (like pro mesh objects in vanilla)
I'll also be using SDM and probably a handful of other popular interiors to stress test my implementation
I want the default behaviour to be as stable as possible
it might decrease performance with modded interiors having to make those checks, but I'd rather have reduced possible performance gains than force people to restart their game every 5 landings because a bad interior got cached
and, mod devs will always be able to integrate with Loadstone if they want to make a custom, specific implementation so that Loadstone doesn't have to just blindly assume that custom scripts should never be pooled
at least that's my logic
its good logic, you probably have to guide my hand if i ever need to make custom implementation for my dungeon to work
ight
my goal is to make it as simple as possible really
it'll prob be as simple as registering two delegates, one for unloading a certain component, and another for loading it back in
and I'll also have internal helper functions for instantiating and "destroying" objects that should be pooled, and maybe a snippet of sample code to set up a function that chooses the right call to make based on whether Loadstone is present in a given modpack or not
Also...
Yippee! We just hit 100k downloads on the main mod :3
I've noticed that object pooling seems to break after the 2nd moon
but i've only gone to custom ones
so I'm gonna see if the same thing happens in vanilla
yeah just got bored and felt like testing lmao
Lmao
yeah, it doesn't reset objects properly yet
the next step for object pooling is gonna be getting object resetting working, setting up nice defaults so it plays nice with modded interiors, and then setting up an API for mods to interact with it and tell Loadstone how to deal with their components
all that will probably take
quite a long time
I'd estimate it'll be at least a month before object pooling is truly ready
and it could easily take longer than that
What requires an API
I mean, it doesn't require an API, but I can't guarantee the components will be set back to their original state without duplicating them from the prefab, so that'll be the default behaviour, with an API to register your components with methods for how to remove and re-add them when they get pooled
for vanilla components and most stock unity components, it'll be set up with default scripts, but for custom scripts, I can't possibly write a compatibility fix for every single mod, so I need a generic method that'll work, even if it's less efficient. The API would let mod devs make their behaviours more efficient when object pooled
unless there's an efficient, generic way to reset components
I mean, there is the "ResetComponent" function, but that resets to editor defaults, not the prefab settings
there's also gonna be exposed functions to use the object pooling system if people want to tap into it for some reason
currently, Awake and Start aren't being called
it's one of the many things I need to fix
how do you fix that
the only way I can really
I need to loop through every monobehaviour and run it manually with reflection
I'd love to use the function that Unity does, but Instantiate.Awake isn't an actual function, it's just produced by the profiler when debugging
I do need to figure out a proper solution though. There's not really a good, generic solution for this unfortunately. I can't even just re-instantiate the components like I was thinking because then the object references will be referencing the prefab and not the new component, and any references to the replaced component will be invalid too
I think the best solution I can do really is only apply object pooling to tiles with components that have explicit behaviours for object pooling, which could be as simple as "do nothing" for meshes and colliders, or a complete reset of every single variable followed by running Awake and Start for more complex components. If the prefab contains any components that Loadstone doesn't know how to pool, it'll produce a warning for that prefab and mark it to never be pooled, otherwise it'll mark it internally as OK to be pooled so I don't have to recheck every component every time
with that system, it'll basically be entirely up to mod devs to add object pooling support by giving Loadstone handlers for various custom components that they might use
or if they don't use any custom components, it'll just work
Alright, it's about time for a main branch release :3
Loadstone v0.1.5
- Ported many features from nightly to main!
- Code reorganization
- Introduces modules internally, which reflects newly added toggles to disable modules if needed
- Improved Navmesh Async Generation
- The dungeon itself will now generate its navmesh asynchronously
- Removed inefficient object searches from LC's code
- Added the DunGen optimization module, which contains new optimizations to improve DunGen's performance
- Code reorganization
- Nightly only features
- Object pooling still remains nightly only due to a number of bugs
- Improved DunGen Optimization Module compatibility
- Should fix issues with SDM and other modded interiors
- Waiting music will now load as soon as you join a ship, rather than during level generation, so as to be less intrusive
tl;dr
Loadstone v0.1.5 has everything from nightly except for object pooling seeing as it's been pretty stable with no major issues being reported recently
waiting music?
ye, if you have LCSoundTools installed, you can enable waiting music in Lethal Config
oh
someone asked for it so I added it because it wasn't much effort lol
What inefficient vanilla searching?
FindObjectOfType<StartOfRound>();
it only saves like 1ms per call, but in total I've seen it add up to over 15 ms in a single frame from how often he does it
there's also other similar calls in other places, but the ones I've patched mainly have been the most frequent calls to it that could easily be replaced with an Instance getter instead
ye
I've seen some places where I could do FindObjectsByType with an unordered search, but those issues have been masked by much bigger ones in my profiling
oh, I've also seen places where he does FindObjectsOfType, then proceeds to sort it manually
:3
not noticeable at all that I've seen
I mean, unless you spam it 40k times, but even addition would be (and is) noticeable at that scale
heard
Oh also vanilla terrain isn’t set to instanced right?
I think you could sneak that on in an OnEnable prefix
vanilla terrain actually is set to be static it turns out
There's some parts that could be static but aren't, and others that are appropriately set as static
it's a bit of a mix
ah
does GPU instancing actually help with terrain though? There's only one of it, so I'd imagine the overhead would make it worse, no? Or does GPU instancing work differently for terrain
huh
interesting
I'll look into it
so far my luck with enabling GPU instancing at runtime has been poor though
I tried using Graphics.RenderInstanced at one point in a different unreleased mod and it just wouldn't render, so I ended up using a for loop instead lol
I still don't know why instanced rendering failed
iirc the crash is related specifically to pressure zeekerss post processing puts on it mixed with the first frame initialisation of the terrain but still recall performance diffs
I wonder what lc stuff is running on update
do u know how many times a second Lethal Company's FixedUpdate will update?
is it unity's default of 50?
as far as i can see Zeekers did not use FixedUpdates at all so it should be default
better to run custom enemy AI stuff on Update or FixedUpdate? i figured fixed is better since it wouldnt unnecessarily tax the system more if it can run high 100+ fps.. Update runs on every frame. is it super necessary for the AI to have the latest info? fixedupdates' 0.02 updates a second seems fast enough.
but ur also telling me zeekss never touched fixedupdate.. so currently all enemy AI runs on every frame?
sorry for asking here btw. adi seem to know a lot so i wanted to get answers from her.
the point is that no matter where you put it. if the call itself takes a lot of time it will always hang the game
as unity does all in one thread
you should split the computation into a corutine and make it yield as frequently as possible
so you distribute the computation over multiple frames
🗒️✍️
yes and yes
thanks
Zeekers doesn't run any AI on fixed update
Instead, he has some code running every frame in Update, and some code running every 0.2-0.35 seconds depending on the enemy settings in DoAiInterval
Also, to answer the original question, he hasn't changed fixed update from its default of 0.02
So it should run 50 times per second if you use it
He's super inconsistent about whether he uses Update or DoAiInterval
I've seen him do physics checks and LoS checks every frame in update, every few frames in the ai interval, and also on an entirely separate timer for thumpers for some reason
In fact
I don't think he calls FixedUpdate at all
Imma check rq
iirc blob using fixedupdate for animating
Ah, of course
Don't use fixed update for any code that should be run on a fixed interval so it doesn't get affected by lag
Use it for animations instead so that they aren't connected to the framerate
ok
in all 821 scripts that the game uses
a grand total of 5 actually use FixedUpdate
Blob uses it to lerp its bones to their chosen positions
DeadBodyInfo uses it to give dead bodies buoyancy in water
NetworkRigidbodyModifiable uses it to update the kinematic mode of rigid bodies
RadMechMissile uses it to handle despawning, collision checks, movement, and rotation
and ShakeRigidBodies uses it to, well, shake rigid bodies
so, I mean, the cases where he does use it make sense generally
except for the Blob
that really should be in Update I think so that it matches the framerate
thanks a lot for all this info 🙇♂️
np
actually couple more question. ✌️ how many updates per sec is DoAiInterval? and is that something that could be used by modders for custom AI stuff?
the AI interval varies from enemy to enemy
you can set it to whatever you want
the default value is every 0.2 seconds, but some enemies like earth leviathans have it set to 0.35 seconds
alright sick 👌
trying to survive waking up after a very late flight anf just skimming some of the source code mindlessly and will share any weirdness i find
no idea if any of these are worth adressing
all the animaiton calls in PlayerControllerB.Update() could use hashes instead, with the amount of calls and it being update might be worth it
lemme check my profiling rq and see
this is called by half a dozen things and could be cached quite easily
in RoundManager
so there's not too too many of them being called on the dungeon generation frame
oh yeah most of these aren't level loading specific
but there's a lot of them about half a second later when round manager spawns all the map objects and such
StartOfRound.RefreshPlayerVoicePlaybackObjects() also has a nasty FindObjectsOfType call and GetComponentInChildren call considering how many things use it
EnemyVent.Start, EntranceTeleport.Awake, and RoundManager.SpawnMapObjects are the top three in that frame
A lot of it feels just like Zeekerss never learned the pattern of certain objects adding themselves to a list in a singleton on awake
yeah lol
yeah
oh wow
if you want a fun rabbit hole to dive into (again more general than level loading)
look at the uses of GetComponentInChildren
GetComponentsInChildren is actuall a lot more efficient than the FindObject(s)OfType calls that he makes
he's running it nearly 50 times for some objects and it's barely taking as long as one FindObjectOfType call
oh damn really?
yeah
whats the tag calls like?
oof
you can't add new tags at runtime
explains why its so efficient though
which makes new footstep surfaces really annoying
oooof
btw, this is using dungen to patch out like 15-20 of the worst offenders already lol
are you just profiling editor playmode or did you get a build working
I wasn't able to get the build working unfortunately
this is with mods in the editor
bet
I wish I could because the editor does slightly inflate some calls like instantiation calls
which I try to account for whenever I make my estimates to how much performance I can shave off. With instantiation, if it's not using files cached in ram, it can easily take 50-100ms for a single call of the function, but in game it's never going to be that slow
all my tests are after one or two landings to make sure its all cached
heard
I know getcomponent calls are relatively trivial in comparison to other stuff your targetting but i forgot how rough quicksand trigger was
yeah GetComponent is super cheap as well. On the order of a tenth of a millisecond
ah nice
I really hope they do even half of the things I'm doing in Loadstone
I literally told them the exact functions they need to optimize and suggested the implementations I already have xD
wait why does the shovel hit contain a findobjectoftype roundmanager call
nice nice
why not 
i think most devs are open to specific feedback like that aslong as it's clearly thoughtful and the person isn't being arrogant about it
ye
I tried to word it constructively. The asset does do a lot of things, it's just missing some huge optimization potential that bogs it down
dunno
I didn't specify that my experience with it is through modding lol
I just said that I've been using it
technically correct :3
the game's scripts are generally pretty decent at runtime it seems. The worst performance I can find is PlayerControllerB's Update loop, taking a grand total of... 0.37 milliseconds
whats the big offenders in there?
the game spends over 18x longer just updating animators lol
yeah animators are rough
the sphere overlap for checking for nearby players for insanity
takes smth like 0.07 milliseconds
in the offical unity ebook for optimisation it does strongly suggest caching the animation hashes instead of constantly using the strings
I'm not even talking about how he interacts with them. That step hardly even registers in the profiler. No I mean like, the animators actually processing their state and updating every frame
even with jobs it's still taking 6-7 ms per frame
oh wait actualyy
it's not the animators
for some reason the IK stuff is part of the animations section
ig it makes sense
but yeah the IK is taking far longer to calculate than every script in the game (at least on experimentation right after landing with 0 weather lol)
Again this is from what i've read not what i've tested but apparently layers are pretty expensive in animationcontrollers
player is juggling 6 of them so that could be a reasonwhy?
uhh
lemme break down this frame rq
we got
5.81 ms spent processing IK
0.36 ms spent processing MultiRotation constraints
0.70 ms spent sending the rig position data to the GPU
0.15 ms spent "writing properties", which seems to be the generic form of affecting the rig, as it's affect RectTransform data and GameObject active states
and 0.09 ms spent with some miscellaneous other writing tasks
leaving 0.51 ms of unaccounted for time, which I believe is mostly spent looping over animators from what I can tell
so even if layers are expensive, the IK is far far worse
because I still don't know where layers get processed in all that tbh
damn ok
setting the animator values doesn't take too long either
I wonder if theres a reason the player's animator isn't set to culling at all
it's not even registering one hundredth of a millisecond
also, all of this pales in comparison to the laggiest part of the game
HDRP
although it's super inflated by deep profiling, because I was running 15-20 FPS when I can easily hit 100+ in game
lemme check a profiling run that wasn't deep profiled
ok yeah, HDRP shows as 20-40 ms per frame with deep profiling
it's closer to 6 ms without deep profiling
also, the IK calculations are actually way more reasonable with deep profiling off
the entire animator update is taking less than 1ms in a standard profiler run
as opposed to 7 when I had deep profiling on
alsoo
turrets are laggy lol
well, they create lag spikes to be more accurate
but there's also 20 turrets on the map
so
it's not too bad
I think the model is worse for performance than the raycast check every fifth of a second
the two laggiest scripts seems to be PlayerControllerB and OccludeAudio
they trade off on which one is the laggiest each frame
still though, neither of them take more than a fifth of a millisecond
this is the laggiest frame I can find
and I mean
100 raycasts in a frame is quite substantial
100 raycasts should be fine?
it is
it's still less than 1ms
so I'm not even gonna bother touching it
by far the slowest part of the game is HDRP
50% of the frame is spent on that
which is to be expected honestly
yippeee
also your results are slightly fucked cuz of the lack of info on the post processing
yeah
I think I have some runs from in game tho
I don't remember which profiler saves of mine are from in game
i forgot that some maps have really bad mesh colliders. curious if the cooking of that is noticable
lemme redo it :3
which ones?
dunno if it bakes in any regard cuz its a scene tho
vow?
ye
I'll hop into vow and see how the performance is
its the out of bounds one
and I'll also spawn a bunch of enemies to see which is the laggiest :3
I love having to change which unity player DLL I use based on the mods I'm running and what I'm doing :3
😔
yeee
oh, I should turn off object pooling lol
I forgot about this stupid bug xD
never seen it in the facility, just the steam valves complaining in the logs
I figured it was doing something like that
might also be why this happened
things like this are why it's not on by default even in nightly lol
reading all of this every day is so interesting and idk why
too many known issues
glad you enjoy :3
nothing I can see. Unless the baking function doesn't have the term "collid" in it
the laggies collider thing I can see is SyncColliderTransform, which doesn't take more than a millisecond at most
ok, so, the laggiest enemies in the game
Forest giants are up there pretty consistently just about every frame
they seem neck and neck with hydrogeres for making a single raycast every frame
on some frames though, brackens beat out either of those two, but those two are every single frame
aaaand none of them take more than 0.16 ms to calculate
so nothing too crazy for lag
wait wait wait wait
no
no this has to be wrong
?
the laggiest enemy in the game
according to the profiler
is manticoils
but
that can't be right
because that's standard search
i could see that
dont they like cluster up
why do only they show in the profiler
into groups
I only have one spawned
they also like do some flying stuff too right
ye
i wonder if their navmeshagent settings are different
maybe
like their searches might be more involved
I wonder
lemme spawn like 5 more
oh, also
I did learn something useful at least
EntityGizmo.Update
is the laggiest script in the game once you have a few enemies spawned
ok yeah manticoils are just laggy for some reason
but I do wanna know why other enemies aren't showing their standard search in the profiler
oh wait
I'm stupid
EntityGizmo is from Imperium I think
that can be ignored lol
oh, nice
didn't know that existed
either way though, I think the question is basically answered now
none of the vanilla enemies are particularly laggy, and the game isn't super excessive about object searches outside of Awake and Start, so it doesn't affect runtime performance too badly
the vanilla script that causes the most lag though is OccludeAudio, which takes a couple milliseconds on some frames in its OnTriggerStay function
if I wanted to look into improving runtime performance, I'd be looking more at optimizing the game's HDRP settings than I would any script in the entire game. I might mess around with the HDRP settings at some point to find which one is the laggiest, but that's another project for another day and would be an entirely separate mod if I did it
I have a hunch that the volumetrics might be quite laggy tho
which is actually something I think I could optimize to a degree
cuz the game doesn't need realistic volumetric lighting, and there's some pretty good approximations that are far more efficient (and also more friendly to older GPUs as @hushed zephyr would be happy to hear)
but rn my focus is more on optimizing the game's loading, because that's where the biggest improvements can be made rn
in particular for volumetric lighting, I remember hearing about a recent technique for frustrum aligned volumetrics that allowed higher image quality with larger voxel sizes, and I've also found a number of approximatinos and techniques I could use to emulate some of the major effects of volumetric lighting without actually calculating it properly
it'd be a lot of time and effort for one person though
there’s a mod called lethal casino and fps drops whenever u go inside the casino building
and i think it’s coz volumetric lighting like u say that’s causing the lag
the fps drop is even more pronounce in vr 
yeahh, the game's rendering is quite inefficient
a large part of it is simply because the game uses HDRP. HDRP is known to be quite costly in terms of FPS across basically every game that uses it. Volumetrics just compound that issue, but LC gets away with it because of the reduced render resolution
unless you use the HD lethal company mod to bump the resolution of course
520p gaming
yup
I've never even bothered running the game at anything close to 1080p. My 3070 would rather be unplugged while the PC is on than run the game at that high of a resolution
I remember someone else saying MantiCoils were the laggiest too, I think Toilhead makes them worse cus of the Manti-Toils and Manti-Slayers
oof
yeah I dunno why they're so bad, but unless the unity profiler is bugged, they seem to be the worst
at least their scripts don't compound the more there are
You were playing it at 1080p with my pack
the flocking behaviour means it's only running at most for one or two of them at a time
Lol
oh was I? lol
normally I configure the HD company mod for 1.5x
ah
yeah I use HDLC normally
is LCUltrawide better for performance or just more stable?
both
nice
@crisp relic it might just be the fact it's looking at nonwalkable layer + it's small radius?
yeah has wayyyy more viable places it can go
it removes all nodes outside the radius, which I've seen with my own debug mod takes a few frames, and then it'll clear every remaining node with the LoS check of the search
so it's just gonna be constantly restarting the search
the search routine doesn't care about navmesh layers though
which function again?
uhh
StartSearch
in EnemyAI
that whole coroutine it starts up
that coroutine is causing the lag
I think it's causing lag because manticoils can see nearly every node in the map, so they keep restarting the serach every couple of frames
its hard to keep up with what its doing but it does in some places
IsPathIntersectedByLineOfSight() calls agent.CalculatePath() which would use the navmeshagent layer settings
would really love to see that
Same bro, idk half of the things they are talking but i end up learning why the fps is so damn low on my pc and some insights of what Zeekers did on LC
Yeah, my pc dies when volumetric are enabled but gladly, for some reason, HDLethalCompany disables all volumetric materials instead of just the FOG, the game loses a lot of atmosphere but i can play it atleast
Re-shade project? 🤔
its really worth mentioning that overall the game is really well made, espicially with Zeekers previous experience in mind. A lot of the stuff being pointed out in this thread is mostly nitpicky or things that are likely remnants from pretty early development of the game
I believe in Zeekers as a dev, he has done very good games and LC is just in early acess, i bet these things will get fixed on future
Or atleast a lot of them
eg. one of the biggest, easiest things to solve that's been mentioned in this thread is the function FindObjectsOfType. What this does is provides a list of objects/components of a specific type by look at every active object in the loaded game. This is a pretty expensive thing to do because of how many things it needs to look at (espicially considering about 99% of the things it's looking at aren't what we want). In an ideal situation the things were looking for would instead each tell the game they exist when they first startup but for the most part that has yet to be implemented in a lot of these situations
it's also worth noting for prototyping a game that could change a lot it's just very easy to use FindObjectsOfType because you just kinda do it and it works
spending a ton of time optimising something you might completely delete by the end of the year isn't great
Imagine if loadstone expanded from just loading times to optimizing a lot of the game lol
I never touched C#, but this couldn't be done faster with hashcode or binary search? (Idk if C# has hashcode)
Or some call that goes straight into the object that's searching
it searches every object
💀
and this runs on Update? 😳
well, it's the simplest way of getting those references without keeping them yourself
🥺
Yes, absolutely
Zeekers may not write the most efficient code, but he's an amazing game developer. They're two different skillsets entirely, and making an entire game solo like he has isn't an easy task
Those techniques rely on having a sorted list of everything you're looking through and/or that the list is indexed by the thing you're looking for. A generic search like what unity provides can't really do that unfortunately
I've dabbled in game dev before, but it's not an easy thing to do. I'm most comfortable with programming, which is why I'm optimizing the game's code so much, but ask me to make a new enemy from scratch that matches the themes the game already has and I wouldn't even be programming it yet after two weeks of work lol
Optimization is just a niche that I enjoy working in :3
game dev is one field that very much abides by the phrase "A jack of all trades is a master of none, though oftentimes better than a master of one"
it takes a lot of skillsets in a lot of different fields and programs to make a full game
:3
Am I right in assuming that the latest Loadstone build causes desync issues?
Nope. I'm using Loadstone in pub lobbies
m
try disabling dungen optimizations
It was fine up until the latest update
im testing with the previous version of loadstone right now, but yesterday when using latest loadstone people were seeing doors that weren't there for the host/vice versa, despite us having the same interiors/same mod code.
were you using modded interiors?
yes, but it was happening in the vanilla mansion and facility as well
For me it was primarily Facility that was being desynced. No issues in Mansion
this is from yesterday, right is my (host) dungeon, left is what the client (res) saw
hm
I'd recommend downgrading to 0.0.9 for now until the issue is resolved
interesting
I've only seen that issue reported with a feature that only exists in the nightly build
ok yeah I'm downgrading to 0.0.9
I've tested with LoadstoneNightly 0.1.2 and it was fine then
if it helps, i used the default settings for latest loadstone except async dungeon was disabled
that does help a bit
ok, for now as a temporary fix, the main branch of Loadstone has been downgraded back to 0.0.9
I'll be looking into the issue and I'll try to get a proper patch out as soon as possible
Can't wait, coz the load times are definitely better, even with 0.1.2. Item pooling didn't seem to have many issues in vanilla. Didn't test out with modded interiors tho
object pooling does have some new issues in 0.1.5 on nightly. In particular, this one lol
I'm gonna design a test suite so I can verify vanilla compatibility for future releases
I feel like there needs to be a way to report errors and bugs in game
A lot of people don't know how to report bugs or just don't do it because it requires leaving the game to make a report
That or something similar to the Guardian mod for Rain World that detects which mod is causing errors and automatically sends an anonymized report to the dev
He responds in patreon channel sometimes but usually he’s very hesitant to respond in general
I agree tho
I also mean for mod devs
But yeah the game as a whole could benefit from in-game bug reporting
github and discord threads are best your realistically gonna get
Yeah
But
So many people would rather just uninstall the mod without saying anything
yeah but i say this respectfully a majority of this community are not smart enough to meaningfully report anyway
They don’t even know where things are installed
Is this mod bugged?
Fair
That's where guardian-like reports would be nice though
Automatically detect whatever mod seems to cause issues, and send the error(s) + a mod list to the devs
how do you define an issue
0.1.5 was apparently
I downgraded the mod to 0.0.9 until I can fix it
Ooh.. thanks!
Yeah I was so confused yesterday
a error in a prefix patch on say roundmanager awake would fuck up it’s singleton reference and cause and error in a majority of mods that try to reference it for example
A majority of those issues would be falsely reported
Correct
It'd be something though
I dunno
I need to figure out how guardian handled that
yeee sorry not trying to dismiss it outright
Ye
It's a fair issue
One that would need to be solved
If it's just spamming the same error to everyone all the time, no mod dev will ever read through it
I asked the rainworld modding community if anyone knows how guardian handled it. I can't find the source code for it
Worst case scenario I can just decompile it lol
question for you: are all pieces of the Dungeons network registered prefabs ?
None of the dungeon is networked
The game relies on every client generating the same seed the same way
it is not networked at the moment, but the question is if they are all real Prefabs or just Hidden objects
They're all real prefabs
Well, unless you use object pooling
Then they're real until they get pooled, at which point they're hidden
then it should be fairly easy for you to make it generate only on the host. and then have them call the NetoworkObject.Spawn()
It should be
But I still want vanilla compatibility
oh well yeah if that's the objective i fully support u
I've thought about host-only generation if everyone has loadstone as an optimization
But I don't think it'd save too much time really
Although it depends on the layout
Some layouts take much longer to calculate than spawn
actually you could probably force vanilla clients to not generate the dungeon if you never send the RoundManager.GenerateNewLevelClientRpc()
True
And they'd still listen to the host network spawns
yeah
It's something I want to try eventually
this will remove 100% the dungeon desyncs 😂
Some people were using it in public lobbies
at the cost of limiting the loading speed to the speed of the host
And I want to let people use it in public, so
if the host has the mod it will not send the Rpc to clients. but if client has the mod it will still receive the Rpc and therefore generate the dungen
Also, it'd break challenge moons without vanilla compat
uh? how?
The same seed is generating different layouts from vanilla
❓ .
the core issue with the desyncs is that, the same seed on vanilla is generating different maps than with Loadstone
on challenge moons in particular, that's a problem because the layout is going to be 100% wrong
oh yeah. i was half joking about the desyncs, that's something you definitely need to fix natively
m
i tough you were saying that having the host NetworkSpawn the dungen would somehow break challenge moons only
oh no
just saying that it wuldn't fix an already broken challenge moon seed generation
I'm gonna poke around and try to find the issue
just a fun tought, but if you make the dungeon generate only on the host. it will mean that only the host will feel the stutters 🤣 . poor host
yeah lol
ok I found the issue
it's DunGen optimizations
time to figure out why now :c
...
I had my branch condition flipped
I confirmed in game that that was the issue
you've lost a not somewhere in the copy-paste XD
i've seen a lot of times where the decompiled code just has a bunch of chained negations
i was checking in DnSpy if this would have been a good idea, and apparently there are few things that will break if this is not called :/
one has a really stupid workaround if it was ever needed tho 😂
RoundManager.mapPropsContainer is assigned in the GenerateNewLevelClientRpc... and in the SprayPaintRpc 🤦
lol
sadly the others are the various RNGs and the challenge modifiers
actually challenge modifiers only affect the host so we can ignore it 🤔
ight I've pushed v0.1.7 to nightly and main
should fix the dungeon desync issues from v0.1.5
one line of code to fix it smh
oh actually the randoms too are only used by host
but the navmesh AI node list and weather are required :/
yeahh
welp there goes vanilla compat for host only generation
also gg on the fix
thank
oh, so I've heard that apparently LCSoundTool is kinda inefficient for doing custom sounds. Is there a recommended alternative?
idk sorry, but if you're just going to add 1 waiting song, how about asking to Bongo, maybe you could do something with loaforcsSoundAPI
I'll check loaforcs and see rq
the enemy escape thing?
Yeah
I don't think so
🤔
it's mostly for vanilla/challenge mode compatibility
Well Enemy Escape throwing that error would basically be telling you entrances weren't getting generated properly
But I get what you mean lol
Might be a stupid question or asked a million times before but what is the difference between normal Loadstone and Nightly?
So it's like a beta build?
yup
Gotcha thanks
np
one u can use anytime, but the other u can only use at night
what is?
serverside = only the host needs it
the mod?
yes
the mod is 100% client side
the host can have it
or the client can have it
or both can have it
idk, but my friends did not feel any lag
but it only affects clients that have it installed
without them having the mod
it could be due to other players loading in faster, which reduces the stuttering on vanilla?
but yeah the optimizations are fully client side. All clients have to generate the level, update navmesh, etc etc
it's for that reason that desyncs have been reported in the past when I accidentally messed up the generation logic
Failed to generate the dungeon 20 times.
This could indicate a problem with the way the tiles are set up. Try to make sure most rooms have more than one doorway and that all doorways are easily accessible.
Here are a list of all reasons a tile placement had to be retried:
DunGen.DungeonGenerator/<InnerGenerate>d__94:MoveNext ()
DunGen.DungeonGenerator:Wait (System.Collections.IEnumerator)
DMD<MoveNext>?-123846324:_DunGen_DungeonGenerator+<GenerateMainPath>d__100::MoveNext (DunGen.DungeonGenerator/<GenerateMainPath>d__100)
...
[Info : LoadstoneNightly(Harmony)] Random seed: 20169335
Probably because of dev mode?
yes, that's because dev mode is active
in vanilla that error will never happen, and it'll just regenerate until it succeeds
or it'll spend forever regenerating, causing lag spikes until it finds a good seed
the only way that error happens is if a mod tells the game it's running in editor, or if you're actually running the game in the unity editor
yeah I currently has a mod that sets is unity editor flag to true
ah
to enable debug menu from the game
yeah that'd be the cause
Do you need the debug menu specifically?
or just a way to spawn things in and stuff
Imperium causing a lot of frame issues so using the game debug menu only 😦
ahh
I see
could you do me a favor actually?
gio's been trying to figure out why it's lagging for some people
could you run the BepInEx Mono profiler with imperium and send the CSV it generates?
and maybe run it again without imperium and send that too
my own profiling hasn't shown any kinds of issues, but my system isn't a great benchmark for performance issues like that particular one. It doesn't even blink at the performance impact of Imperium. Same framerate, profiler shows a performance difference within margin of error
also, in the meantime, you could give dancetools a try perhaps. I'm not sure how up to date it is, but it's the mod that inspired Imperium, and has a lot of the core features like enemy and item spawning
yeah sure
thanks
that or, if you know how to connect the game to the unity profiler, or run the game in the unity editor, you can save that profiler data as a .dat file and send that
thats not what serverside means
VM goes vroom with 1 core 1 thread allocated
true, although it's not completely accurate
also, 99% of the game is single threaded anyways 
Doesn't DX11 allow for multithreading?
some of the backend might be multithreaded
but the game itself is very single threaded
unity makes it really difficult to multithread unless you do it in a super specific way
so most devs don't do it
Rust port when 
like, I'd make the dungeon multithreaded
except a lot of time is spent making objects, not deciding how to spawn the dungeon, and spawning objects is single threaded unless I add in ECS, which is a pain in and of itself. And the existing algorithm doesn't port well to multithreaded if I want vanilla compatibility. And even if I did get around all of that, it'd be a compatibility nightmare with other mods
it'd take 2-3 months at least I'd estimate
and it'd break with a lot of mods
for minimal gain
Well, Intel is throwing hyperthreading to the curb so maybe Unity was just very future proof
eh, hyperthreading was questionable to begin with imo
many games perform better with it off because it lets each individual thread be a bit more powerful, and most games can't take advantage of having a ton of threads
Unity does have ways to do multithreading, but it's so highly specific to set up, and you kinda have to plan around it. It's a lot of effort to add as a mod, and even as a dev it's difficult to implement
Hyperthreading was created more for productivity per core rather than gaming in mind
yeah
back when you had like
2 or 4 cores on a CPU
it made sense
but anymore it's not helping much
But from benchmarks Intel has provided, they didn't boast that big of a boost compared to 14th gen so it's worrying
Don't get me wrong I do have a full AMD setup, but if Intel chucks it, AMD is gonna do what Intel did for 8 generations
I'm not a hardware designer, but I have to imagine that hyperthreading was complex to set up. I'd bet there's some neat optimizations they'll be able to do later down the line, and it'll keep costs and complexity down
Hopefully. Imagine ultimate gaming CPU with AMD's 3D-VCache and Intel's perfected single thread performance of generations to come
So, I sent the DunGen devs an email about some of the performance optimizations I'm using, and it looks like they're actually considering putting them in officially :3
also, can confirm that the way dungen currently handles object pooling makes it hard to adapt and keep compatibility lol
hence why it's a far out feature for the time being
but yeah, hopefully some of the current loadstone features will be able to be moved into dungen officially to make their way into other games and hopefully eventually become part of the LC base game
well, assuming zeekers updates dungen at some point. Hopefully he does
@crisp relic Would you possibly have any insight as to what causes interior and weather desync with certain LLL moons and if there's anything Loadstone can do to remedy that?
Most moons I have installed work fine, but there are a few Tolian moons that still have the interior desync where one or both of my two buddies will fall through the floor when entering the interior (or it will just say the door is blocked). We have figured out how to tell before even landing if the desync is going to happen because my two buddies will show a different weather than I (the host) shows on the screen for the planet we routed to.
I've tried changing the LLL config so only one interior can possibly spawn ont hese problematic moons and still get the desyncs. Any idea what it is about these moons that would cause that?
And I should clarify that this is not a Loadstone issue. These moons had this issue before we started using Loadstone and after. I'm just wondering if you had any insight on the issue and if there's anything I can change in how we have Loadstone set up that might help us get the same seed / interior synced.
usually the desync comes from a seed mismatch
that either means that there's some syncing that's not happening, or that certain rando mevents aren't happening in a consistent order
perhaps a forced seed resync could be done as part of the dungen RPC to guarantee that it generates with the same seed
I might be able to put that into Loadstone, but it'd only work if the host has Loadstone, and one or more clients also have it
Yeah we all use the same modpack code and I have them update the code every time I make any changes, so we all have the exact same installs.
I think it's an issue with one of the mods internally
it'd be pretty much impossible to tell where exactly it's coming from
That makes some sense. I don't know why the game doesn't already have the host pick the random seed/conditions and then just make the clients copy that. It seems silly to hope that all the conditions line up so that the clients all generate the same random thing.
it is a bit silly, but a lot of systems, both in and out of games, expect that the same thing will be generated with the same initial conditions
usually that's true, but if anything is left up to CPU timings, things can go out of whack quickly
ok so the map seed should always be identical from what I can tell
the game syncs the map seed when you pull the lever
the fact that it's not indicates that something is breaking between the map loading in fully and the lever being pulled
are there any errors in the logs?
I'll take a look
ok
in particular, I'd be looking for an error in InitializeRandomNumberGenerators
I think it's interesting that the weather is already desynced after routing before even pulling the lever. It's already out of wack from server host to client before generating anything. Could it also be possible that even with the same exact seed the interior chosen or how the interior generates could change from host to clients?
also, doorway blocked or falling through the floor means that the map generation entirely failed
I've seen the weather desync before even in almost entirely vanilla lobbies. The game clearly fails to set up the weather randomizer consistently between clients, but the way that everything gets synced in the end means it should be the same once you land
actually
I wonder
are you using MoreCompany or BiggerLobby?
Because I was having those issues on BiggerLobby, and I haven't used MoreCompany long enough to say if it's better with that or not
MoreCompany yes, but that was a more recent addition and we had these issues with certain Tolian moons long before installing that
But that could potentially be why the problem persists with certain moons I suppose.
ah
well at least that rules that out
so yeah I'm not fully sure what causes the desync you're experiencing
it's hard to debug properly, and could be caused by a whole host of different mods
Based on the amount of trial and error i've done moving and changing things with other mods, I'm confident it's something to do with the problematic moons themselves. It only ever seems to happen on Tolian moons, and has never worked at all on 2 in particular, Argent and Budapest. 100% of the time when we route to those we show different weathers on the screen (my two buddies will have the same), and then when we try to land either one or both of them can't make it in inside.
If you want to do some of your own testing I'd recommend trying those planets. I'm pretty confident those two wouldn't work even in the most barebones of modpacks.
Yes. Some of the other Tolian moons will occasionally work and occasionally have desync issues with weather and interior. But yes, those two always desync no matter what we've tried, and other planets work fine.
For reference, all the Wesley moons we have have always worked as well as the SFDesat moons and Solarius. So if we see the different weathers after routing, we just reroute to another one.
i use Weather Tweaks coz apparently that’s supposed to sync weather
don’t think i’ve experienced any weather desyncs ever since installing it
might be worth trying out
if it fixes it, I'd recommend trying to reduce the modpack mods and seeing if it still happens, and if so, report that to the dev
I've heard that recommendation but have been hesitant to give it a go because there's a lot of other stuff that mod does that im not a fan of. I'm also not sure that would help the primary issue which is the interior generation. But I'll give it a try just to see what it does
I think it'd be worth trying just for the debugging potential
Right
u could reconfigure weather tweaks
Yeah. Installing now and I'll see how vanilla I can keep it and if it fixes anything
ight
loadstone shiggy when
we have
and
but no loadstone shiggy.. absolute scam...

if you want to have a more "feature-less" version of the weather syncing, try using https://thunderstore.io/c/lethal-company/p/mrov/WeatherRegistry/ (and remove the defaults weather-weather weights)
but (to be completely honest) I know that the weight system is a deal-breaker to some people, which I can do nothing about 🥲
I actually don't mind the weights! It's nice to be able to tweak that myself and have that control. I just set most things to false in the config and have been very happy with it. No desyncs so far 🤞
that's great 😇
just wanna ask here and see if anyone's had any issues with Loadstone in the new beta branch. There's a chance that some of the new mechanics might break stuff, so just wann check
spoilers:
||The new Shroud Vains modify some parts of level generation a decent amount, so I want to make sure that those work properly and aren't bugged from Loadstone||
Loadstone seems to work ok in 55 for me
and the new features also work?
afaik I think it should work, but I wanna be sure it does actually work before the update goes public
afaik yes the || shroud vains || seemed to work ok
ok perfect
I'll keep an eye on it, glad to know it's not causing issues
||I'll also check LLL compat once that updates to support some of the shroud vain features, as it'll modify a function that Loadstone is currently modifying||
whats your concern?
||mostly transpiler related issues. I'm already modifying parts of the code that changed for mold vains, and I think LLL might end up changing it too? Although I'm not sure about that now that I think about it more. LLL would prob change other things, not that||
i just planned on prefix patching the loading and saving of them from a glancew
i don't think i need to do much else right
maybe chuck in a prefix somewhere to drop a warning if the custom moon doesn't have those things added
Honestly I’m just not a fan of transpiling for readability reasons so I try and avoid them as much as possible. The transpiler I use for dungen is necessary because the version of harmony we use offers no way to early return a prefix without preventing other prefixes on that function from running
so i don’t want other mods to run their prefixes of Dungen.Generate twice when it’s really once
