Skip to content

five-on-it / packages/ai/src/steer-climb

packages/ai/src/steer-climb ​

Taking the navigation's links on foot (@foi/world's nav-links.ts): the step of a walk that is no walk. A path's waypoint reached by a link (NpcPath.links) is taken here, with the link's own sub-state on the NPC (ClimbState, hashed with it), through ordinary inputs as a player takes it:

  • a ladder: to its climb line (its foot, or the landing at its top), the interaction key while the prompt is its Climb, then the forward key held (the back key going down) with the run key, until the simulation steps it off at the other end (@foi/sim's ladders.ts);
  • a lift: to a spot beside its platform at the stop, waiting until the platform stands there with CLIMB.liftSpare seconds of its stop left (liftHeight, the timetable every side computes alike), onto its middle, standing still while it rides, off toward the floor at the other stop once it stands there;
  • a drop: walking off the floor's edge toward the floor below;
  • a hop: toward the low roof at a walk, the jump key with its wall CLIMB.hopJump ahead (a ray at knee height), stepping back first when too near;
  • narrow stairs: to their foot, up (or down) their length, onto the floor they reach.

Far from the link's start it is an ordinary walk there (the rays, the stuck recovery); within CLIMB.near the link takes the whole input, the rays and the stuck recovery bypassed (a ladder stands against a wall, which the rays would steer away from, and the stuck recovery's jump lets go of a ladder). A link not taken within its time of reaching it is dear for a while (CLIMB.failTicks) and the walk is planned again.

Interfaces ​

Variables ​

Functions ​