import type { PhysicsConfig } from "../game/defineGame.js"; import type { PlayerMovementConfig } from "../game/playableGame.js"; /** The walk character {@link measureMovement} drives: the same fields a game passes to `defineGame`. */ export interface MovementProbeSubject { /** `defineGame({ movement })`; `feel` and `backpedalMult` shape the walk. */ movement?: PlayerMovementConfig; /** `defineGame({ physics })`; `gravity` and `jumpVelocity` shape the jump. */ physics?: PhysicsConfig; /** The player entity's `movement.walkSpeed` (default `2`, the controller default). */ walkSpeed?: number; } /** Scenario settings for {@link measureMovement}; every field has a default. */ export interface MovementProbeOptions { /** Fixed tick, s (default `1/60`). */ dt?: number; /** Measure with sprint held (default `false`). */ sprint?: boolean; /** How long jump is held for `tapJumpHeight`, s (default `0.1`). */ tapSeconds?: number; } /** Deterministic walk-feel metrics. `Infinity` means the target was never reached. */ export interface MovementReport { /** Steady ground speed holding forward, m/s. */ topSpeed: number; /** Standing start until speed reaches 90% of `topSpeed`, s. */ timeToTopSpeed: number; /** Distance slid after releasing input at `topSpeed`, until speed is under 0.05 m/s, m. */ stopDistance: number; /** Seconds from releasing input at `topSpeed` until speed is under 0.05 m/s. */ stopTime: number; /** Seconds from reversing direction at `topSpeed` until speed along the new heading reaches 90% of `topSpeed`. */ turnAroundTime: number; /** Peak height of a held standing jump, m. */ jumpHeight: number; /** Peak height of a standing jump released after `tapSeconds`, m. Lower than `jumpHeight` when `jumpCutFactor` is set. */ tapJumpHeight: number; /** Seconds from takeoff to the jump's peak. */ apexTime: number; /** Seconds from takeoff to landing. */ airTime: number; /** Sideways distance covered by strafing from the first airborne tick of a standing jump until landing, m. */ airControlReach: number; } /** * Drives a walk character through fixed scenarios (standing start, release to stop, reversal, a standing * jump, a tapped jump, a strafed jump) on the same integrator `stepPlayerMovement` uses, and reports the feel metrics a * test can assert. Deterministic: the same subject and options always produce the same report, so a feel * change shows up as a number moving. Collision, terrain and swimming are out of scope; it measures flat ground. * @capability movement-metrics measure a walking character's feel as numbers — time to top speed, stop distance, jump height and apex, air control, turn-around */ export declare function measureMovement(subject?: MovementProbeSubject, options?: MovementProbeOptions): MovementReport;