maps
Bakes walkable maps from the level's colliders (one `physics.raycastAll` per column, every floor kept, slope and headroom checked, terrain read by its drawn mesh where no collider answers) and answers path queries through the engine's pathfinding package: grid maps run on `Pathfi…
navKit.maps
Bakes walkable maps from the level's colliders (one physics.raycastAll per column, every floor kept, slope and headroom checked, terrain read by its drawn mesh where no collider answers) and answers path queries through the engine's pathfinding package: grid maps run on Pathfinding.gridGraph, waypoint maps on Pathfinding.waypointGraph, multi-level maps on navKit's own graph that implements the package's graph interface. Also holds the obstacle boxes (engine cost zones with an infinite cost) and the map registry. Used by navKit.api, the crowd and the debug view.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2navKit.maps - bakes a walkable map from the level's colliders (and terrain) and answers path queries on it through the engine's pathfinding package. local Maps = require("navKit.maps") local map = Maps.bake({ kind = "grid", min = { -20, -1, -20 }, max = { 20, 8, 20 } }) local path = map:findPath({ 0, 0, 0 }, { 12, 0, 9 }, { radius = 0.4 }) One bake casts one ray down each column of cells and keeps every floor it meets (ground, balconies, upper storeys) whose slope and headroom fit an agent; neighbouring floors within a step height join. From that field: grid -> the engine's `Pathfinding.gridGraph` over the lowest floor waypoint -> the engine's `Pathfinding.waypointGraph`, points a few metres apart joined where a straight walk is clear layered -> a graph of navKit's own over every floor, implementing the pathfinding package's graph interface All three run the package's A*, its cost zones (`Pathfinding.addModifier`, which is also how navKit obstacles block cells) and its off-mesh links (`Pathfinding.addLink`, which navKit links register).
vec(p: any) → Vec
| arg | type | description |
|---|---|---|
| p | any |
noteChange(a: Vec, b: Vec, c: Vec?, d: Vec?) → void
| arg | type | description |
|---|---|---|
| a | Vec | |
| b | Vec | |
| c | Vec? | |
| d | Vec? |
setObstacle(key: string, mn: any, mx: any) → void
| arg | type | description |
|---|---|---|
| key | string | |
| mn | any | |
| mx | any |
removeObstacle(key: string) → boolean
| arg | type | description |
|---|---|---|
| key | string |
inObstacle(x: number, y: number, z: number, pad: number) → boolean
| arg | type | description |
|---|---|---|
| x | number | |
| y | number | |
| z | number | |
| pad | number |
segmentBlocked(a: Vec, b: Vec, pad: number) → boolean
Does the segment a->b (horizontal) pass through any obstacle box grown by pad?
| arg | type | description |
|---|---|---|
| a | Vec | |
| b | Vec | |
| pad | number |
boundsOf(o: BakeOpts) → void
| arg | type | description |
|---|---|---|
| o | BakeOpts |
autoBounds( ) → void
The box around every static collider in the world (and every terrain), capped at 400 m a side.
grow(id: string) → void
| arg | type | description |
|---|---|---|
| id | string |
cap(lo: number, hi: number) → void
| arg | type | description |
|---|---|---|
| lo | number | |
| hi | number |
excludeSet(o: BakeOpts) → void
| arg | type | description |
|---|---|---|
| o | BakeOpts |
add(id: any) → void
| arg | type | description |
|---|---|---|
| id | any |
terrainIds( ) → void
bake(opts: BakeOpts?) → any
| arg | type | description |
|---|---|---|
| opts | BakeOpts? |
register(map: any) → void
| arg | type | description |
|---|---|---|
| map | any |
remove(name: string) → boolean
| arg | type | description |
|---|---|---|
| name | string |
get(name: string?) → any
| arg | type | description |
|---|---|---|
| name | string? |
at(p: any) → any
The map whose box holds the point (the smallest one when several do).
| arg | type | description |
|---|---|---|
| p | any |
contains(p: any) → boolean
| arg | type | description |
|---|---|---|
| p | any |
column(x: number, z: number) → void
| arg | type | description |
|---|---|---|
| x | number | |
| z | number |
floorAt(x: number, z: number, y: number, reach: number?) → number
The floor node under (x, z) nearest the height y, within `reach` metres.
| arg | type | description |
|---|---|---|
| x | number | |
| z | number | |
| y | number | |
| reach | number? |
heightAt(p: any, reach: number?) → number
| arg | type | description |
|---|---|---|
| p | any | |
| reach | number? |
clearanceAt(p: any) → number
Metres of clear floor around the point (0 at a wall or drop), or nil off the map.
| arg | type | description |
|---|---|---|
| p | any |
isWalkable(p: any, radius: number?) → boolean
| arg | type | description |
|---|---|---|
| p | any | |
| radius | number? |
nearestNode(p: any, radius: number?, ground: boolean?) → number
Nearest walkable floor node to a point for an agent of this radius.
| arg | type | description |
|---|---|---|
| p | any | |
| radius | number? | |
| ground | boolean? |
nearestPoint(p: any, radius: number?) → Vec
| arg | type | description |
|---|---|---|
| p | any | |
| radius | number? |
clearLine(a: any, b: any, radius: number?) → boolean
Can an agent of `radius` walk straight from a to b? Follows the floor up ramps and steps, and fails at walls, drops, too-narrow spots and obstacles.
| arg | type | description |
|---|---|---|
| a | any | |
| b | any | |
| radius | number? |
_node(i: number) → any
| arg | type | description |
|---|---|---|
| i | number |
bucket(r: number) → number
| arg | type | description |
|---|---|---|
| r | number |
view(radius: number?, exposure: number?) → any
| arg | type | description |
|---|---|---|
| radius | number? | |
| exposure | number? |
openness(cl: number) → number
| arg | type | description |
|---|---|---|
| cl | number |
_layeredView(r: number, ew: number) → any
| arg | type | description |
|---|---|---|
| r | number | |
| ew | number |
nodeKey(node: any) → string return node
| arg | type | description |
|---|---|---|
| node | any |
position(node: any) → Vec return node
| arg | type | description |
|---|---|---|
| node | any |
nodeAt(p: any) → any
| arg | type | description |
|---|---|---|
| p | any |
adjacent(node: any) → void
| arg | type | description |
|---|---|---|
| node | any |
heuristic(a: any, b: any) → number
| arg | type | description |
|---|---|---|
| a | any | |
| b | any |
edgeMidpoint(a: any, b: any) → Vec
| arg | type | description |
|---|---|---|
| a | any | |
| b | any |
_groundNode(ix: number, iz: number) → number
| arg | type | description |
|---|---|---|
| ix | number | |
| iz | number |
_gridView(r: number, ew: number) → any
| arg | type | description |
|---|---|---|
| r | number | |
| ew | number |
walkable(ix: number, _iy: number, iz: number) → void
| arg | type | description |
|---|---|---|
| ix | number | |
| _iy | number | |
| iz | number |
position(node: any) → Vec
| arg | type | description |
|---|---|---|
| node | any |
nodeAt(p: any) → any
| arg | type | description |
|---|---|---|
| p | any |
adjacent(node: any) → void
| arg | type | description |
|---|---|---|
| node | any |
edgeMidpoint(a: any, b: any) → Vec
| arg | type | description |
|---|---|---|
| a | any | |
| b | any |
_buildWaypoints( ) → void
Waypoint network: points `spacing` apart on every floor, each moved to the roomiest spot near its lattice point, joined to nearby points when a straight walk between them is clear.
breathe( ) → void
bucketsOf(size: number) → void
spatial buckets: a point is only ever joined to points within `reach` (or `far` for a lonely point), so it need only be compared with the points in its own and the eight neighbouring buckets of that size. Comparing every pair made a town-sized map (~14k points) take ~100M checks in one frame; this gives the same edges in linear time.
| arg | type | description |
|---|---|---|
| size | number |
neighbours(B: { [number]: { number } }, size: number, p: any) → void
| arg | type | description |
|---|---|---|
| B | { [number]: { number } } | |
| size | number | |
| p | any |
_waypointView(r: number) → any
| arg | type | description |
|---|---|---|
| r | number |
adjacent(node: any) → void
| arg | type | description |
|---|---|---|
| node | any |
takeScratch( ) → any
giveScratch(s: any) → void
| arg | type | description |
|---|---|---|
| s | any |
linkBuckets(map: any, view: any, r: number, agent: any) → void
Off-mesh links snapped onto this view, per query, as the engine's link bake does (enabled, condition passes, endpoints on different nodes). Snaps are kept per link until its endpoints move.
| arg | type | description |
|---|---|---|
| map | any | |
| view | any | |
| r | number | |
| agent | any |
zoneList(map: any, costs: { [string]: number }) → any
The engine's cost zones that change a cost for this query (multiply mode): enabled, with a cost in `costs` other than 1, near the map. Flat arrays.
| arg | type | description |
|---|---|---|
| map | any | |
| costs | { [string]: number } |
zoneCost(L: any, x: number, y: number, z: number) → number
The cost multiplier at a point, as the engine's registry composes it in multiply mode (math.huge when a blocking zone holds the point).
| arg | type | description |
|---|---|---|
| L | any | |
| x | number | |
| y | number | |
| z | number |
_search(view: any, a: Vec, b: Vec, r: number, ew: number, agent: any, profCosts: { [string]: number }, maxNodes: number) → any
| arg | type | description |
|---|---|---|
| view | any | |
| a | Vec | |
| b | Vec | |
| r | number | |
| ew | number | |
| agent | any | |
| profCosts | { [string]: number } | |
| maxNodes | number |
waypointsOf(nodes: { number }, metas: { any }) → void
| arg | type | description |
|---|---|---|
| nodes | { number } | |
| metas | { any } |
heur(j: number) → number
| arg | type | description |
|---|---|---|
| j | number |
findPath(from: any, to: any, profile: Profile?) → PathResult
| arg | type | description |
|---|---|---|
| from | any | |
| to | any | |
| profile | Profile? |
frameNow( ) → number
budgetLeftMs( ) → number
Milliseconds of search budget this frame still has (crowd and handles alike).
spendMs(ms: number) → void
Count `ms` of search time against this frame's budget.
| arg | type | description |
|---|---|---|
| ms | number |
sliceTick( ) → void
poll( ) → void
Advance the searches (at most once a frame), then answer (done, result).
done( ) → boolean
cancel( ) → void
await( ) → any
Wait (yielding a frame at a time) until the search ends; answers its result.
findPathAsync(map: any, from: any, to: any, profile: Profile?) → any
| arg | type | description |
|---|---|---|
| map | any | |
| from | any | |
| to | any | |
| profile | Profile? |
pumpSearches( ) → number
Run this frame's share of the pending searches. Safe to call any number of times a frame: only the first call in a frame does work.
pendingSearches( ) → number
smooth(points: { PathPoint }, radius: number?) → void
String-pull a path: drop every corner a straight, clear walk can skip. Link points (ladders, jumps, …) are kept exactly.
| arg | type | description |
|---|---|---|
| points | { PathPoint } | |
| radius | number? |
info( ) → any
Summary for tools and the debug view.
Vec = { x: number, y: number, z: number }BakeOpts = {PathPoint = { x: number, y: number, z: number, via: string, link: any? }PathResult = {Profile = {Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.