#Pathfinder

1 messages · Page 1 of 1 (latest)

rustic socket
#

and since you already went for performance: did you checked at some chance what happens with 1000+ npcs?

wanton pine
#

200 yes

#

with just the default pathfinder

#

Is there a way to specify a max failure rate with pathfinder strategies?

#

EG if pathfindnig isValid returns false x amount of times in a row instantly complete to pathfinding goal?

wanton pine
#

weird

#

it must be set to like 2k failure or something

#

odd

#

mine will indeiniftly run

#

indefinitly*

#

ignore the bug it should be able to drop one block distances just need to debug

#

but when i go to a unreachable path it indefinatly pathfinds

#

to the point of crashing the server

Though i am logging these points, they returns nearly thousands of lines of logs

#

lol disc wont let me upload logfile

#

93mb log file

#

uploading it now

#

now ofc its returning false due to user error, but there is times where this pathfind could become infinite with anything other than isPassable

EG if said npc falls into a pit

#

these paths are less than 20-40 blocks from the player

#

since im hard forking ill manually change that code to my liking

It appears the code just sets a max points

Im talking about everytime isValid is false, have a set number of max times it can return false in a row and it it fails pathfinding to many times in a row (In any case a specific isValid call on a node shouldnt return false more than 4-12 times)

#

what i think is happening rn is its allowing as many isValid false calls as the maxDepth variable, ide rather exit the pathfindiner earlier rather than waste processing power trying to isValid a method thats returned false 12 times already

#

im gonna play with this some more tho and actuall get the pathfinder non bugging before i play with this tho

#

i almost have the pathfinding right first time through too Eyes

#

lol i know why it doesnt like one block ledges

#

im not storing the clones location after use so its always the same block 💀

rustic socket
wanton pine
#

well the issue is if every next node is false

rustic socket
#

x is false, so i try y! huh, y false, so i try x!

wanton pine
#

sec

#

i can kind of show an example

rustic socket
#

ah ok, well then we probably have to cache failed nodes internally

#

to fail fast if there is no possible node anymore

#

but that could fuck up some paths

#

since what if a failed node is later available from another perspective

wanton pine
#

so if max value is not set, itll run unlimited

#

so you dont interefere with those issues

rustic socket
#

i already thought of some kind of PathingSettings or whatever

wanton pine
#

yeah that would be rly helpful

rustic socket
#

a value object you can instantiate factorial

#

then we could also leave the max depth to the user

wanton pine
#

yeah that would also be pog

#

i think max depth currently is nice tho

#

however i think rn its interfering slightly with my current strategy but

rustic socket
#

well we can leave the current one as default

wanton pine
#

my current strategies fucked lol

#

im gonna try urs rn

rustic socket
#

some kind of ruleset

wanton pine
#

agggg

rustic socket
#

but i started to overengenieer it and quit it

wanton pine
#

your does same thing mines does

wanton pine
#

cant seem to get the pathfinding to avoid cliff-lakes

#

on both your strategy and mine

#

ill prolly figure this out eventually

rustic socket
#

probably because water is passable

wanton pine
#

mine does direct checks for it

rustic socket
#

what about normal cliffs

wanton pine
#

weird

#

yours doesnt like to go here hahaha

#

hes scared of ledges

#

wont go a mile within them

rustic socket
#

wait a sec

#

what if you place a block below it

wanton pine
#

hmm

rustic socket
#

because somehow mine is checking for 4 blocks

wanton pine
#

it doesnt like mountains either

rustic socket
#

well its fucked

#

i will just screw it over

wanton pine
rustic socket
#

and redo it at some point

wanton pine
#

ill see what i can get working i think mine will follow this path

#

he just cant avoid cliff-lakes

rustic socket
#

yeah maybe yours will work, then you could PR it

wanton pine
#

thats current method im trying rn

#

its ran on the current block

#

gonna do a few more tests

#

