#Loadstone

1 messages · Page 2 of 1

crisp relic
#

Nightly has the newest, latest updates, but will likely be less stable

winter bolt
#

thank you!!! :D

crisp relic
#

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

median mantle
#

tbh if the nightly is for testing then whats the point of having experimental features off by default

west harbor
crisp relic
#

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

median mantle
#

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

crisp relic
#

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

livid kelp
#

I would say that

crisp relic
#

Once I push those features to main, I'll make object pooling be on by default

livid kelp
#

Async Dungeon only having compat issues with Enemy Escape in my pack is a pretty good thing

#

lol

crisp relic
#

Well, not fully sure
Have you tried disabling it to see if it works?

livid kelp
#

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

crisp relic
#

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

crisp relic
#

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

stone lava
#

bruh

#

so for every tile added it's re-checking everything else?

crisp relic
#

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

stone lava
#

modding saving the game

crisp relic
#

: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

crisp relic
#

Yup

#

Zeekers has used over $200 in paid assets for this game

hushed zephyr
crisp relic
#

No, it's just not finished yet

stone lava
#

i mean

#

he made fucking millions

#

investment returned

crisp relic
#

That's fair

hushed zephyr
stone lava
#

paid paid asset

crisp relic
hushed zephyr
crisp relic
crisp relic
hushed zephyr
#

Oh...

crisp relic
#

I need to finish battling with AWS atm lol

#

Their documentation is really confusing and unhelpful for connecting to RDS

hushed zephyr
#

The Shader Zeekers uses is also a asset?

crisp relic
#

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

stone hearth
#

pretty brave of zeekers to also completely rip the design of the main characters off a fortnite skin

#

dude's a menace

crisp relic
#

True

#

He also stole the cursor from It Steals

#

What a shame

stone hearth
#

he stole robots and fire exit from upturned

crisp relic
#

Yup yup

stone hearth
#

i swear no one makes original content these days

stone lava
stone lava
hushed zephyr
#

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

crisp relic
#

That sounds like the fog, which is built in HDRP I think

hushed zephyr
#

😢 cursed to have advantage over Foggy moons

#

The fog is the only thing built in HDRP?

crisp relic
#

No, nearly every shader in the game is a default HDRP shader

crisp relic
hushed zephyr
#

Is there any chance to Zeekers change the shaders until the game really releases?

crisp relic
hushed zephyr
#

Sad, is my GPUs fault anyway, gonna see what i can do about it

crisp relic
#

What GPU do you have?

hushed zephyr
#

NVIDIA MX130 i think

#

I'm laptop user agony

crisp relic
#

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

hushed zephyr
#

Well... i play LC at 30fps capped, taking more than that would make the game unplayable 😢

median mantle
#

might be time for an upgrade

crisp relic
#

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

hushed zephyr
#

Optimization 🤖

#

What else can be optimized

crisp relic
#

too much :c

stone lava
crisp relic
#

true

hushed zephyr
#

I use linux already beevil

#

Is the game that bloated? Imagine if a bunch of modders united to optimize the whole game

honest nacelle
#

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

crisp relic
#

could be yeah

silent totem
#

closest thing you’d get is an AIO optimization modpack

crisp relic
#

yeah
otherwise we'd need to somehow organize just about every single bug fix/optimization nerd into a singular project

livid kelp
crisp relic
#

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

livid kelp
#

Yeah I still dunno what causes that

halcyon sable
#

it's FixPluginTypesSerialization

livid kelp
#

Oof

crisp relic
#

that's causing lag when async dungeon is on?

livid kelp
#

No

#

That's what causes the debugging tools to not work

crisp relic
#

oh

halcyon sable
#

yeah

crisp relic
#

well I'll give it a try without that one and see if it works

livid kelp
#

@halcyon sable sounds like we need a replacement for that then

halcyon sable
#

You can disable it but CSync and LLL may will not work

livid kelp
#

I wonder if a fork of it could be made that fixes it breaking debug tools

halcyon sable
#

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

proper carbon
crisp relic
#

I have not

granite heath
#

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

crisp relic
#

which sort are you referring to specifically?

#

cuz I've found a handful of unoptimized sorts

granite heath
#

there's a couple probably, but the one that was heavily hurting my loading times was the bubble sort after grabbing all potential doorwaypairs

crisp relic
#

ah yeah

#

that one

