#Pathfinding Lag Fix | Pathfinding Lib | Smart Enemy Pathfinding

1 messages Β· Page 2 of 1

crimson jolt
#

for legal reasons i am obligated to state this is a joke

keen ruin
#

oh

crimson jolt
#

just very low hanging friut

keen ruin
#

someday that will be real

ashen harbor
#

It doesn't happen without v2 no

keen ruin
#

it definitely does

ashen harbor
#

But it seems like you guys have figured out a lot while I was afk

keen ruin
#

the ShootGun part

ashen harbor
#

Oh really?

#

I wonder why it only logged with v2 odd

keen ruin
#

it's because of BetterShotgun

ashen harbor
#

XD

#

I see

keen ruin
#

did you check your logs before that? you don't have the console enabled

ashen harbor
#

So @candid nimbus needs to release a patch it seems

keen ruin
#

erm

#

only a very minor one

#

I was gonna let Xu let them know what they need

ashen harbor
#

I wonder if it's one of those things that used to not log for me as host but logged for clients

#

Since some errors do that

keen ruin
#

the most important question I have is how sure you are that this softlock is a regression in PathfindingLagFix

#

because I haven't been able to reproduce it and so I have no idea what is causing it

ashen harbor
#

Pretty certain, It seems to be exclusive to multiplayer

keen ruin
#

the only thing I can think is that the Unity jobs system is screwing with object lifetimes and making RPCs run after the network disconnects

green gust
#

everyone runs ShootGun afaik so it would show on everyone's end

ashen harbor
#

@oak timber Do you still have your log from today?

#

Or maybe @kind elk might, he played with

ashen harbor
keen ruin
#

the array isn't populated unless it is owned

ashen harbor
#

I'm wondering if clients got an error when I tried to close the lobbies out

keen ruin
#

hmm

#

I wouldn't think that would have any bearing on whether you close the lobby as host but maybe someone else could confirm that

green gust
ashen harbor
#

Cus I didn't see anything besides Dissonance being the first error

keen ruin
#

dissonance wasn't the first error doe

#

at least not in some cases

#

everything points to RPCs being sent while the network is disconnected

#

it's almost like the disconnect event is firing twice

#

no clue why

#

but I really find it hard to believe this is PathfindingLagFix's fault

ashen harbor
#

It could be a run order thing

keen ruin
#

if it isn't getting completely frozen I don't know what would cause this

#

I don't screw with lifetimes intentionally

ashen harbor
#

since I don't repro it with stable I just dunno what

keen ruin
#

I don't even have any hard refs to enemies to keep their managed objects alive

ashen harbor
#

Maybe I could send you my pack and a profile might reveal it?

keen ruin
#

I've tried several times to repro with your pack

#

even with the one from today

ashen harbor
#

Yeah that is also what makes it so strange

#

πŸ€” I wanna know what is misbehaving

#

lol

keen ruin
#

you're sure nothing else updated that might be relevant here?

#

also idk if you said, but did you ever downgrade PathfindingLagFix since this started happening to confirm that it definitely doesn't happen unless v2 is present?

#

would be good to see in a long session with several attempts

green gust
#

postfix's run even if a function returns early right @keen ruin

keen ruin
#

for harmony yes, I believe so

#

when MonoMod is involved, no clue

green gust
#

cuz ii've never seen the error before, but you're right that it returns early

keen ruin
#

I can never remember which detour is first

ashen harbor
#

We swapped to V1 yesterday after we couldn't land on Black Mesa and played out the rest of the session and I could close it out just fine

keen ruin
#

well if you're host you own the shotguns to start

#

and nutcrackers never change ownership either

ashen harbor
#

Just the 1 time

#

but I tried to close it out twice with v2 and couldn't

green gust
keen ruin
#

if I'm not getting repro on your pack even in LAN I suspect that that isn't enough

green gust
#

ig ill add a null check

ashen harbor
#

once when we ran into the bug with DemonMae's Interior, 2nd time when Black Mesa soft locked

#

I do suspect if V2 can't be responsible inherently

#

it's some sort of run order thing

#

something trying to sent a network rpc to a client and dying

#

just dunno why

keen ruin
#

idk what run order would be relevant here

ashen harbor
#

I don't either

#

I wish when it gives that network error it would be more descriptive

#

other than just saying a rpc failed

keen ruin
#

in the logs you sent I don't even see anything from PathfindingLagFix at all, and only an error could really cause this

#

none of my patches even do anything with anything other than enemies

ashen harbor
#

Well the most recent addition that might be responsible could be Piggy's Variety Mod and I already mentioned I'm gonna test removing that for tomorrow

#

since I've also been getting stuck on "You are fired" as well if we end a run

keen ruin
#

ah yeah I should try doing that

#

just for giggles

#

also is it a known issue that the stream overlay mod softlocks clients (in lan only perhaps)?

#

I guess the issue is probably it binding the same local port twice without checking or something

ashen harbor
#

It is

#

@vagrant gazelle weren't you gonna fix this btw?

#

lol

ashen harbor
#

XD

#

I remember you said you were gonna fix it a while ago

vagrant gazelle
#

I don't know how to

#

I already tried to fix it in the past

ashen harbor
#

Well you got some mod devs here that may be able to help you

#

Zaggy and Xu might know a bit more

#

:3

keen ruin
#

I mean is it checking that it was able to bind the socket before trying to use it everywhere? my first thought is, just shut it down if it can't bind it

keen ruin
#

that's assuming Start() is synchronously binding the port, but idk really

#

another option is to check _webSocketServer.IsListening before broadcasting I suppose, since the error I'm seeing is:

Failed to assign new player with client id #4: System.InvalidOperationException: The current state of the manager is not Start.
#

(Lunx I will allow Zehs to reply whenever they have time lol)

ashen harbor
#

Ye I think they went afk, they were active in a stream I'm watching and they poofed from there too so hopefully they see it later lol

keen ruin
#

it's not a huge deal, it's just one more thing to adjust when I need to do stuff in your pack

ashen harbor
#

Ye

keen ruin
#

good lordy what is this scp999 thing doing to my fps

ashen harbor
#

;c

keen ruin
#

it would appear so

ashen harbor
#

Well @gentle charm Would be the dev of SCP 999, hopefully it's something that is easy to fix

keen ruin
#

might be the TargetClosestEnemy method, not sure

#

I would assume while I'm outside the enemy would be roaming

ashen harbor
#

It's possible yeah

keen ruin
#

I'm beginning to be convinced that Unity made it too easy to test paths

#

one very easy optimization though:

- if (!PathIsIntersectedByLineOfSight(enemy.transform.position, calculatePathDistance: false, avoidLineOfSight: false) && (!requireLineOfSight || CheckLineOfSightForPosition(enemy.transform.position, viewWidth, 40)))
+ if ((!requireLineOfSight || CheckLineOfSightForPosition(enemy.transform.position, viewWidth, 40)) && !PathIsIntersectedByLineOfSight(enemy.transform.position, calculatePathDistance: false, avoidLineOfSight: false))
#

although I guess it's probably not using the LOS check

#

no wait it is

#

also

- if ((TargetClosestPlayer(1.5f, true) && followPlayer) || (TargetClosestEnemy(1.5f, true) && followEnemy))
+ if ((followPlayer && TargetClosestPlayer(1.5f, true)) || (followEnemy && TargetClosestEnemy(1.5f, true)))

please check the easy stuff first

#

this async API is looking all the more important, but I might be too lazy to make it usable enough for everyone to adopt it without a lot of coaching

#