basically my thinking is, if the under block is water cancel completely (I want him to avoid lakes)

But also if the under block is air allow it 4 times while also checking for air

#

ohhh you know what i should probably

#

return true if any of them is solid in between that time

#

i think thats why hes so fucky

rustic socket
#

that could also be the issue of mine

#

because i check if the current isPassable

#

there i got confused which one is the current

wanton pine
#

Im doing 2 checks actually for the current after its detected for isCLiff

rustic socket
#

or i am right on that

#

i have no clue

wanton pine
#

next check is if the current block has air above

#

i should check isPassable ngl

#

ahh

#

it allows air

#

well

#

kinda has to ig

#

im dum lol

true compass
#

I donnt like entities

wanton pine
#

oh god

rustic socket
#

nothing about entities

true compass
#

they always explode or shoot arrows or make weird chicken noises

rustic socket
wanton pine
#

this would be cracked with entity pathfinding too

#

like you can get entities while pathfinding

#

jesus that would be cracked

true compass
#

huh wait

true compass
#

but all the videos you sent used entities

wanton pine
#

if (entityIsOnCurrentPath) return notValid

#

so u can like pathfind around entities

#

but

rustic socket
wanton pine
#

thats a looooot of work

#

cause getting entities async is a no go

#

could cache locations but theyde need updating every x ticks for theyre locations

#

time to test new modifications

true compass
#

is there any javadocs or similar? I currently have no idea how this thing works or where its explained

wanton pine
wanton pine
#

so you just call a method and go

rustic socket
#

but pretty much outdated

#

we need to rebuild those on the next release

rustic socket
wanton pine
#

maybe im doing something wrong hm

true compass
#

this is not very helpful lmao

rustic socket
wanton pine
true compass
#

all I can do is to click on the file name

wanton pine
wanton pine
#

click on any .html page

rustic socket
wanton pine
true compass
wanton pine
#

lol

#

xD

true compass
#

ugh

#

nah

wanton pine
#

cant do it on the site

#

they need to setup the repo to accept it like that

#

its ez to do

true compass
#

I won't use that if I have to go through 300 extra steps D:

wanton pine
#

its rly easy to use i promise

wanton pine
#
PatheticMapper.newInstance().findPathAsync(start, finish)
#

findPathAsync is a CompletableFuture

#

thats the basic usage but you can override the path strategy

rustic socket
#

^and also the pathfinder api is about to be optimized a lot

#

to get rid of the static concept but keep the simplyness

wanton pine
#

PathLocation to bukkit Location

#

forgot its name

rustic socket
#

BukkitMapper

wanton pine
#

ah i was using PatheticMapper oop

#

aids code

#

but itl do

#

UH

#

LMFAAAAOOO

#

BWAHAHA

#

i cant

#

bro im dead

true compass
#

can this thing also find paths e.g. through a maze or similar?

wanton pine
#

yes

true compass
#

nice

wanton pine
#

easily through mazes

#

with the default one

#

well

#

it avoided cliff-lakes

#

lmfao

#

wonder why tf its plotting the points like that

#

weird af

#

i think imma do particle instead

#

less intrusive

rustic socket
#

hopefully its pathfinding looks like a tentacle wriggling around

wanton pine
#

xD

#

im not sure why its pathfinding all its points on the same y axis

#

its like the pathfindiner cant jump when using a custom strategy

#

fucking christ

#

what particle would like

#

actually be not aids to show

#

OH CIPHER LOL

#

THATS YOURS LMFAAAOOO

#

I WAS CHANGING CODE ON MINE AND STILL USING YOUR STRATEGY LMFAO

#

bahahaha

rustic socket
rustic socket
rustic socket
wanton pine
#

just crashed my server oops

#

i jumped over a gap

#

and it spawne dlike 20 million particles lol

wanton pine
#

true

#

ill remove that check then

rustic socket
#

that wont do much probably

rustic socket
#