granite heath
#

since my tiles were plenty, and they had a lot of doorways

crisp relic
#

that one's next on the chopping block for Loadstone

granite heath
#

i saw 2000 pairs once in my analysis

crisp relic
#

the doorway pairs section is just super unoptimized lol

granite heath
#

definitely lmao

crisp relic
granite heath
#

i transpilied a simple linq orderby and called it a day, major performance difference

crisp relic
#

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

granite heath
#

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

crisp relic
#

this is my current list of things to optimize:

  1. 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)
  1. DungeonGenerator.TryPlaceTile | 218 ms (13.2%) [1001 calls from AddTile]
  • IsCollidingWithAnyTile | 107 ms (7.0%)
  • TileProxy..ctor | 27 ms (1.7%)
  1. 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%)
  1. DungeonProxy.ConnectOverlappingDoorways | 139 ms (9.1%) [1 call]
  • DungeonFlow.CanDoorwaysConnect | 91 ms (6.0%) [9345 calls]
  • SelectManySingleSelectorIterator | 25 ms (1.6%)
west harbor
crisp relic
hushed zephyr
#

Touhou related

#

i think

granite heath
#

slightly touhou related yes

crisp relic
#

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

proper carbon
#

@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 😜

granite heath
crisp relic
#

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

proper carbon
#

I’d be very shocked if he ever did

crisp relic
#

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

halcyon sable
#

it was made for unity 6000 and backported to lts 2022

crisp relic
#

m

halcyon sable
crisp relic
#

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

halcyon sable
#

still takes a lot of time in main thread

proper carbon
#

you can instantiate them without awakening them 👀

#

right

#

even just to offload the work to another frame

#

or frame/s

crisp relic
#

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:

crisp relic
#

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

crisp relic
#

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

crisp relic
#

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

crisp relic
#

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

crisp relic
#

ok I found out the issue
the SyncedObject isn't being spawned in properly

silent totem
#

loading from orbit to experi in 668 ms??

crisp relic
#

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

silent totem
#

btw what does this mod do if u turn off async dungeon generation

crisp relic
crisp relic
#

:3

silent totem
#

but i was asking that since lunx is using it without async generation.. so i was wondering what it does outside of that

crisp relic
#

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

silent totem
#

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 😔

crisp relic
#

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

crisp relic
#

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

west harbor
#

Seems fine to me

crisp relic
#

151 ms to generate Titan

proper carbon
#

What are you doing with reparenting

crisp relic
#

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

proper carbon
#

why does it have to be in ddol

crisp relic
#

so it doesn't get destroyed when the ship takes off

proper carbon
#

could also be in ship scene, no? don’t think that helps tho

crisp relic
#

yeah I suppose it could be

proper carbon
#

should be able to reparent since it’s dynamic?

crisp relic
#

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

proper carbon
#

so just spawn a pooling parent?

crisp relic
#

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

proper carbon
#

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

crisp relic
#

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

proper carbon
#

it should be

#

oh also

#

You can have NGO’s move to active scenes

#

If that helps at all

crisp relic
#

m

proper carbon
#

actually no you will want then ddol

#

100%

#

To keep them out of default FindObjectsOfType checks

crisp relic
#

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

crisp relic
livid kelp
crisp relic
livid kelp
#

LLL helps with that too

#

Cus it prevents the unoptimized version of the Facility from spawning on it

#

XD

crisp relic
#

this is without LLL installed

livid kelp
#

That Titan uses by default for whatever reason

#

Oh I know

crisp relic
#

m

livid kelp
#

I was just saying :3

crisp relic
#

: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)

livid kelp
#

Noice

#

Will this also fix the issues we had with Enemy Escape?

crisp relic
#

I doubt it, I haven't looked into that issue yet

livid kelp
#

Fair enough lol

crisp relic
#

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
alpine berry
#

@crisp relic loadstone breaks imperium with cull factory

crisp relic
#

he says with the screenshot I sent him after we found the exact issue

alpine berry
crisp relic
silent totem
#

so u gonna fix it on ur end?

livid kelp
#

Object Pooling is set to be disabled by default for a reason

#

It currently has known issues

ivory token
#

that's weird, i'm testing the new nightly buiild rn and I have teleports to both of them

#

and on a custom moon

silent totem
#

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

tender shale
fluid turret
crisp relic
crisp relic
ivory token
#

