RecastNavigationOptions beta
Interface of @v12-engine/engine
export interface RecastNavigationOptionsThe options a Recast navigation is made with: who builds it, the agents' size and slope limits, and the room for agents, obstacles and path steps
Members
agentRadius
agentRadius?: number;Navmesh is eroded by this radius, so it has to cover the largest unit
avoidance
avoidance?: AvoidanceLevel | Partial<AvoidanceParams>;How agents steer around each other (Detour's obstacle avoidance): a level (AVOIDANCE_LEVELS: how carefully a crowd samples the velocities it might go at, 'medium' being Detour's own), or the parts of AvoidanceParams to change, Detour's own for the rest. 'medium' when left out. 'low' crosses and gathers crowds as well in the measured cases for about a quarter less of a tick with a thousand walking, but it plays out other games differently (six of the example's tuned AI tests), so it is a game's choice
builds
builds?: NavigationBuilds;Who builds it and where what was built is kept: this thread and the process's memory when left out
cellSize
cellSize?: number;How big a cell is, in world units; the engine's own when left out
maxAgents
maxAgents?: number;How many agents the crowd makes room for at first: 512 when left out. It is not a limit: a crowd that is full makes room for twice as many, and the agents go on as they were. A game that knows it brings thousands says so, to save those moves
maxNodes
maxNodes?: number;How many steps a path search takes before it gives up with the best it found: a long path on a large map needs more. From the map's size when left out: a quarter of its cells, at least 4096, at most 65535
maxObstacles
maxObstacles?: number;How many obstacles (buildings, shut gates) there is room for: past it, placing one is refused. From the map's size when left out: half its cells, at least 8192, at most 65535
maxSlope
maxSlope?: number;Steepest slope units can walk, in degrees
radii
radii?: number[];Navigations cut for units of these sizes, each unit on the one for the biggest size it is not smaller than: a big unit keeps from walls as far as it needs, where all keep 0.5 when left out. Each size is a navigation of its own, with its own crowd, and the units of the other sizes stand in that crowd as mirrors, so they keep apart as on one navigation (see SizedNavigation)
separation
separation?: number;How hard agents push each other apart as they walk near each other (within eight radii), 0 for not at all: Detour's separation weight. 0.5 when left out: at Detour's 1.5, a unit walking past standing ones is pushed off its line and loses a tenth of its speed to it
speedAt
speedAt?: (x: number, z: number) => number;How fast one on foot goes over the ground at a point, as a multiplier (groundSpeedOfCell): what a path weighs, so that a way around slow ground wins where it is quicker (EN2). Asked as the ground is cut, and again for the tiles a slowing layer changed on (groundChanged). Every cell 1 when left out; never asked of the water
surface
surface?: 'ground' | 'water';What it is a navigation of: the ground, walked on, or the deep water, sailed on (Terrain.buildWaterMesh), at the height of its surface. The ground when left out
walls
walls?: 'soft' | 'detour';How a walking agent minds the walls, the edges of the ground it may walk (cliffs, buildings, trees). 'soft' when left out: an agent steers among velocities (Detour's obstacle avoidance) only while another agent, walking or standing, is within its reach (eight of its radii), and otherwise follows its path, still pushed apart from those near it (separation); where it does steer, a wall ahead weighs less (SOFT_WALLS). It keeps its speed between trees and round corners. 'detour' is Detour's own: every walking agent steers every tick, by DEFAULT_AVOIDANCE, and one in a gap or hugging a corner, on ground cut its radius from every wall, goes slower or sideways for it