you will have to validate the jumps

#

also im gonna get me some food so brb

wanton pine
#

time to test

pure holly
wanton pine
#

kk enjoy food

pure holly
#

they are deployed, but over http for some reason idk about

wanton pine
#

AYO

#

IT WORKS

pure holly
#

i wish i had a laptop - would be coding while on holiday

#

i did pre order a 12th gen framework, but not here

wanton pine
#

no it doesnt kek

#

oooo

#

12the gen

pure holly
#

what am i looking at lol

wanton pine
#

im trying to make isValid not make npcs run over ledges

#

but for some reason its fucking with things like this

pure holly
#

i mean, surely just checking the type below current should work.

wanton pine
#

so type below current does need to be solid

#

smh cipher

true compass
#

just a small thing - you might wanna use javax annotations instead. the jetbrains annotations produce "double annotations" in javadocs D:

pure holly
#

wtf jetbrains

#

anyways i think they are the lombok ones

wanton pine
#

okay tim to retest Eyes

pure holly
#

god is lomboksexual

true compass
#

those definitely work fine

wanton pine
#

oh ffs

#

he fell in the damn hole

pure holly
#

lombok has no “NotNull”

wanton pine
#

laugh at the idiot

true compass
#

lombok has Nonnull

pure holly
#

sorry i mean Nullable

#

it’s just implied

true compass
#

oh yeah because it wouldnt do anything

pure holly
#

which i hate

rustic socket
#

but the ones above current needs to be passable

wanton pine
#

seems to work fine now

#

but

#

he still walks over ledge 🤔

#

he did try though

#

so hes a good boy ig

#

A for effort

#

smh im an idiot

#

my for loop math is off

#

so value never reaches 4 i think

#

fucking christ

#

close much?

pure holly
#

for sure

wanton pine
#

ffs

#

i wish debugging this didnt crash my server and client

#

it cant handle all the sysout calls

true compass
#

how are you creating the NPCs? some library or just packets and stuff?

wanton pine
#

Citizens2

#

But

true compass
#

oooh whutt

#

that still exists?!

wanton pine
#

its mainly NMS stuff

#

ofc

true compass
#

I used that like 8 years ago

#

nice

#

I thought it had died

wanton pine
#

owners even helped me impl this to theyre navigator controls

#

naaah

#

im only using citizens tho

#

cause it makes basic things easy

#

like spawning npcs in and whatnot

#

hmmm

#

interesting

#

i actually think citizens navigators making the npcs go off course

rustic socket
#

so conclusion: dont use citiziens navigator, use our pathfinder

pure holly
#

lol

wanton pine
#

the actual navigator

#

the thing that makes npc take steps

rustic socket
#

just teleport the npc

wanton pine
#

Theyre navigators are controlled by a PathfindingStrategy

rustic socket
#

problem solved

wanton pine
#

tps go brrt

#

it sucks mc removed the navigator from HumanEntity

#

shame

#

i likely could get rid of citizens completely without it

#

it had the path right

#

for one second

#

then decided to follow a invalid path

rustic socket
#

it was like "nope"

#

"oh water"

wanton pine
#

it did too

#

it was gonna walk around

#

then just

#

HARD LEFT

pure holly
#

i thought he was using both ahaha

wanton pine
#

both what?

#

im honestly convinced this is bugged somehow

#

like it calculated te right path one time then just completely disreguards the ruleset

wanton pine
# wanton pine

i think for some reason, the pathfinder its backtracking backwards instead of trying to always go forward

Its weird to me the particle locations start going away from its desti like how they are i nthe video

pure holly
#

maybe… weird idk

wanton pine
#

but second i throw and left or right action he just ignored pathfinding strategy

#

i locked his movement to the center of blocs hes navigating to

#

wait wtf

#

why is the location for adding block adding a + sign of nodes

#

and not just the line

#

you know what imma do something dirty

wanton pine
#

only issue is...