I landed on cosmocos multiple times in a row and I always had entrance teleports

#

And yes I had object pooling enabled

#

And cullfactory

crisp relic
#

hm

#

interesting

#

is CullFactory even erroring for you?

ivory token
#

I never checked the logs

#

But I went into freecam

#

And it was working

crisp relic
#

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

ivory token
#

Oh Ic

#

Yeah I never disabled async

crisp relic
#

yeah try it without async

#

if async is on, the tiles themselves won't be getting pooled

ivory token
#

I'll try later if I can, since I'm not home

crisp relic
#

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

crisp relic
#

@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

crisp relic
granite heath
crisp relic
#

I'm setting the cache up in RoundManager Awake
It might be too early tho

granite heath
#

definitely too early, i am messing with my dungeonflow and archetype files right before i generate the dungeon

crisp relic
#

ah

#

which function do you do it all in?

granite heath
#

i can probably easily fix it by adding all my tiles to a tileset so you can cache them

#

then ill fix it later

crisp relic
#

m

granite heath
#

wait shit, one question. do you cache at every roundmanager awake

crisp relic
#

so rn my system uses Resources.GetObjectOfTypeAll to get all Dungeon flows, then scans the lines and nodes

crisp relic
granite heath
#

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

crisp relic
#

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

crisp relic
granite heath
#

okay so i just have to fix my assets after dungeon generation okay

crisp relic
#

lemme check and see how late I can do my caching

#

cuz I could do it much later

granite heath
#

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

crisp relic
#

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

granite heath
#

it would have to be after LLL calls its loadDungeon event function thingy

crisp relic
#

DungeonGenerator.OuterGenerate

#

is where I could put it safely I think

#

any later than that and I risk it running multiple times

granite heath
#

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

crisp relic
#

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

granite heath
#

yuh

#

i assume you released the update that broke my dungeon yes?

#

so i can test/add my fix to it tonight

crisp relic
#

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

granite heath
#

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?

crisp relic
#

in theory yes

granite heath
#

great

crisp relic
#

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

granite heath
#

mkay, ill just add multiple failsafes to make sure everything goes smoothly

crisp relic
#

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?

granite heath
#

missing mats? not entirely sure what you tryings to do

crisp relic
#

missing materials

#

pink everywhere

granite heath
#

ohh

crisp relic
#

oh wait

#

I might know why

granite heath
#

that's probably the navmesh surface stuff

#

i dont give them materials since they are culled out anyway

crisp relic
#

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

granite heath
#

it sounds probable, the doorwaycleanup script is a bit finicky

crisp relic
granite heath
#

not entirely sure how it would help me yet, but time shall see

crisp relic
#

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

granite heath
#

its good logic, you probably have to guide my hand if i ever need to make custom implementation for my dungeon to work

crisp relic
#

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

ivory token
#

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

livid kelp
#

Yeah it's recommended to not use it for now

#

It causes problems

#

Keep it false

ivory token
#

yeah just got bored and felt like testing lmao

livid kelp
#

Lmao

crisp relic
#

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

proper carbon
#

What requires an API

crisp relic
#

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

proper carbon
#

@crisp relic what happens with awake and start

#

and OnNetworkSpawn

crisp relic
#

currently, Awake and Start aren't being called

#

it's one of the many things I need to fix

proper carbon
#

how do you fix that

crisp relic
#

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

crisp relic
#

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

crisp relic
#

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
  • 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

median mantle
#

waiting music?

crisp relic
#

ye, if you have LCSoundTools installed, you can enable waiting music in Lethal Config

median mantle
#

oh

crisp relic
#

someone asked for it so I added it because it wasn't much effort lol

proper carbon
crisp relic
#

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

proper carbon
#

Bet

#

Just be careful of FindObjectsOfType since order might matter

crisp relic
#

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

proper carbon
#

mhmm

#

How expensive are getcomponent calls? Noticeable at all?

crisp relic
#

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

proper carbon
#

heard

#

Oh also vanilla terrain isn’t set to instanced right?

#

I think you could sneak that on in an OnEnable prefix

crisp relic
#

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

proper carbon
#

naurr like

#

Terrain as a component has a gpu instanced setting

crisp relic
#

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

proper carbon
#

Yeah

#

Most custom ones require it or it’s initialisation kills unity

crisp relic
#

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

proper carbon
#

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

silent totem
#

