#(Hexivoid) Target Priorities

143 messages · Page 1 of 1 (latest)

solid marten
#

Is it possible to set the priorities of targets to have one take preference when multiple are within range?

frail cairnBOT
#

(Hexivoid) Target Priorities

frail cairnBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>

solid marten
#

Is there a target change event I could listen to, compare targets, and cancel?

red hedge
#

SentinelChaseNewTargetEvent

#

a native target priority system would be nice-to-have for sure, but complicated to implement cleanly

#

would require essentially a total redesign of the current target listing tooling

#

it's currently a very nonlinear check to try to take advantage of every performance opti it can, since the target check methods are called very often

#

Implementing a proper priority system would require not only breaking that opti, but also calling the target checks more often to try to select the "best" target rather than just a target

solid marten
#

Would my best solution be to then temporarily remove lower priority targets when a target is set/chase is started and add them back afterward?

#

Also is there something wrong with the Citizens jd?

red hedge
#

I believe if you just chase(your preferred target here) that should suffice on its own, Sentinel generally should retain its current chased target until it loses it

#

with the exception of targets-of-opportunity

red hedge
solid marten
#

I think so? 0.o

red hedge
#

ohhh yeah i see why too

#

error with javadoc from the new Citizens build, ima go poke fullwall in our dev channel about it

solid marten
#

Can you link me to the code/conditions that ends a chase?

#

I assume no possible path, distance out of range, entity no longer exists...

#

Anything else?

red hedge
#

There isn't a formal list also a lot of the causes are indirect

#

Anything that makes a target not a target anymore counts

#

say for example a player goes into gamemode creative

#

there isn't an explicit, if current target is creative, end chase - it's more abstracted than that

#

also worth noting that Sentinel config options are relevant

#

eg with some settings enabled, the target being on the other side of a wall can be enough to break the chase (because the NPC doesn't know where to go because it can't see where the target went)

solid marten
#

Does setting chase set Citizens' navigator target?

#

You were talking about .chasing, right?

red hedge
#

sentinel.attackHelper.chase(xxx) does update the navigator immediately yes

#

no use the method not the raw field

solid marten
#

I really need a search bar in the javadoc 😭

red hedge
#

Lemme actually document that fact on those fields

#

yeah ;-;

#

There's something weird with the way the jenkins is generating javadocs

solid marten
#

Is there a way you can dump them and I can self-host?

red hedge
#

cause it's borked to make the jd. subdomain work

#

you could build it locally lol

solid marten
#

Oh the src contains descriptions and all?

red hedge
#

in theory Sentinel compile should Just Work ™️ when you run it on maven

#

Err, Javadocs are generated from source code documentation

solid marten
#

^^ Might be able to tell I have little to no experience with javadocs 😂

red hedge
#

this lil comment block atop attack is the javadoc for that

solid marten
#

Well you just taught me more about documentation than my intro to Java college class I paid $3k for did all that time ago

red hedge
#

sgdkgsd

#

yeah college classes don't really teach much actual info

#

Some people think it's worthwhile for interpersonal networking and all

#

but learning? On a modern evolving field? lolno

solid marten
#

Took two years of fillers about "theory" and "logic" for them to start teaching info that'll get me an internship

solid marten
#

If my Sentinel has a squad target how does it treat multiple NPCs of that squad within its range?

#

Does it focus on the closest?

#

Or actually maintain chasing whichever the current individual NPC was?

red hedge
#

closest is favored, unless a pre-existing target is already selected and still reachable.

solid marten
#

Is there a way to stop/disable NPCs from speeding up (sprinting) once they start chasing?

#

Also mind pinging me once the jd's back? 🙂

solid marten
#

No change 😕

red hedge
#

that's the only field read that can increase an NPC's speed in Sentinel

#

unless there's a bug with Citizens speed internally again

#