#

im having to revalidate locations after pathetic gets them

#

all those ERRRROOORRR are main thread calls...

true compass
#

what do those hearts even mean lol

wanton pine
true compass
#

but why is everything full of hearts

wanton pine
#

i think its some bug when a path cant be found

true compass
#

doesn't really look like a proper path

wanton pine
#

and it fulls out all available deeps

#

yeah

#

its not cancelling after x consecutive fails

#

so it just keeps looking

#

until it reaches deep limit

true compass
#

ah ok

wanton pine
#

ill prolly add in my own limits here in a bit but the main thing is just getting it working without some jank shit

#

i may need to get the NPC to jump when near certain locations

#

i think i got the actual path good now

#

but

#

he still can rarely fall off the corners

#

thats likely just mc thing tho

#

i may get the block facings and see if any nearby are air

#

if any are jump

pure holly
wanton pine
#

that are added

pure holly
#

ermmm

#

wtf

wanton pine
#

ikr

#

also

#

the isValid isnt respecting certain checks, certain false values do get through

#

running this on the Location the NPC is currently pathfinding will occasionally return a false invalid path

#

this is the method isValid use

#

essentially the same thing

pure holly
#

it’s hard to know for sure, maybe a bug from me, maybe a bug in your strategy.

wanton pine
#

yeah will likely need more playing around when your off vaca

#

unless cipher wants to try kek

rustic socket
#

nope

wanton pine
#

but for rn this is semi working

#

HAHA

#

i think im gonna make a method that checks if NPC falls into a pit and or is stuck in a location

#

and random tp it n*5 blocks away

pure holly
wanton pine
#

and pathfind again

wanton pine
#

i did value of 5 normally

#

max + 1

#

im gonna work on making a stuck finder

pure holly
wanton pine
#

LOL

#

get him mock bukkit

#

then he'll test

rustic socket
#

since the entire api is very abstract from bukkit we dont even need mockbukkit

#

we can just test the model like this

pure holly
#

so, the issue is that sometimes it doesn’t find a valid path? or is it that it’s a cross shape

wanton pine
#

steps:

wanton pine
wanton pine
# wanton pine

then, once paths is cached, while runing through i run the same check via this method

#

and its will return true on 1-2 blocks

#

ill get a video

pure holly
#

can you loop through a found path and set all the locations to like blue glass. just so i can see for sure that this cross thing is happening as well

wanton pine
#

it fucks with the NPCs current path cause its a slid block

#

and it does whack shit

#

not to mention

rustic socket
#

just send a blockchange to the player

wanton pine
wanton pine
#

packets

rustic socket
#

no

#

its a spigot method

#

on player

wanton pine
#

fr?

wanton pine
#

one sec

#

almost done

#

cant even walk

#

it just adds soooo many points

#

Ignore my add() call i remove the y + 1

#

cant reliably get to my location to pathfine kek

#

ima try

#

another way

#

one sec, doing it on result path

pure holly
#

hmm something is fucked up here. hard to tell why it would do that cause it only explores one node at a time and a lot of those would overlap

pure holly
wanton pine
#

mb

pure holly
#

of course a tonne are evaluated

#

yeah

#

you should be doing that

wanton pine
#

cipher

pure holly
#

i didn’t look at the code but the callback should be a line

wanton pine
#

god this is so hard to do lmfao

#

blocks just keep shoving me everywhere

#

y - 1 again hard to see

#

one sec

pure holly
#

ok but it is a line

#

so i’m happy that I didn’t fuck up

#

now we just gotta fix your fuckup KEKW

#

so basically the isValid check gets called for the next most optimal node. it has no order other than the one determined by the heuristic

wanton pine
pure holly
#

the parent and parent of that will be the ones before it in the final path

wanton pine
#

cause its the one im checking

true compass
#

packets?

wanton pine
pure holly
#

an error

wanton pine
#

nah none

true compass
#