do u know how many times a second Lethal Company's FixedUpdate will update?

#

is it unity's default of 50?

junior terrace
#

as far as i can see Zeekers did not use FixedUpdates at all so it should be default

silent totem
#

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.

junior terrace
#

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

silent totem
#

🗒️✍️

spark coral
#

can i use this with modded moons n interiors?

#

and with 3-4 player lobbies

west harbor
spark coral
#

thanks

crisp relic
#

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

crisp relic
#

In fact
I don't think he calls FixedUpdate at all
Imma check rq

halcyon sable
#

iirc blob using fixedupdate for animating

crisp relic
#

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

silent totem
#

thanks a lot for all this info 🙇‍♂️

crisp relic
#

np

silent totem
#

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?

crisp relic
#

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

silent totem
#

alright sick 👌

proper carbon
#

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

crisp relic
#

lemme check my profiling rq and see

proper carbon
#

this is called by half a dozen things and could be cached quite easily

#

in RoundManager

crisp relic
#

so there's not too too many of them being called on the dungeon generation frame

proper carbon
#

oh yeah most of these aren't level loading specific

crisp relic
#

but there's a lot of them about half a second later when round manager spawns all the map objects and such

proper carbon
#

StartOfRound.RefreshPlayerVoicePlaybackObjects() also has a nasty FindObjectsOfType call and GetComponentInChildren call considering how many things use it

crisp relic
proper carbon
#

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

crisp relic
#

yeah lol

proper carbon
#

which is fine easy thing to miss

#

but would solve a lot of this

crisp relic
#

yeah

proper carbon
#

oh wow

#

if you want a fun rabbit hole to dive into (again more general than level loading)

#

look at the uses of GetComponentInChildren

crisp relic
#

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

proper carbon
#

oh damn really?

crisp relic
#

yeah

proper carbon
#

whats the tag calls like?

crisp relic
#

tag searches are super efficient it seems

proper carbon
#

yee

#

pain in the ass

#

its super baked iirc

#

like on c++ end

crisp relic
#

oof

proper carbon
#

you can't add new tags at runtime

crisp relic
#

explains why its so efficient though

proper carbon
#

which makes new footstep surfaces really annoying

crisp relic
#

oooof

crisp relic
proper carbon
#

are you just profiling editor playmode or did you get a build working

crisp relic
#

I wasn't able to get the build working unfortunately

#

this is with mods in the editor

proper carbon
#

bet

crisp relic
#

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

proper carbon
#

heard

#

I know getcomponent calls are relatively trivial in comparison to other stuff your targetting but i forgot how rough quicksand trigger was

crisp relic
#

yeah GetComponent is super cheap as well. On the order of a tenth of a millisecond

proper carbon
#

mhmm

#

btw have you considered hitting up the dungen dev about some of this?

crisp relic
#

I have

#

I sent them an email a few days ago

proper carbon
#

ah nice

crisp relic
#

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

proper carbon
#

wait why does the shovel hit contain a findobjectoftype roundmanager call

proper carbon
#

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

crisp relic
#

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

proper carbon
#

forsure

#

i wonder if they even know such a big game uses it yet

crisp relic
#

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

proper carbon
#

whats the big offenders in there?

crisp relic
#

the game spends over 18x longer just updating animators lol

proper carbon
#

yeah animators are rough

crisp relic
#

takes smth like 0.07 milliseconds

proper carbon
#

in the offical unity ebook for optimisation it does strongly suggest caching the animation hashes instead of constantly using the strings

crisp relic
crisp relic
#

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)

proper carbon
#

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?

crisp relic
#

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

proper carbon
#

damn ok

crisp relic
#

setting the animator values doesn't take too long either

proper carbon
#

I wonder if theres a reason the player's animator isn't set to culling at all

crisp relic
#

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

proper carbon
#

100 raycasts should be fine?

crisp relic
#

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

proper carbon
#

yippeee

#

also your results are slightly fucked cuz of the lack of info on the post processing

crisp relic
#

yeah

#

I think I have some runs from in game tho

#

I don't remember which profiler saves of mine are from in game

proper carbon
#

i forgot that some maps have really bad mesh colliders. curious if the cooking of that is noticable

crisp relic
#

lemme redo it :3

proper carbon
#

dunno if it bakes in any regard cuz its a scene tho

crisp relic
#

vow?

