#Find nearest hidden position from player

1 messages · Page 1 of 1 (latest)

glass gazelle
#

Hiya. I'm trying to create a function that places a "hunter" in a position hidden from the player, as close as possible (so, around a corner etc..) however I am stumped on ways to do it quickly.
I have got it done in a functional matter, but in a live scenario it updates quite slow due to having using pathfinding to check if it's an accessible location. Any alternative ideas?

See the attached photos as example.

Green is points of which are hidden from the player, and the hunter should spawn/go to, to be hidden and its accessible to the player.

fossil heron
#

use nodegraph instead

#

basically it's the same as what you got already except substantially lower resolution

#

and often not a perfect grid

glass gazelle
#

i'd thought of using pre done nodes but they dont update if the map is changing
or is there really no perfect solution, other than precalculated?

fossil heron
#

but eh you could probably get the same result by using lower resolution too

#

could also do some meshing yourself similar to visleaf

#

baked of course

glass gazelle
#

theres no way of interacting with robloxs' navmesh is there

#

other than pfs compute?

fossil heron
#

indeed

#

would be nice if there were then we could use it for things like this

glass gazelle
#

yeah

fossil heron
#

but nooooooooooope have to roll your own solution

glass gazelle
#

thats annoying

#

yeh bahaha

#

it was only recently they redid pfs wasnt it, else it was the same algorithim since 2008?

fossil heron
#

navmesh generators are difficult to make and what you already have is only the first step

glass gazelle
#

yeah certainly which is irritating

glass gazelle
# fossil heron use nodegraph instead

is there any efficent enough method of making this dynamic in some regard? i.e if someone changes the map in a live game, it can recompute that specific area?

i can't particularly think of something like this easily but maybe you know better?

fossil heron
#

idk i haven't made a navmesh generator before, probably

#

its still going to take time tho

glass gazelle
#

ehh yeh gottcha