but then I saw that someone already sent the method

wanton pine
#

let me try getting the npc to fail again

pure holly
#

it is async so it’s likely the stacktrace is just suppressed

wanton pine
#

i think ik the issue

pure holly
#

might be the weird chunk issue we were having idk

wanton pine
#

see how hes like halfway on/on the block

#

i think pathetic thinks hes on the block over the air

#

and my strategy doesnt like that

rustic socket
wanton pine
#

so i think thats the issue there, i wont worry about it for now

pure holly
#

maybe not sure

wanton pine
#

the path looks right tbh

#

but im not sure

#

maybe NPC is slightly fucking up the path when walking

#

but i set his destination to .5 of each block

#

maybe

#

i should make him go +1 away from any ledges

#

somehow

#

alr

#

?tryandsee sunglas

#

OH

#

SHIT

#

@rustic socket @pure holly 😮

#

he doesnt like 1x1 bridges

#

but that can get added as a check

#

you know what i gotta do now?

#

spawn in 50

#

okay

#

its rly resource intensive

#

expected tho (Its not main thread hanging, its just the pathfinding result takes so long to come back the npcs dont have a navigation goal)

#

path they follow, ignore missing ones its just spigot trying to handle a few hundred block updates a second lol

Seems so randomly they do like to go right next to the ledge as shown by arrows, likely user error

rustic socket
#

for your further testing

wanton pine
#

oh hell yes

#

ty

#

ill merge with my fork tmrw thanks a bunch

#

ill PR my strategy once its decently optimized

#

i feel i can get it better

rustic socket
#

take your time, i might change the strategy api a bit as well

wanton pine
#

shouldnt need much changing

rustic socket
#

once im chaning the pathfinder stuff

wanton pine
#

only need the current PathBlock

#

prev and prevver arent used for this

rustic socket
#

yeah im thinking about removing those

#

if you want to have the previous blocks just cache them or somewhat

#

also we currently have internally a strategyregistry which will probably be removed to also make stuff like this possible

wanton pine
#

i would much rather

#

findPathAsync(start, finish, (currentBlock) -> {

});

#