proper carbon
#

ye

crisp relic
#

I'll hop into vow and see how the performance is

proper carbon
#

its the out of bounds one

crisp relic
#

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

proper carbon
#

😔

crisp relic
#

launching the game with debugging rn

#

well that's a new one

proper carbon
#

yeee

crisp relic
#

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

crisp relic
crisp relic
west harbor
#

reading all of this every day is so interesting and idk why

crisp relic
#

too many known issues

crisp relic
crisp relic
#

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

proper carbon
#

?

crisp relic
#

the laggiest enemy in the game

#

according to the profiler

#

is manticoils

#

but

#

that can't be right

#

because that's standard search

proper carbon
#

i could see that

crisp relic
#

and every enemy uses it

#

so what's special about them?

proper carbon
#

dont they like cluster up

crisp relic
#

why do only they show in the profiler

proper carbon
#

into groups

crisp relic
#

I only have one spawned

proper carbon
#

they also like do some flying stuff too right

crisp relic
#

ye

proper carbon
#

i wonder if their navmeshagent settings are different

crisp relic
#

maybe

proper carbon
#

like their searches might be more involved

crisp relic
#

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

crisp relic
#

that can be ignored lol

halcyon sable
#

set that flag lol

#

to see what main game scripts and what mod

crisp relic
#

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

silent totem
#

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 agony

crisp relic
#

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

junior rock
#

520p gaming

crisp relic
#

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

livid kelp
#

I remember someone else saying MantiCoils were the laggiest too, I think Toilhead makes them worse cus of the Manti-Toils and Manti-Slayers

crisp relic
#

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

livid kelp
crisp relic
#

the flocking behaviour means it's only running at most for one or two of them at a time

livid kelp
#

Lol

crisp relic
livid kelp
#

Yes

#

XD

crisp relic
#

normally I configure the HD company mod for 1.5x

livid kelp
#

I have LCUltrawide set to run it at 1080p

#

I don't recommend HDLC

crisp relic
#

ah

#

yeah I use HDLC normally

#

is LCUltrawide better for performance or just more stable?

junior rock
#

both

crisp relic
#

nice

proper carbon
#

@crisp relic it might just be the fact it's looking at nonwalkable layer + it's small radius?

crisp relic
#

maybe

#

oh wait yeah small radius could easily be it

proper carbon
#

yeah has wayyyy more viable places it can go

crisp relic
#

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

crisp relic
proper carbon
#

which function again?

crisp relic
#

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

proper carbon
#

IsPathIntersectedByLineOfSight() calls agent.CalculatePath() which would use the navmeshagent layer settings

median mantle
hushed zephyr
hushed zephyr
proper carbon
#

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

hushed zephyr
#

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

proper carbon
#

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

hushed zephyr
#

Imagine if loadstone expanded from just loading times to optimizing a lot of the game lol

hushed zephyr
#

Or some call that goes straight into the object that's searching

proper carbon
#

it searches every object

hushed zephyr
#

💀

stone lava
#

and this runs on Update? 😳

proper carbon
#

naurr

#

but theres a lot of cases where its used

stone lava
#

well, it's the simplest way of getting those references without keeping them yourself

#

🥺

crisp relic
crisp relic
crisp relic
#

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

crisp relic
#

:3

azure dagger
#

Am I right in assuming that the latest Loadstone build causes desync issues?

crisp relic
#

it could be

#

what mods are you using and is everyone using loadstone?

azure dagger
#

Nope. I'm using Loadstone in pub lobbies

crisp relic
#

m

azure dagger
#

019036b5-72d1-9e27-73a3-19b11a67300d

#

this is the profile

crisp relic
#

try disabling dungen optimizations

azure dagger
#

It was fine up until the latest update

crisp relic
#

it shouldn't cause issues in theory

#

but it's new

wheat nova
#

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.

crisp relic
#

were you using modded interiors?

wheat nova
#

yes, but it was happening in the vanilla mansion and facility as well

crisp relic
#

interesting

#

that's an issue I haven't seen since before loadstone released

azure dagger
#

For me it was primarily Facility that was being desynced. No issues in Mansion

wheat nova
#

this is from yesterday, right is my (host) dungeon, left is what the client (res) saw

crisp relic
#

hm

wheat nova
#

we've not been having the same issue today with 0.0.9

#

also this

crisp relic
#

