Dodge
The key words MUST, MUST NOT, SHOULD, and MAY are used as in RFC 2119.
A forward roll in the facing direction at the moment the dodge starts. Dodge is free — no stamina or resource cost — so its balancing cost is animation commitment plus a short invincibility window: a poorly-timed roll is a punish (see Player State Machine → Action commitment).
Phases and timing
| Phase | Window | Behavior |
|---|---|---|
| I-frames | 0 … DODGE_IFRAME_DURATION (0.2 s ≈ 11 frames) | Invincible: a hit does no damage and does not interrupt the roll. |
| Move | 0 … clip_length × DODGE_MOVE_FRACTION (0.7) | Velocity at DODGE_SPEED (7.0) in the cached direction; edge-checked so the roll will not leave the floor. |
| Recovery | rest of the clip | Velocity zeroed; crouch-and-stand plays out. Fully vulnerable. |
- The i-frame window MUST be the fixed
DODGE_IFRAME_DURATION(0.2 s) from roll start — not the whole move phase. Past the window, a hit interrupts the roll (DODGING → DAMAGED/DOWN). History: #273 used the move phase (≈ 0.47 s for saber); #377 tightened it. - The roll MUST NOT be player-cancelable — not by attack, not by another dodge. It commits until the clip finishes (or damage outside the i-frames interrupts it).
- A dodge input while ATTACKING MUST be ignored — the swing completes first.
- Starting a dodge MUST drop an in-progress technique charge.
- The move phase scales to the active weapon's
<prefix>_esc_fclip length (falling back toDODGE_DURATION, 0.8 s), so travel distance is partly weapon-driven. The i-frame window does not scale — it is 0.2 s for every weapon.
Reference
The in-repo dodge-debug tool (web mock at #/dodge-debug) visualizes the roll and i-frames for tuning — to be ported here as an interactive view.
Implemented by
scripts/3d/player/player.gd(Player) —_start_dodgeguards commitment (no-op during ATTACKING/DODGING), caches the facing direction, and scales the move phase to the active weapon's_esc_fclip length;_handle_dodgedrives the roll atDODGE_SPEEDfor the move fraction (with an edge check so it won't roll off a ledge), then zeroes velocity through the recovery and returns to IDLE;take_damageis a no-op while DODGING withdodge_timer < DODGE_IFRAME_DURATION.
Status: implemented (#273, tightened by #377) — test_player_states pins both sides of the 0.2 s window; test_action_commitment pins the no-cancel rules.