Climbing, swimming and gliding

Lets the on-foot character explore freely: climb steep surfaces, wall jump, pull up over ledges, swim, glide and slide down slopes, with one shared stamina pool and a gauge.

Source: module-kits:kits/movement_traversal/usage/en.mdView Markdown source

Also read offline — CLI: grip-forge docs movement-traversalMCP tool: gripforge_docs { "topic": "movement-traversal" }

Climbing, swimming and gliding (movement.traversal) #

What it is for #

Lets the on-foot character explore freely: climb steep surfaces, wall jump, pull up over ledges, swim, glide and slide down slopes, with one shared stamina pool and a gauge.

It needs input.actions, character.control, physics.port, game.engine; installing it brings them in.

Turn it on #

Install the kit in a project, then change a setting (the values shown are its defaults):

gripforge_gamekit_install   { project_id: "gkp_…", id: "movement.traversal" }
gripforge_gamekit_configure { project_id: "gkp_…", id: "movement.traversal",
                              config: { "climb": true, "climbSpeed": 1.6 } }

First example #

<!-- test: kits/game_engine/host/tests/movement_traversal.rs::the_stamina_pool_is_spent_exhausted_and_recovers --> This is the body of the passing test the_stamina_pool_is_spent_exhausted_and_recovers; the helper functions it calls are defined at the top of the same test file.

#[test]
fn the_stamina_pool_is_spent_exhausted_and_recovers() {
    let mut s = session(json!({ "staminaMax": 50 }));
    let stamina = |s: &mut Session, m: &str, a: Json| call(s, "movement.stamina", m, a);
    assert_eq!(stamina(&mut s, "max", json!([])), json!(50));
    assert_eq!(stamina(&mut s, "spend", json!([60])), json!(false));
    assert_eq!(stamina(&mut s, "spend", json!([20])), json!(true));
    assert_eq!(stamina(&mut s, "value", json!([])), json!(30));
    assert_eq!(stamina(&mut s, "spend", json!([60, true])), json!(true));
    assert_eq!(stamina(&mut s, "exhausted", json!([])), json!(true));
    assert_eq!(stamina(&mut s, "spend", json!([1, true])), json!(false));
    // Recovery `full`: exhausted until the gauge is full again.
    stamina(&mut s, "restore", json!([49]));
    assert_eq!(stamina(&mut s, "exhausted", json!([])), json!(true));
    stamina(&mut s, "restore", json!([5]));
    assert_eq!(stamina(&mut s, "exhausted", json!([])), json!(false));
    assert_eq!(stamina(&mut s, "value", json!([])), json!(50));
    stamina(&mut s, "setMax", json!([80, true]));
    assert_eq!(stamina(&mut s, "value", json!([])), json!(80));
}

Settings and defaults #

Descriptions come from the kit manifest and stay in English.

SettingTypeDefaultRange or valuesMeaning
climbbooleantrueClimb surfaces steeper than climbMinSlope.
climbSpeednumber1.60.2–10
climbMinSlopenumber5530–90Degrees: steeper surfaces are climbable.
climbCostnumber80–100Stamina per second while climbing (a third while hanging still).
climbJumpbooleantrueJump while climbing: a quick leap up the wall, or off the wall when pulling back.
climbJumpCostnumber200–100
climbJumpDistancenumber20.5–10
wallJumpSpeednumber50–20Horizontal speed of a jump off the wall.
swimbooleantrue
swimDepthnumber1.10.3–3Water depth (m) at which the character starts swimming.
swimSpeednumber2.20.2–10
swimFastSpeednumber4.50.2–20With sprint held.
swimCostnumber30–100Stamina per second swimming (30 % treading water).
swimFastCostnumber180–100
drowningbooleantrueOut of stamina in deep water: damage (combat.damage) and back to the last safe ground.
drownDamagenumber200–10000
glidebooleantrueOpen a glider in the air (glide action, or jump when glideWithJump).
glideWithJumpbooleantrue
glideSpeednumber60.5–40
glideSinknumber1.60.1–20Metres lost per second while gliding.
glideCostnumber30–100
glideMinHeightnumber2.50.5–50Height above the ground needed to open the glider.
windDriftnumber0.30–2Fraction of the world.weather wind added to the glide.
slidebooleantrueSlide down slopes steeper than slideMinSlope.
slideMinSlopenumber4010–89
slideMaxSpeednumber121–60
staminaMaxnumber1001–10000
regennumber300–10000Stamina per second on the ground.
regenDelaynumber0.80–30Seconds after the last effort before refilling.
recoverystring"full"full, partialExhausted until the gauge is full again, or until 30 %.
slipWetnessnumber0.350–1Wetness (rain, wet state) above which climbing walls slip.
slipIntervalnumber2.50.2–30
slipDistancenumber0.90–10