I'd recommend downgrading to 0.0.9 for now until the issue is resolved

crisp relic
# wheat nova also this

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

azure dagger
wheat nova
#

if it helps, i used the default settings for latest loadstone except async dungeon was disabled

crisp relic
#

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

azure dagger
#

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

crisp relic
crisp relic
#

I'm gonna design a test suite so I can verify vanilla compatibility for future releases

crisp relic
#

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

proper carbon
#

He responds in patreon channel sometimes but usually he’s very hesitant to respond in general

#

I agree tho

crisp relic
#

I also mean for mod devs

#

But yeah the game as a whole could benefit from in-game bug reporting

proper carbon
#

github and discord threads are best your realistically gonna get

crisp relic
#

Yeah
But
So many people would rather just uninstall the mod without saying anything

proper carbon
#

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

primal carbon
#

Is this mod bugged?

crisp relic
#

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

primal carbon
#

Yesterday I saw ppl walking through walls

#

And closed this mod and it stopped

proper carbon
#

how do you define an issue

crisp relic
primal carbon
#

Yeah I was so confused yesterday

proper carbon
#

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

crisp relic
#

Correct

#

It'd be something though

#

I dunno

#

I need to figure out how guardian handled that

proper carbon
#

yeee sorry not trying to dismiss it outright

crisp relic
#

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

junior terrace
#

question for you: are all pieces of the Dungeons network registered prefabs ?

crisp relic
#

None of the dungeon is networked

#

The game relies on every client generating the same seed the same way

junior terrace
#

it is not networked at the moment, but the question is if they are all real Prefabs or just Hidden objects

crisp relic
#

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

junior terrace
#

then it should be fairly easy for you to make it generate only on the host. and then have them call the NetoworkObject.Spawn()

crisp relic
#

It should be
But I still want vanilla compatibility

junior terrace
#

oh well yeah if that's the objective i fully support u

crisp relic
#

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

junior terrace
#

actually you could probably force vanilla clients to not generate the dungeon if you never send the RoundManager.GenerateNewLevelClientRpc()

crisp relic
#

True
And they'd still listen to the host network spawns

junior terrace
#

yeah

crisp relic
#

It's something I want to try eventually

junior terrace
#

this will remove 100% the dungeon desyncs 😂

crisp relic
junior terrace
#

at the cost of limiting the loading speed to the speed of the host

crisp relic
#

And I want to let people use it in public, so

junior terrace
#

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

crisp relic
#

Also, it'd break challenge moons without vanilla compat

junior terrace
#

uh? how?

crisp relic
#

The same seed is generating different layouts from vanilla

junior terrace
#

❓ .

crisp relic
#

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

junior terrace
#

oh yeah. i was half joking about the desyncs, that's something you definitely need to fix natively

crisp relic
#

m

junior terrace
#

i tough you were saying that having the host NetworkSpawn the dungen would somehow break challenge moons only

crisp relic
#

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

junior terrace
#

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

crisp relic
#

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

junior terrace
#

you've lost a not somewhere in the copy-paste XD

crisp relic
#

ig so

#

but yeah now it's identical to the vanilla dungeon

junior terrace
#

i've seen a lot of times where the decompiled code just has a bunch of chained negations

crisp relic
#

m

#

yeah this was my own code I wrote lol

#

I just forgor the right way to do it

junior terrace
#

one has a really stupid workaround if it was ever needed tho 😂
RoundManager.mapPropsContainer is assigned in the GenerateNewLevelClientRpc... and in the SprayPaintRpc 🤦

crisp relic
#

lol

junior terrace
#

sadly the others are the various RNGs and the challenge modifiers

#

actually challenge modifiers only affect the host so we can ignore it 🤔

crisp relic
#

ight I've pushed v0.1.7 to nightly and main
should fix the dungeon desync issues from v0.1.5

crisp relic
junior terrace
#

oh actually the randoms too are only used by host

#

but the navmesh AI node list and weather are required :/

crisp relic
#

yeahh

junior terrace
#

welp there goes vanilla compat for host only generation

crisp relic
#

thank

#

oh, so I've heard that apparently LCSoundTool is kinda inefficient for doing custom sounds. Is there a recommended alternative?

hushed zephyr
#

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

crisp relic
#

I'll check loaforcs and see rq

livid kelp
#

@crisp relic Will this fix the issues we had when using Async Dungeon before?

