HammeriteNavigationLinkBuilder
Navigation. Inherits RefCounted
Finds the ways through a level that are not walking, and measures them.
Why there are any. Ground derived from a carved world already connects itself: two rooms that abut are joined by an aperture the compiler punched from their shared wall, and their floors come out coplanar and edge-coincident, so the navigation server stitches the two regions together and an agent walks from one to the other without anything being authored. Measured on two_windows, every ordinary doorway in the level connects for free. What does NOT connect is a height discontinuity. A window with a 96-unit sill, a balcony over a hall, a gap between two roofs - the ground stops, and the ground on the other side is somewhere else. Those are the links, and they are exactly the places a stealth game cares about, because they are the routes a guard cannot take and a thief can. Three are derived and one is authored. Windows come from apertures whose sill stands above the floor; drops from a patch of ground overhanging lower ground; jumps from two patches within reach of each other across clear air. What cannot be seen in the geometry - that this ladder is climbable, that this rope reaches the balcony - is placed by hand as a ENTITY_TYPE entity. Nothing here knows what an agent is. Every link carries how high it must be climbed, how far it spans, how far it falls and how wide and tall the way through is; agent profiles compare against those numbers game-side. The thresholds below are only about what is worth LOOKING at - generous enough that nothing a game might permit is missed.
Properties
| Type | Name | Default |
|---|---|---|
float | step_height | 18.0 |
String[] | warnings | [] |
HammeriteCompileProgress | progress | null |
Methods
| Returns | Method |
|---|---|
HammeriteNavigationLinkData[] | build_links(map: HammeriteMap, surfaces: HammeriteNavigationSurface[]) |
Constants
DEFAULT_STEP_HEIGHT
const DEFAULT_STEP_HEIGHT = 18.0
The step height a build uses when nobody says otherwise: 18 units, which Hammerite inherits from Hammer and which its stairs are built to.
MAX_DROP
const MAX_DROP = 1024.0
Drops further than this are not looked for. Nothing walks off a 1024-unit cliff on purpose, and the pair would only be filtered out game-side anyway.
MAX_JUMP_SPAN
const MAX_JUMP_SPAN = 128.0
The widest gap treated as jumpable, and the biggest height change across one. Deliberately larger than any agent's real reach: what is generated is a candidate, and profiles do the rejecting.
MAX_JUMP_RISE
const MAX_JUMP_RISE = 96.0
The biggest height change across a jump looked for, either way, in map units.
ENTITY_TYPE
const ENTITY_TYPE = &"nav_link"
Entity type of an authored link, and the properties it carries.
TARGET_KEY
const TARGET_KEY = &"nav_link_target"
Entity property: a Vector3 from the entity's origin to the link's far end, in map units. A link whose far end is less than a unit away is dropped with a warning. Any entity carrying this is read as a link, whatever its type.
NAME_KEY
const NAME_KEY = &"nav_link_name"
Entity property: the link's name, for HammeriteNavigationRuntime.set_link_enabled().
ONE_WAY_KEY
const ONE_WAY_KEY = &"nav_link_one_way"
Entity property: true lets the link be taken only from the entity towards its far end.
Property descriptions
step_height
var step_height: float = 18.0
The tallest rise that is a STEP rather than a drop or a climb - one stair tread, one kerb - for this build. Set from HammeriteNavigationAgentProfiles.step_height by the runtime. It is a fact about the world's units rather than about any particular creature: whether a given agent can manage one is its profile's business (HammeriteNavigationAgentProfile.climb_height), so a rat with an 8-unit stride still cannot use a staircase built for people.
warnings
var warnings: String[] = []
What the last build could not do: an authored link with no other end, a window nobody can reach.
progress
var progress: HammeriteCompileProgress = null
Told how far build_links() has got, when it runs as part of a compile. It stops early once this says it was cancelled.
Method descriptions
build_links()
func build_links(map: HammeriteMap, surfaces: HammeriteNavigationSurface[]) -> HammeriteNavigationLinkData[]
Every traversal link in map, derived from surfaces (the output of HammeriteNavigationBuilder) and from what the author placed.