if it was instance base i could do it like dat :((

#

but it takes a Class<?> of the FunctionalInterface

rustic socket
#

yeah that would be possible then

wanton pine
wanton pine
#

i was gonna transform it myself but saw that and said nah im good

#

ill do it class way for now xD

rustic socket
#

yeah i we wanted to avoid throwaway objects

#

i mean it works

#

and probably saves some ns

#

but for what

#

in your case it probably saves a bunch of throwaway objects

wanton pine
#

yeah but prevent me from using thing slike a cache on the class, since its a global class instance and not per pathfind

#

hence why i felt like i was forced to use statics for some things

#

initialization of the strategy class shouldnt be much i think

#

its just the method call that matters

#

off to bed now

im not sleeping tmrw until this runs with 50 npcs

pure holly
#

lol

#

dedication

pure holly
#

Pathetic State of development:

rustic socket
true compass
#

accurate

wanton pine
wanton pine
#

man

#

not even sure how i can optimize this without transforming then entirety of pathetics impl xD

wanton pine
#

oli does pathetic mark sand as air 🤔

#

when its hovering like this

#

and these ^

#

i think ik the issue i think pathfinders liquid check only checks for full liquids maybe?

wanton pine
#

"Im gonna optimize tf out of this today"

wanton pine
#

one fell because he got pushed by the other i beileve

#

him getting stuck at the end is my fault

wanton pine
pure holly
#

wait nvm it doesn’t matter

#

lemme find where it does the logic

#

but like afaik they are just solid sand blocks

wanton pine
#

i think i got them mostly fixed

#

mostly

#

im working on redoing all my controller methods to the new one

pure holly
wanton pine
#

only thing is i had to modify citizens

#

Wanna know something funny

#

pathfinder is fine

#

its citizens handling of moving player npcs

#

take the wildest guess on how they move them

pure holly
#

teleport? no clue

#

idrk what you mean

wanton pine
#

so

#

there a mojang property in EntityPlayers called zza

Which is the velocity

#

so

#

they face the player at the location

#

and whoosh

#

lil shove

pure holly
#

i mean, ugh, it works ig

wanton pine
#

its aids

#

i had to edit the code to make the path finder stop shoving until it actually reached destination

#

because this pathfinder is block by block

#

so it only needs the one shove lmao

#

citizens shoved on tick

#

so it led to the npc going cattywhoncus like yesterdays videos lol

#

i think imma fork citizens and strip it and then change it to use packets to move the entity

#

i heard that might be better

wanton pine
#

AYY

#

BIG HELP

#

i need to refork my project

rustic socket
#

watch the commit history

#

made some more changes

wanton pine
#

I think imma do some hacky stuff instead of using citizens

#

Imma try doing some tricky packet stuff, that makes it so the entity isnt really on the server

#

but plays to all clients

#

gonna try and ditch citizens

#

becoming a headache with the two atm xD

wanton pine
#

private static void showAll(Npc npc) {

    ClientboundPlayerInfoPacket playerInfoAdd = new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, npc);
    ClientboundAddPlayerPacket playerSpawn = new ClientboundAddPlayerPacket(npc);
    ClientboundRotateHeadPacket headRotation = new ClientboundRotateHeadPacket(npc, (byte) ((npc.getYHeadRot() * 256f) / 360f)); // 
    ClientboundPlayerInfoPacket playerInfoRemove = new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.REMOVE_PLAYER);

    for (Player player : Bukkit.getOnlinePlayers()) {
        ServerGamePacketListenerImpl connection = ((ServerPlayer) NMSUtils.getServerPlayer(player)).connection;
        connection.send(playerInfoAdd);        // Inform client this Entity exists.
        connection.send(playerSpawn);    // Spawn this entity on the client.
        connection.send(headRotation);
        connection.send(playerInfoRemove);    // Remove from servers tab list
    }
}
#

slapping this here

#

as tmy peronal pastebin

wanton pine
#

I think 4096 is one block

#

saving for my notes

#

this channels my notepad now

rustic socket
#

i'll grief your notepad

#

lululu

#

alalala

#

leleleel

wanton pine
#

got most of that working

#

spam grief wont matter now <:)

rustic socket
#

closes the thread

wanton pine
#

tmrw i should have Pathetic re-implemented to client based entities

#

noo

#

ngl

rustic socket
wanton pine
#

tmrw

#

cause

#

im like 99% sure

#

i can send packets async

#

i think?

#

if i can send packets async, the entire NPC lib can be async

#

and when the new jdk comes out with virtual threads

#

mm

rustic socket
wanton pine
#

pog

#

then entire thing can be async thats nuts

#

i may do a Thread per npc

rustic socket
#

pc: explodes

wanton pine
#

more like contabos data center

rustic socket
#

so you are the reason my contabo server lags

wanton pine
#

LMAO

#

yes its screams 600% on its ptero container most hours of the day

#

rn it gets a break

#

no pathfinding running on it rn

pure holly
#

jokes mine runs like a few things and my school coursework but other than that it’s kinda wasted lmfao

rustic socket
#

@wanton pine where would you expect the settings you can pass into the pathfinder?

#

model or api

#

or both as the current design?

#

or the actual value object in api and the builder in model? both in api?

wanton pine
#

a builder for it, would expect settings there

#

like GSON

#

new GsonBuilder().setPresttyPrinting(true).build();

rustic socket
#

in the model or api module

pure holly
#

probably api @rustic socket

#

it seems like something that would need to be accessed easily by everyone

#
  • it controls the usage of the API
rustic socket
pure holly
#

i mean there is realistically just gonna be like a boolean and a few ints or something. just chuck it all in API

wanton pine
#