#

;o

crisp relic
#

the enemy escape thing?

livid kelp
#

Yeah

crisp relic
#

I don't think so

livid kelp
#

🤔

crisp relic
#

it's mostly for vanilla/challenge mode compatibility

livid kelp
#

Well Enemy Escape throwing that error would basically be telling you entrances weren't getting generated properly

#

But I get what you mean lol

quasi nest
#

Might be a stupid question or asked a million times before but what is the difference between normal Loadstone and Nightly?

crisp relic
#

Nightly is less stable

#

but newer

quasi nest
#

So it's like a beta build?

crisp relic
#

yup

quasi nest
#

Gotcha thanks

crisp relic
#

np

silent totem
#

one u can use anytime, but the other u can only use at night

stuck marsh
#

tested it and its serverside @crisp relic

#

only the host needs it

crisp relic
#

what is?

stuck marsh
#

serverside = only the host needs it

crisp relic
#

the mod?

stuck marsh
#

yes

crisp relic
#

the mod is 100% client side

#

the host can have it

#

or the client can have it

#

or both can have it

stuck marsh
#

idk, but my friends did not feel any lag

crisp relic
#

but it only affects clients that have it installed

stuck marsh
#

without them having the mod

crisp relic
#

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

halcyon sable
#
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?

crisp relic
#

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

halcyon sable
#

yeah I currently has a mod that sets is unity editor flag to true

crisp relic
#

ah

halcyon sable
#

to enable debug menu from the game

crisp relic
#

yeah that'd be the cause

#

Do you need the debug menu specifically?

#

or just a way to spawn things in and stuff

halcyon sable
#

Imperium causing a lot of frame issues so using the game debug menu only 😦

crisp relic
#

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

halcyon sable
#

yeah sure

crisp relic
#

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

proper carbon
azure dagger
crisp relic
#

true, although it's not completely accurate

crisp relic
#

also, 99% of the game is single threaded anyways Sadge

azure dagger
crisp relic
#

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

azure dagger
#

Damn

#

Time for a port to javascript

crisp relic
#

Rust port when AdiShiggy

#

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

azure dagger
#

Well, Intel is throwing hyperthreading to the curb so maybe Unity was just very future proof

crisp relic
#

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

azure dagger
crisp relic
#

yeah

#

back when you had like
2 or 4 cores on a CPU
it made sense

#

but anymore it's not helping much

azure dagger
#

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

crisp relic
#

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

azure dagger
crisp relic
#

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

crisp relic
#

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

quasi nest
#

@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.

crisp relic
#

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

quasi nest
#

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.

crisp relic
#

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

quasi nest
crisp relic
#

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?

quasi nest
#

I'll take a look

crisp relic
#

ok
in particular, I'd be looking for an error in InitializeRandomNumberGenerators

quasi nest
#

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?

crisp relic
#

also, doorway blocked or falling through the floor means that the map generation entirely failed

crisp relic
#

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

quasi nest
#

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.

crisp relic
#

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

quasi nest
#

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.

crisp relic
#

wait
so only those two moons have incorrect weather?

#

the rest are fine?

quasi nest
#

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.

crisp relic
#

weird
I've seen every moon have desynced weather

#

but never specific moons

silent totem
#

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

crisp relic
#

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

quasi nest
#

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

crisp relic
#

I think it'd be worth trying just for the debugging potential

quasi nest
#

Right

silent totem
#

u could reconfigure weather tweaks

quasi nest
#

Yeah. Installing now and I'll see how vanilla I can keep it and if it fixes anything

crisp relic
#

ight

fluid turret
#

loadstone shiggy when

dense lance
fluid turret
crisp relic
stone lava
#

but (to be completely honest) I know that the weight system is a deal-breaker to some people, which I can do nothing about 🥲

quasi nest
stone lava
#

that's great 😇

crisp relic
#

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||

feral dawn
#

Loadstone seems to work ok in 55 for me

crisp relic
#

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

feral dawn
#

afaik yes the || shroud vains || seemed to work ok

crisp relic
#

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||

crisp relic
# proper carbon 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||

proper carbon
#

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

crisp relic
#

That's fair
I do a bunch of transpilers just to avoid copying code from DunGen or LC, since a lot of my code comes down to modifying pieces of functions rather than adding onto them

#

I could copy and modify the code, but it's such tiny changes to relatively large functions