I'd probably have to set up a bunch of helpers and I'm not sure what that would look like to do it in a generalized way

ashen harbor
#

Yeah at least these changes should be useful for the SCP 999 mod, since it has a github you might be able to push a pr too

keen ruin
#

that requires me to set up a local copy πŸ˜… if I were to go to that effort I would much rather just go the full way and make it async

ashen harbor
#

True

#

lol

green gust
#

zaggy while you're at it stop everything you're doing and take hours out of ur time to just do my job for me in all of coderebirth

keen ruin
#

I already did

green gust
#

oh tanks

keen ruin
#

damn xu already forgor

ashen harbor
green gust
#

my memory is crazy sometimes

ashen harbor
#

I appreciate your jokes though Xu ty

green gust
#

im serious, no jokes, get to work zaggy

keen ruin
#

buh

ashen harbor
#

In all seriousness I sometimes forget how long it takes for pr's to be setup cus I've seen some devs push pr's crazy fast in the past lol

green gust
#

also off the top of ur head, does the playerSteamId field get filled in with anything if you're on lan?

keen ruin
#

if the project is set up nicely it doesn't really take too long

ashen harbor
#

Ye

keen ruin
#

at least to do the PR, testing is the time consuming part

ashen harbor
green gust
#

yeah but i doubt theres any relevance there to that

keen ruin
#

it doesn't connect the Steam API when you do LAN so it can't get a valid ID

#

all it can do is come up with a bogus one if anything

ashen harbor
#

Yeah Lan is all offline stuff

green gust
#

yeah i wondered whether it's a bogus number, or null since its ulong or 0

#

yes lunxara im aware

ashen harbor
#

I probably didn't need to tack it on tbh peepoGiggles

keen ruin
#

when you had the softlock after being fired, was it just stuck on the fired screen and otherwise running normally?

kind elk
#

I dont got logs, played with glitch, so logs reset

keen ruin
#

exit to menu worked for me but I did get stuck on the fire screen

ashen harbor
keen ruin
#

did the softlock only happen to the host?

kind elk
ashen harbor
#

Fair

#

lol

keen ruin
#

fair

#

well

#

I tried as much as I could

ashen harbor
#

I remember a client saying their game crashed when they tried to leave after it soft locked if that means anything

#

lol

keen ruin
#

I would love to know if you can go a 3 or more reloads without getting softlocked in normal play with stable PathfindingLagFix

keen ruin
#

probably not likely to be the NavMeshQuery crash but can't hurt for me to check the stack trace

kind elk
#

I mean i crashed upon trying to load in lunxaras lobby but i didnt think much of it

#

Just thought her beefy modpack killed my pc

keen ruin
#

hmm

#

then you should give me a dump too

#

I am very suspicious of any crashes

kind elk
#

Another time

#

If i rember

keen ruin
#

🫑

vagrant gazelle
ashen harbor
vagrant gazelle
candid nimbus
#

I saw that I got pinged. Do I have to solve some problem or is everything ok? I tried to read the chat but I didn't understand anything

ashen harbor
#

This one I believe

#

the Shootgun Error

candid nimbus
# ashen harbor

I am not the person who coded the bettershotgun, however I think the problem occurs because the bettershotgun replaces the original shotgun code? That's the only thing that comes to mind since it's the first time I've seen this kind of error

ashen harbor
#

Yeah I think @green gust is supposed to inform you of what needs changed from what I understood

candid nimbus
#

so I did some testing in the meantime and it seems to only happen when CodeRebirth is installed?

tardy pivot
#

πŸ€” @ashen harbor either you swapped the sqlite file or you never downgraded PathfindingLagFix πŸ€”

#

from the logs issue only happend in the execution nrΒ° 12. and only once

green gust
candid nimbus
#

basically i'm saying that i don't know how the mod works either

green gust
#

okay glad to know we both dont, the second issue should be simple since it's just a field in the shotgun code, i assume it'd be easy to just populate that with the hits that are made by that mod

#

for the first one then um we ball

#

oh actually this is probably for the first issue

#

nvm holder isnt even used lol

#

you could probably just get rid of that line DogeKEK

#

it might error if the shotgun is fired without a player holding it?

candid nimbus
#

since it is not used I don't think it gives an error. I remove it anyway to be safe

#

wait

#

enemyColliders is private? because in that case I don't know how to access it.

#

The more I code for this game the more ignorant I feel (even after 1 year of doing it)

#

I mean, the only thing I can think of is using Reflection to access enemyColliders but other than that I have no idea

green gust
#

That's usually the best way to access private or internal fields

#

In your csproj file

candid nimbus
#

so, i tried it and now it seems to work (no more errors)

keen ruin
#

hmm I think it's a bit silly to waste time on filling the array if you're doing things the right way and calling IHittable.Hit unconditionally

#

the only reason that Xu has to use that array is because zeekerss doesn't use IHittable properly there yet

candid nimbus
#

maybe it's a waste of time but I still prefer to fill it "correctly".

tardy pivot
#

i mean the "correct" way would be to do it like vanilla does and use RacastNonAlloc passing the original array πŸ˜…

keen ruin
#

just as long as you're not making it allocate every time I guess

tardy pivot
#

i guess the appeal of RaycastAll is that it will return all hits no matter how many there are

candid nimbus
oak timber
keen ruin
keen ruin
keen ruin
kind elk
#

finding it

#

@keen ruin no crashes, aint got no logs for any crash

#

so all is good i guess

keen ruin
#

oh weird

#

you said it crashed though right?

kind elk
#

i didnt get any errors or unity popup my game just closed on join

#

couldve accidentally close my console

keen ruin
#

anyway yeah without a log or dump I gotta assume it was something else

#

ah

#

we shall never know

kind elk
#

probably was nothing

#

Foreshadowing is a narrative device in which a storyteller gives an advance hint of what is to come later in the story.

keen ruin
#

I don't like the sound of that kind of foreshadowing

keen ruin
#

out of curiosity, has anyone else been using Beta v2.0.3 and encountered issues with closing lobbies?

ashen harbor
#

So old SQLite got deleted

ashen harbor
#

@keen ruin just wanted to let you know I've been able to close out lobbies just fine today after pulling Piggy's Variety Mod and updating HexiBetterShotgunFixed

#

So I would guess it was cus of Piggy's

keen ruin
#

ah that's good to hear, how many times have you closed out thus far?

#

I tested your profile code from yesterday's stream with Matty and wasn't able to reproduce there, so I'm wondering if it could just be very intermittent, but it's also very plausible that it could just be something breaking in some update

keen ruin
#

Just pushed a new version 2.0.4 which

  • Removes the crash warning from the readme, since things have seemed stable since my fix
  • Adds a patch to reduce the impact of pathfinding used to check if an enemy can target each player in the lobby, which would manifest as a small stutter in large lobbies and is used by a lot of enemies in the game:
#

@green gust I shall prioritize making an API for you to use to make Jimothy stable next, fear not

green gust
#

Yipp

keen ruin
#

to start with I can probably just give you the synchronization methods that I use in PathfindingLagFix, should be very easy to plug in then

#

not sure if it's better to do that or just yoink the job code out of CodeRebirth for the API Hmm

#

is that code on your GitHub and up to date?

green gust
#

Yes

#

Github currently fully committed

keen ruin
lyric hedge
#

Does this mod work with Lockers?

keen ruin
#

probably?

#

that's an oddly specific question that I don't necessarily know the answer to, but I don't know of any mods that would have issues with it

ashen harbor
#

so I brought that to her attention

#

c;

lyric hedge
keen ruin
#

oh

#

no clue

#