Services, events, variables #

  • Service movement.traversal: mode(), wall(), glide(), release(), waterAt(pos). Rust KitHost also provides start(mode, instance, controls, priority?), steer(controls), velocity(), interrupt(owner, velocity, priority?), anchors() (1.4.0: the grapple anchors of the active scene).
  • Service movement.stamina: value(), max(), exhausted(), spend(amount, partial), restore(amount), setMax(max, refill).
  • Events emitted:
    • traversal.mode (entity, from, to) — walk, climb, climb_jump, mantle, leap, swim, glide or slide.
    • traversal.jumped (entity, kind)
    • traversal.mantled (entity, at) — Pulled up over a ledge.
    • traversal.slipped (entity, distance) — Slid down a wet wall.
    • traversal.exhausted (entity, mode) — Let go of a wall or closed the glider out of stamina.
    • traversal.drowned (entity, at)
    • stamina.exhausted (entity)
    • stamina.recovered (entity)
  • Variables:
    • stamina.value (number) — Stamina
    • stamina.max (number) — Stamina max
    • stamina.exhausted (boolean) — Exhausted
    • traversal.mode (string) — Traversal
  • Input actions: glide, drop

Hooks and modding #

  • Hooks (a game or a mod can intercept them):
    • traversal.climb (cancellable) — The player is about to grab a climbable surface: pushing into it on foot, in the air or while sliding, steering the glider into it, or reaching a bank from the water (from = the mode it leaves).
    • traversal.jump (fields a tap may change: cost, speed; cancellable) — The climber pressed jump on a wall: a leap up the wall (kind climb; speed = meters per second up the wall during the leap, climbJumpDistance over its 0.35 s) or a jump off the wall when pulling back…
    • traversal.mantle (cancellable) — The climber reached the top of a wall and is about to pull up onto the ledge at the point at (surface: the entity that owns the ledge collider, empty for the terrain and for anonymous colliders).
    • traversal.glide (cancellable) — The player is about to open the glider (glide or jump pressed in the air, or movement.traversal.glide()), after the kit's own checks: the move is on, stamina is left, the ground and the water are far…
    • traversal.drown (fields a tap may change: damage; cancellable) — The swimmer ran out of stamina in deep water with drowning on: it is about to take damage (drownDamage, through combat.damage) and to be put back on the last safe ground with a full gauge.
  • Moddable settings: climb, climbSpeed, climbMinSlope, climbCost, climbJump, climbJumpCost, climbJumpDistance, wallJumpSpeed, swim, swimDepth, swimSpeed, swimFastSpeed, swimCost, swimFastCost, drowning, drownDamage, glide, glideWithJump, glideSpeed, glideSink, glideCost, glideMinHeight, windDrift, slide, slideMinSlope, slideMaxSpeed, staminaMax, regen, regenDelay, recovery, slipWetness, slipInterval, slipDistance
  • Components: traversal, climbable, grind_rail, grapple_anchor

Engines #

Declared targets: web, godot, unity, unreal, rust. gripforge kit api movement.traversal lists the exact settings and services of your version.

Versions #

Kit version 1.5.0.