Builder methods prolly best way ngl, easily change settings

#

gonna try a new NPC lib out today, will be back with vids later

wanton pine
#

@pure holly Im really sorry to like ever consider this but

Would collisions ever, by chance be an option added into the algorithm Eyes

#

not rn ofc, but in the future

wanton pine
#

EG make pathetic take in a BoundingBox and test, or have a isValid method for the said bounding box?

#

Or taking a AABB

#

that way it can pathfind precise floating points?

#

ill show you an example

#

actually not sure if the floating point here is pathetic or not, but the NPCs destination is right on the money for the floating point

pure holly
#

Bounding Box? The library finds a blockwise path. can you not test that yourself in the Strategy?

wanton pine
#

I could but, math kekw

#

was about to bitch i also cant pass the AABB to the isValid

#

but forgot cipher changed that

pure holly
wanton pine
#

i think im gonna try looking into calculating the AABB positions instead

#

and do it properly, i just am horrid at math lmfao

wanton pine
#

okay

#

i got another packet based NPC lib to work rly well with this actually

wanton pine
#

WHO PINED
ME

pure holly
#

not me shah

#

but epic

wanton pine
#

im gonna try and make a citizens PR bop

wanton pine
#

now i just need to make isValid lock to the ground when needed

#

ik i posted like 30 "This is perfect videos"

#

but, this one is it

#

ill be able to do absolutely everything async this way Eyes

pure holly
#

internally in pathetic iirc

wanton pine
#

weird, before the locations it was pathfinding to were all fucky

#

and off to the side

pure holly
#

meh idk

rustic socket
pure holly
#

ahh ok

wanton pine
#

Is there a way i can get the paths like this

#

instead of this?

pure holly
#

yep, just add a couple of vectors in PathfinderImpl

#

which move on corners as well

#

ie
new PathVector(1, 0, 1);

#

4

#

@wanton pine

wanton pine
#

the corners are already added

#

i need them removed haha xD

wanton pine
# wanton pine

basically from default to my own all pathfind diagnoly like this

pure holly
#

ok so instead of add, i meant replace

#

and the corners aren’t already added btw

#

it’s just connected to the next one

wanton pine
#

ohh

#

only thing is, is detecting when the path goes zig zag

#

ill try and figure smthn out

I wonder if something on isValid can be done

pure holly
#

? wadd you talking about lol

wanton pine
#

actually removing the vector wouldnt be that hard but detecting when the path curves is the tricky part

pure holly
#

just change the vectors

#

i feel like there is a deeper problem idk about lul

wanton pine
#

im not gonna know those vectors tho

#

if a path is like that for example

#

i could manually go through the List of vectors and do a bunch of complex cehcks on each iteration

#

but feels nasty

pure holly
#

I literally have no clue what you are on about. the list of vectors is the possible directions the neighbours can be in relative to the current

#

so change them to the diagonals as well and it will choose them as it will be heuristically cheaper

wanton pine
#

its impossible (near impossible) to tell when the zig zag starts and ends

pure holly
#

well, you would probably have to override the heuristic to just idealise a path that deviates from the straight line from start to finish the least

#

iirc i calculate the perpendicular distance from the optimal somewhere

#

here i think

#

it’s some cringe vector math i learnt in FM class at school

wanton pine
#

just rough to do because the first curve is an ideal path, but the zig zags is weird when the npc navigates

#

okay ill take a look

#

it shouldnt be relatively doo hard to do

#

just need to allow it to pathfind without adjacent blocks it all

#

but still in 1 block distance increments

#

would still be in 1, 0, 1 increments for pathfinding, and be a more direct path too

#

ill check src, see what i can do

#

i imagine there some simple rule for picking the next block where it must be adjacent or within one block

#

oh

#

its something i can do in isValid

#

i just need to make it so if the next block;s x/z have changed relative so i know its a curve, and ignore the neighbors that are adjacent