I've never played with locker tbh

#

I doubt it has any stutters that even the beta would solve entirely, unless it's doing something very bad

#

but whether there are stutters is up to your testing

lyric hedge
#

I didn’t notice anything. Then again, my game slows down a bit when lots of monsters are spawned, so it’s hard to know whether it’s somewhat caused by the Locker.

keen ruin
#

yeah

#

if you didn't have the beta when said slowing happened, then hopefully it will be able to help with that

#

that's exactly what the beta is supposed to improve, though it is incomplete at the moment

lyric hedge
#

Any crashes that I should know of? Like, does this mod work with vanilla Lethal Company?

keen ruin
#

I only really test against vanilla

#

I haven't had crashes reported since the fix in 2.0.3

#

Pathfinding Lag Fix v2 (BETA)

green gust
#

guys, make fun of this guy for using the wrong icon

ashen harbor
#

@keen ruin I'm guessing I should add PathfindingLib once it becomes available? πŸ‘€

green gust
#

lib will be a dependency of coderebirth next update

#

and probably pathfinding lag fix v2 since he moved the stuff there i assume(?)

ashen harbor
#

Yeah I figured it was something I should add the second it becomes available

green gust
#

doesnt do anything by itself

ashen harbor
#

I see it being a dependency for a lot of things

keen ruin
#

yeah it'll be a dependency of PathfindingLagFix Beta soon enough

#

and then PathfindingLagFix proper after that

#

it's only there for Xu to use it until anyone else decides to dip their toes into this

#

but it takes a little bit of what could potentially be considered boilerplate to be usable for an enemy, so we'll see how many others use it initially

#

first one that comes to mind is Lethal Intelligence, but I kind of want to make an even higher level API within PathfindingLib before I suggest anything like that

#

I would prefer that PathfindingLib takes over all the fire exit pathfinding logic that Virus has been working on there, but we'll see

#

(coincidentally that is also what I suggested Xu use it for)

green gust
#

thats what i was already using it for smh

ashen harbor
#

Oh good, no more lag when gals are pathing to entrances

green gust
#

there wasnt any lag previously for gals pathing to entrance, im just accomodating smarter pathing

#

and well, more pathing

keen ruin
green gust
#

yeah true

ashen harbor
#

It's only those cases though

keen ruin
#

makes sense there could be a little perhaps, surprising to me if it was that noticeable tbh

#

Xu, weren't you choosing just one entrance teleport to check before? I forget

#

maybe you were checking all idr properly

#

I forget how often/how many paths you were calculating

green gust
#

i stored a list of exits i KNEW were pathable because the player who owns the gal already used em

keen ruin
#

ohhh okay

green gust
#

it would cause issues if doors were to get locked, but i never calculated any paths, except one for disabling the agent

keen ruin
#

that must have been before I saw the code properly, I'm guessing

green gust
#

yuh

keen ruin
#

then yeah it probably shouldn't have been too noticeable

#

oh yeah and @ashen harbor idk if you're still thinking of adding the lib, but I would definitely recommend to wait until I make it a dep, my own patches may conflict with themselves otherwise lol

#

I haven't checked that

ashen harbor
#

Lol got it

kind elk
#

Yeah i got it

ashen harbor
kind elk
#

I am lunxara

keen ruin
#

pushed out the update to make PathfindingLagFix Beta use PathfindingLib, there should hopefully be no behavior changes

#

except for a very minor change to distance pathfinding affecting brackens, etc that should make them slightly more consistent with vanilla

kind elk
#

Jimothy can now be real pog

keen ruin
#

I'm looking at patching the tulip snake now, @crimson jolt did you have a patch to replace calls to FindObjectsByType already? I'm thinking of making some patches for those calls to make them use lists without allocating but I don't want to break on other patches if there are any

#

I feel like I remember someone mentioning doing that, but I forget who

crimson jolt
#

it wasn't me

#

i believe it was @vagrant gazelle

keen ruin
#

ah yeah, I think you're right

crimson jolt
#

the only place i patch tulip snakes is jetpack fixes and enemy sound fixes

keen ruin
#

notedd makes sense

crimson jolt
#

and i can link you both repositories if you want to peek at them to make sure you won't conflict with anything

#

but im willing to bet anything you touch pathfinding-wise should be fine

keen ruin
#

I shouldn't if they're only relevant to what is logical for those mods

#

it definitely should be yeah

#

my pathfinding patch is quite minimal

crimson jolt
keen ruin
#

I think it will take care of the stutters that people have been seeing too, I was able to reproduce it somewhat

crimson jolt
#

this is the only function that majorly affects tulip snakes and it's mostly just a postfix to patch over some jank with the jetpack

keen ruin
#

it's not mainly the FindObjectsByType but rather two Choose[...]Position calls in a row

crimson jolt
#

and this just changes some stuff with audiosources, also in a postfix

keen ruin
#

should be fine then

#

I'll have to see what CritHax thinks with regard to patch conflicts

crimson jolt
#

wow

#

very elegant

vagrant gazelle
#

Thank you ^w^

keen ruin
#

yee that's pretty clean NODDERS

#

I would like to try to make one that's non-allocating, but it would need to be a little bit more involved obviously

#

I guess that we shouldn't really have issues with each other's patches considering that it should be a no-op if it finds no call to FindObjectsByType actually

vagrant gazelle
#

I never released the mod nkoHehe

keen ruin
#

ohh ok lol

#

basically mine will be very similar except using an internal Unity API to grab the array out of the list, then transpile ldlen to use get_Count instead

crimson jolt
#

the whole enemy thing is kind of bizarre

#

zeekerss keeps a constant list of spawned enemies on RoundManager.Instance

#

which, after the course of multiple updates to the game, now catalogs all enemies on all clients (except that masked still only work for host but they are the exception)

#

but he doesn't even iterate that list here, just does a findobject for flower snakes

keen ruin
#

yeah it would be a little uglier but faster to do that

crimson jolt
#

iirc the only place he uses the cached enemies is for the "Nearby activity detected" prompt on the teleporter doors

keen ruin
#

but also it's not hard to just maintain a list in OnEnable/OnDisable

#

I think it's used for more than that, but not that much iirc

crimson jolt
#

yeah i was going to say it's even more bizarre because flower snakes have a static list called mainSnakes

keen ruin
#

I forgor what the usecase I looked at recently was though

crimson jolt
#

which you'd think would point to all the tulip snakes with isMainSnake = true

crimson jolt
#

except for some reason he doesn't use it at all

#

just resizes it when the first tulip snake spawns

keen ruin
#

I was gonna use that for OpenBodyCams but I couldn't

crimson jolt
#

i assume it's just commented out in his project somewhere

keen ruin
#

probably

crimson jolt
#

all the code using it

keen ruin
#

I think there's a couple places where it should have been used iirc

crimson jolt
#

i think this community (myself included) can be a bit too nitpicky about zeek's code sometimes

keen ruin
#

oh for sure

crimson jolt
#

but the like. #1 most painful thing is seeing find calls that really should not exist

#

Lol

keen ruin
#

yeah it is a common mistake among modders to tbf

crimson jolt
#

anytime he uses findobjectoftype<roundmanager> or some other singleton it brings a tear to my eye

#

because those can at least be fixed with 0 refactoring

keen ruin
#

that's probably old code that has been long forgotten tbh

crimson jolt
#

i assume so yeah

keen ruin
#

should definitely do a find in project but oh well

crimson jolt
#

hopefully one of these days he just does a ctrl+F on everything and makes the changes

#

yeah

#

anyways sorry i derailed a bit

#