(if you're on an ancient minecraft version, idk)

solid marten
#

Oops, was trying to set Citizens' speed insyead of Sentinel's

#

Works now

#

(Don't tell anyone I made that mistake)

#

Why is Citizens' default speed 1.5?

red hedge
#

Sentinel's default speed is 1.5

#

Citizens is 1

solid marten
#

o

red hedge
#

1 is walking speed, 1.5 is sprinting

solid marten
#

🤔

red hedge
#

Sentinel defaults to 1.5 because sprinting is usually desired behavior when in combat

solid marten
#

So what else does Citizens' speedModifier modify?

#

Other than .speed?

red hedge
#

what

solid marten
#

I mean what's the point of having speedModifier when you have speed?

#

Disregarding Sentinel

red hedge
#

The Citizens navigator speed value is an internal value, and speedModifier is the normal value

#

do not ever touch Citizens speed unless you have a very good reason to

solid marten
red hedge
#

yes

solid marten
#

Is it possible to make Sentinels start chasing NPCs when they appear within its range?

#

Or is targeting only initiated once they come within eyesight?

solid marten
red hedge
#

if you mean to include targets behind walls, enable ignoreLOS (API only)

solid marten
#

When does Sentinel check for targets?

#

I assume this is when tryAttack is run but I can't find what triggers it

#

I doubt it's periodic?

red hedge
#

ittt's periodic yes

solid marten
red hedge
#

minecraft doesn't really provide a decent way to optimize over that

solid marten
#

Oh is it indeed that?

red hedge
#

ye

#

by default once every ten ticks

solid marten
#

Called every tick

red hedge
#

tickRate defaults to 10

#

this btw is one of the reasons target matching is performance sensitive

solid marten
#

If I increase this would I theoretically see a change in performance?

#

Oh you're answering my questions before I get a chance to ask them 😅

red hedge
#

edit your config.yml if you want to try that

#

you can, but, yknow, measure first, and only touch it if it matters

#

note that it will have side effects - higher tick rate means slower updates means NPCs are slower to respond to changes

solid marten
#

Oh that's literally a config option that I missed

#

That's convenient

red hedge
#

i can tell you from most experience thus far, Sentinel is well-optimized enough that the code in Sentinel doesn't hit as bad as the code in Citizens does

#

by which I mean - searching for targets takes a smaller % of CPU time than things like pathfinding towards the target once it's found

#

pathfinder is the biggest challenge with performance in Citizens stuff

solid marten
#

What does Citizen's "new pathfinder" do differently that leads to such a decrease in performance?

#

I've noticed an obvious TPS decrease/lag pause when testing with a substantial amount of NPCs

red hedge
#

The naming is weird

#

the non-new-pathfinder is Minecraft's vanilla built in entity pathfinding

solid marten
#

Is one of them just MC's default paathfinder?

#

Literally ninja'ing each of my messages

red hedge
#

the "new" pathfinder is just a (relatively) straightforward A* impl with some customization options

#

the default options are a bit harsh on perf but you can tweak them in the Citizens config

solid marten
#

Is the new pathfinder's primary change that it could path in straight lines?

red hedge
#

there's a hidden pathfinder option that's still in-the-works that uses multithreading n wotnot to try to make an actually high-performance option

solid marten
#

Doesn't have to move diagonally one block at a time?

#

That's the only change I've visually noticed

red hedge
#

Broadly, the "new" one is just better at pathfinding than vanilla's, but at the cost of perf

#

and way more customizable

solid marten
#

Seems the new one can't handle a lot of corners though

red hedge
#

try pathing an NPC up stairs, or near slabs or carpet, or etc. Vanilla struggles with seemingly simple cases of non-cubic block types

#

"new" can also climb ladders and open doors and stuff

solid marten
#

Vanilla handles it fine

#

Any option I can configure?

red hedge
#

that looks like it's struggling with corners rather than with slabs

#

either way should post in #1027028179908558918

#

not related to Sentinel, and fullwall can give better input on how to configure that well

#

and possibly can fix that corner bug