in other news

#

always makes me happy to see pathfindinglagfix grow in power with each new development

#

hoping v2 can have a smooth release soon

#

i've been using the beta on my debug profile but i've been sticking to stable with my friends since we have to rehost enough anyway because of other issues

#

so far i've personally encountered no issues but that's probably not the best data to sample

keen ruin
#

I think it should be safe to use in normal play, at least as far as stability goes

#

it's possible that I have introduced some regressions in enemy behavior, but that would be good to find out through normal play

#

Lunxara hasn't stopped using it since 2.0.4 (for long at least) afaik, and it hasn't caused a crash

#

if new crashes do pop up, I'm fairly confident I'll be able to fix them the same way I've fixed all the other causes, only question is how long it'll take to figure out how to reproduce the particular new cause

kind elk
#

That is correct no crashes

keen ruin
#

thanks lunxara plink

kind elk
#

greed no problem

crimson jolt
#

do you foresee problems with mix&matching stable and beta across players?

#

i could maybe start using the beta on my end (i host all our games if it's relevant) to try and get some real sample data

#

but i'd feel bad telling them all to shift to beta then making them shift right back if there are problems

#

so i might not advise them to make the switch until it's live

keen ruin
#

should be fine, each enemy only does pathfinding on one client at a time (mostly the host, you)

#

I've used beta on host and on client while others were on stable and had no issues

#

not as much when I was host though tbf

#

simply because it's been a while since I hosted

#

regardless, no reason it should have issues

ashen harbor
#

I've been keeping it in my pack as a main stay since it got fixed yeah

#

I still dunno what Piggy's Variety Mod was doing that caused me to be unable to close lobbies

#

lol

keen ruin
#

nonstandard networking practices perhaps, idk

ashen harbor
#

Prolly

#

I just really love those Tesla Gates as a hazard, they add so much to the game lol

kind elk
#

You want some dough with that glaze?

#

Lol

crimson jolt
#

i will dip my toes into it then and let you know if we have any issues next time we play

#

well, regarding pathfinding, anyhow

keen ruin
#

NODDERS that would be helpful

#

thus far nobody has noticed anything out of the ordinary, but the AI is already buggy so it's hard to be sure lol

keen ruin
#

just pushed:

Version 2.0.6 (Beta)

  • Added some tulip snake patches to prevent stutters, especially just after they have dismounting a player.
  • Prevented some rare situations where enemies may be permanently blocked from doing distance-based pathfinding.
#

(this includes the patches to FindObjectsByType along with the usual async stuff)

ashen harbor
#

He always mentioned the lag from them

#

lol

keen ruin
#

nice lol

#

I've heard it from a few people including you, but only recently found out it was specifically happening largely only when they dismount

#

made it much easier to determine what exactly I needed to patch

#

if there are other situations in which you see bad performance from them though, lemme know

#

they do also have a serious cost just due to having two animators, which I have yet to figure out a proper solution to

ashen harbor
#

Yeah some of the enemies are coded a bit strange

keen ruin
#

well it makes sense how it's set up except for the fact that the skinned mesh renderer isn't a child of the body animator so the animator can't be culled properly, at least not easily

#

I gotta figure out if there's a way I can give it a fixed bounding box

ashen harbor
#

Speaking of funny things not being culled

#

Cheese in the Cheese version of Slaughterhouse

#

XD

keen ruin
#

are those in place of the meat hooks?

ashen harbor
#

Yeah they replace the meat

keen ruin
#

huh I see

#

idk if the meat itself is part of the tiles, but if it is, then I guess I really need to make that API where people can add renderers to tiles........

ashen harbor
#

I don't think it's gonna cause any issues, just found it funny

keen ruin
#

nah it shouldn't

#

it's just inefficient

ashen harbor
#

Yeah

keen ruin
#

what does the replacement? is it built into the slaughterhouse plugin?

ashen harbor
#

Yeah it uses JLL, so the cheese version is on Slaughterhouse, there's also a unique version of Slaughterhouse that Nikki did for Bozoros

#

It's tag based

keen ruin
#

hmm, then I wonder when it does the replacement

#

there definitely should be a way to do it before CullFactory activates

#

assuming that the meat is not a SpawnSyncedObject for some reason anyway

#

I guess I should look at this

ashen harbor
#

@swift token how does it trigger the tag based stuff again?

#

Wesley told me how it worked once but I forgot

#

lol

keen ruin
#

(speaking of the cheese replacement on Slaughterhouse to be specific, so you don't have to read up)

#

oh they are SpawnSyncedObject, I wonder why thonk

swift token
#

ugh probably a better question for nikki than me. i'm pretty sure it's using some combination of multiple of my scripts connected through unity events. I'm pretty sure it's just enabling or disabling different meshes based on the value of the config and a level filter to read the tag

keen ruin
#

ahh, gotcha

#

good to know

swift token
keen ruin
#

oh, I didn't know those had a script

ashen harbor
#

Yeah according to Nikki she did the normal meat manually but forgot to for the cheese

keen ruin
#

I figured the spider changed the body's attachment point while it was moving it around

keen ruin
#

it's probably not a huge deal really

ashen harbor
keen ruin
#

oh that

#

sure

#

ideally they aren't SpawnSyncedObject since they don't have any player interaction other than pushing, but idk, maybe the pushing is networked

#

that would be kinda funny if it was but maybe zeekerss set it up that way

ashen harbor
#

@copper cosmos is that how Zeekerss set it up?

keen ruin
#

buh

#

I was about to say, it's probably not so important as trying to figure out how to cull more animators in the interior, then maybe make the meat physics go dormant more easily, if they are not doing that already

#

animation culling crap is kinda on me, I need to generalize the solution I use in Black Mesa

#

doors thing might be able to be a general mod for all interiors (if I can detect whether the doors don't have an idle animation), but the lights thing is a bit more involved and probably where the majority of the performance loss lies

#

Slaughterhouse has about as many animators as Black Mesa did, and generation is probably smaller too πŸ˜…

ashen harbor
#

Yeah Slaughterhouse is quite a bit more optimized now though since it is now making proper use of Dungeon Generation Plus lol

keen ruin
#

since when you do you mean? I don't think that would affect framerates at all

ashen harbor
#

It helped cus the interior had a lot of light sources and shadows lol

#

So you'd almost always reach the shadow limit before unless you used low shadow mode

keen ruin
#

ohh, you mean that it's using DunGenPlus to increase the shadow limit?

#

I would hope that running CullFactory would effectively prevent hitting that limit

#

but increasing the limit isn't really an optimization, it's just a way to get Unity to shut up

copper cosmos
#

Pushing the objects has to be networked or it just doesn't let you push them at all. That said only the initial transform is synced, they aren't like, constantly checking transforms and syncing it or anything.

keen ruin
#

huh, that's interesting that it requires that

#

I guess that it kinda makes sense to make the thing move semi-consistently across clients, but it's unfortunate for them all to be exempt from culling

#

I forgot what the component is that does the pushing though

copper cosmos
#

It's an easy fix on my end to add the LOD Culling for the model, I just forgot and really don't feel like Unity rn

#

And it's a non issue ultimately since it will only affect a slight bit of performance on Gorgonzola

keen ruin
#

sure yeah

#

generally triangles aren't really the issue as much as objects being processed though, so CullFactory taking care of it will usually be more efficient than LOD culling I think

#

and more correct

#

anyway, not saying you need to change that, it's fine

#

I did the same thing for the barnacles

copper cosmos
#

Yeah makes sense

keen ruin
#

at some point I really gotta get that animation stuff working for you though, it seems like that would be quite beneficial

#

the light thing would probably take some explaining, and depending on how many light prefabs you have, a bit of tedious reworking, but it should help a lot since for whatever reason HDRP lights do a bunch of random work in LateUpdate() if they had an animator parent when they Start()ed

green gust
#

I did notice a weird light warning spam a while ago while I was testing jimothy

#

I gave one of his objects two colliders that were inside eachother, stood inside one and pointed thr camera towards the inner one

#

Then the light warning from hdrp kept spamming

keen ruin
#

definitely shouldn't have anything to do with colliders, what interior was it?

#

and also was CullFactory disabled?

green gust
keen ruin
# green gust just normal factory

oh very odd, I wonder if something in your mod could have been making extra lights? zeekerss has the lights set to fade at a good distance to where it's incredibly unlikely to see that error

#

or perhaps impossible, not sure

green gust
#

i mean it was only spamming it when i moved my camera to look at the inner collider while i was inside the outer collider, so idk what was going on there tbh maybe something with the player's own light but im just talking out of my ass here

keen ruin
#

well it it was the shadow count warning it shouldn't be related to the player light

#

hard to say

green gust
#

i have also noticed this before btw

#

one time i was either spectating or just playing with @limber elm, and i was looking at logs and everytime i looked at her hair cosmetic it just spammed the shadow warning lol, other people in the lobby also noticed this happening, it was pretty funny

#

hasnt happened since, i think anyway

green gust
#

also do u plan on making black mesa depend on this one? cuz it still depends on the old one

keen ruin
#

it's gonna be merged to stable eventually

green gust
#

icic

keen ruin
#

probably not long before then actually, since I can just add patches to stable as I make them

#

fyi, made an oopsie with the PathfindingLib plugin GUID in 0.0.4, so if you install that version, PathfindingLagFix Beta 2.0.5+ will stop working

#

fix going out in 0.0.5 now

lyric hedge
#

@keen ruin I can't remember if I've asked this before, but will you be updating PathfindingLagFix or will you be uploading this version as its own thing?

keen ruin
#

it's going to become v2 of PathfindingLagFix

#

beta is just a branch

lyric hedge
keen ruin
#

once I'm satisfied with it (probably will be quite soon), I will push it to stable as 2.0.0 and deprecate beta

lyric hedge
#

AWESOME

keen ruin
#

I have unlocked a new power, I am a MonoMod enjoyer now

#

I should have an update for PathfindingLib soon ℒ️ that makes it so that all the async pathfinding only has to pause when doors are locked/unlocked rather than doing it every frame

green gust
#

all it took was being in vc with matty?

keen ruin
#

now instead of just decompiling C# assemblies I will be peering into the depths of the x86 world

#

lmao well Matty helped a lot yeah

crimson jolt
keen ruin
#

nope

#

I wouldn't use hookgenpatcher ever lol

crimson jolt
#

ah

#

i get it confused with something else

#

melonloader i think

#

i dont remember

keen ruin
#

but I can generate hooks into native methods using MonoMod's APIs

crimson jolt
#

ahh

keen ruin
#

I mean MonoMod is what enables HookGenPatcher, it's just a lil wrapper over the MonoMod APIs

#

but basically I found a function in UnityPlayer.dll that applies the carving results on the main thread, hooked it, checked if it had any changes to apply to the navmesh, then locked the navmesh for writing only then

#

before, I was using two new subsystem in the player loop to wrap the AIUpdate subsystem in write locks

#

and also telling all jobs to pause at the start of the frame

#

on average they were probably losing like 1ms of working time per frame

#

maybe a little more

#

overall the patch isn't too complicated, I shall commit it momentarily if you want to look

keen ruin
ashen harbor
#

@keen ruin Snare fleas seem to be broken atm

#

I can only assume cus of one of the recent updates

#

they can't damage players properly when on them and when they drop down they don't path towards players

keen ruin
#

hmm interesting, will take a look

#

does this happen for everyone always?

crimson jolt
#

a snare flea killed my friend earlier today

#

the two of us were using the beta (me as host)

#

i think everyone else was on stable (5 total)

keen ruin
#

Hmm I see, so it's either a fun interaction that we gotta figure out or some other mod broke it

#

el classico

keen ruin
#

gorgeous @tardy pivot

#

it is now using slices of 128 iterations and the delay is negligible for all threads

keen ruin
#

PathfindingLib Version 0.0.7 is out now:

  • Reduced blocking of the main thread by hooking into the Unity runtime to detect when carving obstacles will make changes to the navmesh.
  • Changed documentation to recommend using NavMeshQuery.UpdateFindPath() with an iteration limit, and unlocking the navmesh read between calls.
tardy pivot
tardy pivot
tardy pivot
tardy pivot
#

also your example job in FindPathJob.cs doesn't seem to be using the Lock anywhere πŸ€”

#

nvm i'm blind i was looking at an old commit 😭

#

ok this time for real. in FindPathJob.cs you never acquire the Read lock nor release it. you only call Yield

#

@keen ruin

keen ruin
#

huh

#

that's weird lol

#

I wonder how I managed that

#

and also how I wasn't able to repro a crash with Xu's mod earlier

tardy pivot
#

is it a matter of not having committed it or you actually don't have it on local too? πŸ˜‚

keen ruin
#

no it's just never been there it seems like

green gust
#

fun

keen ruin
#

at least no one's crashed right? πŸ˜…

green gust
#

as far as i know, none

tardy pivot
#

yet

keen ruin
#

I'll add it rq

#

your jobs run much less constantly than mine so it makes sense it would have passed under the radar

#

not ideal though

#

uno momento

#

ty for catching that Matty

tardy pivot
#

had some free time this morning before catching a train πŸ˜€ yw

keen ruin
#

hmm I wonder though

#

if I change carving with that version I should have deadlocked

tardy pivot
#

not necessarily if there was already a job running

#

and if no job ever started then the lock would still be free

keen ruin
#

jobs were running but yeah I suppose if there is one of these bad ones in flight it lets the main thread run again

#

eh

#

I won't worry about that rn

tardy pivot
#

in any case we caught it before it has became a problem

keen ruin
#

lmao @green gust I see why it is so unlikely to crash with your Jimothy guy

#

to be clear this is with a lot lot lot of them, but the point is that the physics updates are taking really long due to all the trigger colliders

#

PlayerPhysicsRegion and EnemyAICollisionDetect

green gust
#

hmm

keen ruin
#

perhaps you need to set some layer exclusions on them, but I might also want to look into optimizing those OnTriggerStay() handlers to not alloc

green gust
#

ontriggerstay on jimothy?

keen ruin
#

although I'm not entirely sure what is allocating

#

yes

green gust
#

i dont think he has any

#

i could be crazy

keen ruin
#

on PlayerPhysicsRegion and EnemyAICollisionDetect

green gust
#

ah, zeekerss stuff

keen ruin
#

not sure if he has the collision detect but definitely the physics region

green gust
#

i could just replace em with my own script

keen ruin
#

you're in control of the collider tho

#

nah

green gust
#

yea

keen ruin
#

if you replace PlayerPhysicsRegion you're on your own lmao

green gust
keen ruin
#

optimizing it may be worth something though

#

and also make sure you have all layers excluded except the ones that are relevant

green gust
#

well i dont really do transpilers or patches to stuff like that usually lol, but i can mess with the collider

#

i need to go through all the things i add and mess with their colliders

#

there's a lot

#

i also need to make my gal colliders like, a lot less

#

i think i used to put a static collider for each of their armature bones

#

to be fair it's accurate Kek

keen ruin
#

yeah I mean my looking into optimizing those OnTriggerStay methods

keen ruin
green gust
#

nope, just for standing on em like collision and stuff

keen ruin
#

oh

#

you're supposed to be able to stand on their shoulders??

#

that seems a bit overkill lol

green gust
#

its useful sometimes

keen ruin
#

but you might be able to make those only physical collision and not trigger any callbacks, not sure if that would be the default behavior for those

green gust
#

one time i was drowning, so i stood on their head and jumped away

#

ye they're just static colliders

#

so no trigger stuff

#

im gonna have to check the exclude etc stuff for scannodes and whatnot layer

#

later*

#

that's gonna be a bit tedious

#

cuz they also use colliders (which i assume need to be trigger but i could be wrong)

#

also i guess if a trigger collider is only for when zeekerss is doing a sort of overlapsphere

#

it can just exclude everything?

keen ruin
#

main thing you need to do is exclude everything irrelevant on your physics regions and collision detects

#

you're getting triggers on your own colliders

#

this is with just one jimothy

#

(zeekerss should also add exclusions.....)

#

(but thankfully it is just the elevator....)

keen ruin
#

uploaded the hotfix for not taking the read lock in PathfindingLib 0.0.7, and also tested CodeRebirth on March with carving and navmesh generation running every frame and things seem fine

#

also added profiler markers to verify that the jobs are pausing, they are indeed doing so the same as my job in PathfindingLagFix so we should be good @green gust

green gust
#

yippee

keen ruin
#

god the fact that I was able to get this working with the minimal amount of thread waiting possible so easily makes me really question the Unity devs' judgement for not doing so themselves

#

like this could just be one mutex and condition variable in their code and a few locks around the navmesh writes and then it never crashes again

#

if I'm able to hook in and do this they could do it even more easily

tardy pivot
#

that reminds me later this weekend i'll probably make a PR to your repo with some extra checks in the lock implementation. as that's a user facing api we should make it a bit safer ( obvs with the minimum impact on performance possible )

cold peak
#

yet another unity causing crash

keen ruin
keen ruin
#

they mention it's happening at exit though so maybe not a big deal exactly

green gust
#

@keen ruin btw i've had 3 people so far ask me interested about using pathfindinglib

keen ruin
#

uh oh

green gust
#

you've got an audience

keen ruin
#

like other AI authors I assume?

green gust
#

very unfortunate

#

si

keen ruin
#

gotcha

green gust
#

one of em has 50 agents that are trying to calculate their routes as part of 1 enemy

keen ruin
#

oh is that the rat?

green gust
#

yuh

keen ruin
#

oh jeez

green gust
#

@gentle charm

#

there was also the lethal gargoyle creator

#

that shitty scottish enemy

keen ruin
#

well maybe it's a good thing I was looking at hacking into the runtime to inject paths into agents

ashen harbor
keen ruin
#

they seemed fine in my testing

#

I would be interested to see clips of what is odd though

ashen harbor
#

Well we had a Snare drop on a client's head and it only did 10 damage to them and when I attacked it it didn't drop off their head til I killed it, then I noticed everytime a snare would drop from a ceiling they just ignored me as well as clients and would wander off instantly

#

Idk

#

It was very strange

#

Other enemies all behaved fine

#

Maybe some weird interaction with More Company?

green gust
#

clips too

#

you can notice a lot and still be wrong

#

@keen ruin what layer are doors on πŸ₯Ί

#

need it to figure out what im excluding from jimothy's layers

keen ruin
green gust
#

interactableobject sounds right

keen ruin
#

do you need to interact with them?

green gust
#

enemies open doors via EnemyAICollisionDetect

#

so i cant just exclude every layer except player layer

keen ruin
keen ruin
ashen harbor
#

I just know they were fine til tonight lol

keen ruin
#

initial information was far from enough for a repro

ashen harbor
#

Yeah my bad, I'm very sleepy so that was my fault

#

XD

thin iris
#

does this mod replace this?:

keen ruin
keen ruin
#

it is in beta

#

check the readme and use at your own risk

#

@ashen harbor any idea if this issue could have started with beta 2.0.4?

#

the player targeting is my first thought for a possible culprit

ashen harbor
#

Possible, I was wondering if it maybe started with the update where you split up the mod and Lib

keen ruin
#

nah it wouldn't be that

#

or it's very unlikely anyway

#

if that were the case, there would be a whole more broken AI going around

cursive sonnet
#

There were 3 of us spectating when it happened but I don't think any of us clipped our perspective 😭

ashen harbor
#

Yeah true

cursive sonnet
#

but it literally just latched onto the player and just, didn't do anything

#

timestamp

keen ruin
#

hmm I see

#

it's incredibly odd that it didn't detach, logs would have been very helpful for that

#

but I'll have to see later if there is anything that would cause exceptions when hitting the snare flea to make it not run the detachment code

#

I don't patch anything to do with that, which makes me think that another error happened before that, so without logs I am in a tough spot

cursive sonnet
#

Sadly

ashen harbor
#

The only errors I ever got were from CustomStoryLogs iirc but I can send you the SQLite

#

Actually wait

#

I sent Wesley the log I think

#

Should be it

keen ruin
#

hmm, nothing shows up searching for the obvious keywords

#

but it's also possible that I incidentally fixed this in a commit that I haven't uploaded to thunderstore yet, I'll have to check in a bit

tardy pivot
#

i cannot test it atm so i might have made some mistakes but the idea is there

#

the impact should be minimal if not none as the operations added are really simple

keen ruin
#

hmm, I see

#

I tend to think this is unnecessary on some level though, since I can prevent being in the wrong state by just asserting that we are on the main thread or not

tardy pivot
#

you can assert it but assertions will be stripped out on release and this is a public api.

#

plus you yourself managed to break it previously with the yield w/o Begin

#

that meant you had the reader count negative in some moments

keen ruin
#

fair point

tardy pivot
#

i highly doubt this few checks will cause any measurable impact in performance

#

and even then the security gain would be worth it imo

keen ruin
#

the one big misgiving I have right now is that I vaguely remember trying ThreadStatic for something a while ago and it performed pretty badly for some reason

#

I guess in this case I should just record the time to check these things before and after, but I wonder if there is a better way

tardy pivot
#

ik ThreadLocal is quite bad for performance

#

i tried to google ThreadStatic but found noone that did performance comparsions

#

only thing i found is that ThreadStatic perform a lot worse in Debug builds than in Release

keen ruin
#

ah right, that could make sense maybe

#

I'm assuming that means the CIL optimization level though, my "debug" builds are still optimized, just with profiler markers added

keen ruin
#

wait also @tardy pivot how would your commit handle multiple ReadersWriterLock instances? if we're gonna be expanding the functionality of the class it should not assume that there's only one

#

we would probably need to protect a dictionary with the mutex wouldn't we?

#

anyway, I can add a simple check to make sure that the readersActive doesn't go below zero at least

tardy pivot
#

i mean that lock was used as a static class to begin with πŸ˜…

if you want to allow multiple separate instances then all the statics need to become instance field and instead of ThreadStatic attribute use the ThreadLocal<T> objects

keen ruin
#

the lock instance was in a static class

tardy pivot
#

yeah i meant that we create only one instance of it

keen ruin
#

sure, but in that case I might as well make everything involved in the locking static

#

then at least it's obvious that it can only be used once

#

I would rather keep the class form, and I can make protections for these things through throwing exceptions based on the information that already exists rather than creating that limitation

tardy pivot
#

converting them to threadlocals is not difficult butbi'm unsure about the performances in that case

keen ruin
#

if readers are only ever on different threads than writers, the check for taking a read lock within a write lock and vice versa can never happen

#

(which we can safely say should always be the case)

#

main thread can always safely read the navmesh, it doesn't need to take the lock for that, so I don't want to allow it

tardy pivot
keen ruin
#

yeah

#

I mean I can make the assertions into exceptions probably as well, I just have to check the cost of determining if we're in main thread

#

it's probably very minimal

tardy pivot
#

only check we should implement somehow is the recursion. as it is possible to acquire the write multiple times i belive πŸ€”

keen ruin
#

I looked up some discussion about performance of ThreadStatic vs ThreadLocal, and people were saying that ThreadLocal performed badly, so I think if I were to make those protections I would create my own data structure to keep track of that

keen ruin
#

write lock can only be taken by main thread, and it has a "thread local" in the form of a static field for the depth

tardy pivot
#

oh uh? ok

keen ruin
#

only main thread can read from that field by nature of it being behind an assertion

tardy pivot
#

sure then there is no need to change anything tbh.

#

it's a matter of performance vs security
or more precisely caring to gracefully fail if a 3rd party uses the api wrong

keen ruin
#

yeah

#

the assertions should definitely be enough

#

and also performant

tardy pivot
#

πŸ‘

keen ruin
#

@ashen harbor some part of the strange behavior with the centipedes seems like it may be caused by the async player targeting patch, I'll have to rethink that one I believe

#

not sure what would have caused it to do no damage and not want to detach though

#

the issue I'm observing is that because the first result from calling TargetClosestPlayer after it has attached to the ceiling with no one inside will say that no player is targetable, it immediately goes into retreat mode until the next time it drops

#

however, I can't really seem to get it so that the centipede doesn't do damage yet

keen ruin
#

looks like maybe the check for main thread was actually causing exceptions on release builds, but it wasn't outputting any of them sad

#

just pushed an update to just roll a new function for this check instead, should work again

#

in v0.0.10

green gust
#

I love exceptions that don't get outputted

#

How does that even happen

keen ruin
#

I don't know lmao

#

I wish I knew

#

unless maybe it would show up in Player.log, I could try to check quickly

tardy pivot
#

BepInEx only collects unity logs from main thread. everything else goes to the Player.log only

keen ruin
#

huh

#

I get logs in the console from other threads tho

tardy pivot
#

yee i found that out some time ago while working on AsyncLoggers

keen ruin
#

oh I guess they don't go through unity log tho

#

hmm

#

good to know

green gust
#

Yes definitely for sure

tardy pivot
#

yep BepInEx loggers work. it's specifically Unity logs

green gust
#

I agree because it makes me sound smart

#

Unity things amirite

tardy pivot
#

this is more a BepInEx issue than unity tho

keen ruin
#

yeah guess I know where to go if something weird is happening in my jobs

#

(if I see the exceptions there, I will check now)

#

I'm guessing maybe CurrentThreadIsMainThread() just returns true in all cases in release, maybe your decomp could tell you Matty

#

since I don't have the release UnityPlayer.dll decomped yet

tardy pivot
#

i've pondered if to patch it in AsyncLoggers in the past then decided to leave it as original

keen ruin
#

oh it's something easy to fix?

green gust
tardy pivot
#

yeah it's a matter of moving a action from one event to another

tardy pivot
keen ruin
#

huh, I see

tardy pivot
#

to logMessageReceivedThreaded

keen ruin
#

why is it registering it with reflection btw? seems funky

tardy pivot
#

not sure tbh

keen ruin
#

also I am currently very confused, I switched it back to using UnityEngine.Object.CurrentThreadIsMainThread() again and it is not failing to run the jobs anymore

#

I must've goofed something before

tardy pivot
#

prob because it's in a preloader and it should not load the classes until needed

keen ruin
#

wait but wouldn't the Application class be loaded by using its nested class?

#

and also by getting the method via reflection?

tardy pivot
#

yeah but that method is called after unity boots. but it's loaded before

cold peak
#

reflection used to support old unity versions

tardy pivot
#

or that..true

keen ruin
#

huh, because of overloads?

#

but I guess I don't know how an overload would not also cause errors with reflection if they aren't providing parameter types

cold peak
#

no, because RegisterLogCallback is for 4.0.0-5.0.0 unity versions

keen ruin
#

ohh I see, I didn't realize that this was a fallback case

#

I'm freakin pleepy

tardy pivot
#

ohh yeah i linked the wrong lines... uops

#

i'll check that once i'm back at the computer πŸ˜…

tardy pivot
tardy pivot
#

o/

green gust
#

Zaggy sleeping

#

But I figured you'd be interested since you're both on this

#

And I don't understand jt lol

tardy pivot
#

yeah i saw that

#

i'm trying to convince him to do proper thread safety for the lock.

green gust
tardy pivot
tardy pivot
keen ruin
#

yeah I'll probably do that or make a linked list of thread data like the .NET one does, later

#

first things first, I gotta back it out to remove the exceptions

#

I don't have time to fully fix the safeties

#

I also am very curious why it would be thinking it's running on the main thread though

tardy pivot
#

linked list will probably be worse in performance than statics tbh

keen ruin
#

for sure, but it should only be one extra comparison over the static implementation

#

if it is implemented as a static class though, I would tend to say it should just be in NavMeshLock instead of split off in another class, since it can't be reused anyway

#

at least not without copying it

tardy pivot
#

and nobody should be using this implementation of the lock outside the lib use-case

tardy pivot
tardy pivot
#

anyways making the lock static seems the best approach to me

crimson jolt
#

just wanted to say my game has been running noticeably better recently and i have no doubts the plf beta has been a large part of that

#

the only other change i've made recently was like, disabling showcapacity after finding out it used reflection invoke + gameobject.find every single frame

#

though i think the latter has been straightened out now at least

#

anyways plf is the goat

keen ruin
keen ruin
#

but I'm glad to hear that it feels better peepoHappy

crimson jolt
#

well, i made the change a couple weeks back, but i noticed the past two nights i've played that performance was like, consistently 100+ frames for me

#

and i can't remember any other recent time that's been the case

keen ruin
#

what was it before out of curiosity?

crimson jolt
#

pathfindinglagfix beta seems to be the only meaningful change i've made in that time

#

unless some mod got a huge stealth performance update or smth

crimson jolt
keen ruin
#

if you're the host, it definitely makes sense that you would feel it

crimson jolt
#

worded that kinda weirdly

keen ruin
#

oh idk if it was clear, but I meant what was your fps before?

crimson jolt
#

oh

#

i never benchmarked it before so it's always just been feeling for me

#

but i can "feel" the difference between 60hz and 120hz

#

and i was always much closer to 60hz before, whereas now, it feels closer to 120hz

#

sorry that's not a very exact science πŸ˜“

#

the improvement is noticeable though

#

if the metrics help you, i could do a comparison next two times we play and use an actual fps counter

#

:p

keen ruin
#

I mean it's not super important, I think I'm more intrigued to see what lower end machines get

#

I just like hearing reviews on how it is helping in general though

crimson jolt
#

i see

keen ruin
#

it makes a huge difference in my synthetic testing but I haven't gotten to host games too much for a while

#

doing it now tho

crimson jolt
#

my stuff is pretty dated (it was "high end" like 10 years ago) but i wouldn't say "low end"

#

i am probably on the lower end of specs in terms of the people i play with, i suppose

#

anyways sorry to babble i just wanted to say

#

been loving the work you've done over here

#

done a lot of lurking since most of this thread is out of my realm of expertise

#

but it makes me happy to see all the progress

keen ruin
#

peepoHappy thanks

#

also

#

it's only out of your realm of expertise if you let it be

#

but also fair

crimson jolt
#

lol yeah

keen ruin
#

there's a lot of things that I didn't think I would be doing with mods when I started lol

crimson jolt
#

in any case, im not there yet

#

netcode has always felt sort of like black magic to me before i saw how approachable unity made it with nfgo

#

and i think it was mostly just assumptions on my end making it sound scarier than it really was

#

that sort of thing applies to other concepts, i'm sure

keen ruin
#

yeah for sure

#

that's how it often is

#

even things that are difficult to approach, you kinda just have to immerse yourself until you understand pieces of it, keep reviewing things you don't understand until the information you do understand gives you more context on the other things

#

there's a lot of things I've learned on my own just by doing that

safe ember
#

Hello, I was wondering if there is any significant improvement between the non-beta version and this one?

green gust
#

There should be ye

safe ember
#

Awesome, who likes stable releases anyway elmofire

green gust
#

This should be stable*, it'll get transferred to the non beta version maybe soon-ish

crimson jolt
#

imo the beta is pretty stable now

#

there was a lot of concern with crashes in the earlier versions but i haven't encountered any so far (since v2.0.4)

#

i think it's just getting new features ATM that are preventing it from leaping to stable release yet

green gust
safe ember
#

thought alright

keen ruin
#

yeah the difference is very significant between stable and beta, beta is effectively a total rewrite and it is more of a performance mod than a bandaid fix

#

the longest-running parts of most AI in the game (at least the ones that have been patched) run off the main thread in the beta

#

also yeah, mainly trying to ensure that AI is totally functional and behaves as intended before I push to stable, had a mishap with one of the patches that I was trying to avoid specializing, so for now that one is disabled to see if things are fine without it

#

main things I need to know are whether any AI behaves in an unexpected way or becomes stuck

keen ruin
#

not live yet in case you spot anything screwy

tardy pivot
#

time to check πŸ˜„

#

why getting the state by ref?

#

also if we track the recursion depth we need to implement the Yield so that it ignores the depth. or it will not have any effect

tardy pivot
keen ruin
keen ruin
#

can't hurt, so I'll think on it tomorrow

tardy pivot
keen ruin
#

ah ty, that's good to know

#

it did seem to be working, so I'm really not sure what I messed up to where it seemed not to work

steep tartan
cursive sonnet
#

You can probably make sense of the first half of the video but then it just falls apart at the half point lmao

keen ruin
#

yeah I'm not sure when the AI is supposed to switch out of that mode, but the maneater is intended to sneak around near the player when you're within a certain area

#

it's one of the most complicated AIs in the game I think

#

so it's hard for me to say if that's something that was somewhat intended

cursive sonnet
#

it probably is the most complicated

crimson jolt
#

the maneater sneaks around like the bracken and tries to avoid player line of sight

#

but also tries to approach the player when it's not being observed

#

but regardless of where it is moving i think it aggros based on distance to the closest player

#

which is why it seems to constantly flip between running away and attacking people

cursive sonnet
#

I think like

crimson jolt
#

though

cursive sonnet
#

half of that gets thrown out the window once it gets stuck

#

like why'd it decide to just... run through the player and not do anything 😭

somber lily
steep tartan
#

Maneater AI is really strange, the few times i dealed with the adult form were unforgettable 😭

#

The strangest one was outside, where he was looping a rock at night and didn't attack anyone

#

Then someone got into the ship and he went on a killing spree

cursive sonnet
#

the time i learned it charges for a lot longer when outside

crimson jolt
#

lol yeah it gets super buffed when it's outside

steep tartan
#

btw, played some solo runs with pathfinding beta and everything was very smooth πŸ‘

#

although there was a certain enemy who behaved a little strangely

#

aka Masked

#

idk what to say, he was dumber than usual

#

on rend he saw me and just gave up chasing me to the ship

#

on titan he saw me at the staircase and decided that the best path to get me was to return and use the other staircase with the dogs

green gust
#

i like the gargoyle

crimson jolt
somber lily
crimson jolt
#

they act super weird now ever since the mineshaft elevator changes

steep tartan
#

but it's strange how they behaved this time, they didn't even try to get to the ship

keen ruin
#

I appreciate you looking out for bugs nonetheless, anything out of the ordinary is worth letting me know about

ashen harbor
#

They just kinda start spinning and rotating as they move, and fighting them becomes difficult cus their hitbox becomes inconsistent πŸ˜‚

keen ruin
#

I feel like I've seen spiders spin in place in vanilla, but I can't say I'm sure

keen ruin
#

the only thing I change that should affect spiders in the current version is the patrolling code, which in theory should mean that any other patrolling enemy could exhibit the same behavior if it's caused by PathfindingLagFix

#

and I think there are other mods that do several fixes for the spider AI right? I wonder if any of them address that if it is a vanilla bug

#

anotha update

Version 2.0.9 (Beta)

  • Reintroduced the async player targeting patch with changes to ensure that enemies don't instantly give up the chase when first checking if a player is accessible.
#

this is a general patch once again, so lemme know if enemies that chase the closest player behave strangely

#

in theory, centipedes should no longer run away from you after you trigger them (they chased me in my testing), since I have made it so that it does player targeting synchronously if the last asynchronous result is stale

ashen harbor
#

I'm just glad the past few updates have been pretty stable, hopefully that means you can finally bring it out of beta soon

keen ruin
#

yeah I'm thinking that if there are no issues with enemies getting stuck or anything in this version I will bring it to stable and then start another minor release in beta

#

but I'll have to have a look at all the enemies to see which ones are the worst with the roaming and targeting already patched

#

feel free to suggest ones to look into

wanton salmon
#

Or if it's turning back and forth it might be something with pathfinding.

ashen harbor
keen ruin
#

oh "while moving" as in it was actually going somewhere?

ashen harbor
keen ruin
#

ohh okay, that's interesting

#

I'll have to see if I can repro anything like that in LAN I suppose

wanton salmon
worn steppe
#

Hey it seems Pathfinding really hates surfaced creatures

#

Mantis shrimp and Horseshoot crab are throwing lots of asynchronous path stuff in the console

green gust
#

Send your logs

worn steppe
#

Ill do when I close the game, just a min

green gust
#

Okay

worn steppe
#

I only noticed it towards the end, as I was going to moons where I had already set them to spawn in

#

Just noticed it also applies to Cancerous Rodent

keen ruin
#

will have a look

#

but also

#
[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
LC_Optim.Plugin.Debug (System.Object data, BepInEx.Logging.LogLevel logLevel) (at <73e44b71e2f746e5b02fc24470b69417>:IL_000C)
LC_Optim.Plugin.RemoveLagCentipede (CentipedeAI __instance) (at <73e44b71e2f746e5b02fc24470b69417>:IL_004D)
(wrapper dynamic-method) CentipedeAI.DMD<CentipedeAI::DoAIInterval>(CentipedeAI)
(wrapper dynamic-method) EnemyAI.DMD<EnemyAI::Update>(EnemyAI)
(wrapper dynamic-method) CentipedeAI.DMD<CentipedeAI::Update>(CentipedeAI)
#

ewwww

#

that mod is so unbelievably outdated the beta makes it doubly obsolete

#

oh you're talking about the debug log

#

it's not really that PathfindingLagFix dislikes those enemies, although I certainly wouldn't have expected them to be running target checks infrequently enough that that message spams

#

that is definitely a bit curious