CMCharacter Modules 0.1.0

Dodge

Kind: State · Add Component: Character Modules > States > Dodge

Rolls quickly away in the stick's direction. In combat it is how the player gets out of harm's way.

A quick roll in the direction of the stick, or a backstep when it is released. In combat it is how a character gets out of the way; here it moves the character a set distance in a set time.

Inspector
▼Dodge⋮
CharacterCharacter (Character Motor)
Distance3.2
Move Time0.43
Backstep Distance1.6
Backstep Time0.3
Recovery Time0.27
Recovery Distance0.3
Stamina Cost12
Buffer Time0.25
The Dodge component in the Inspector, with its defaults.
Origin. The Legend of Zelda: Ocarina of Time (1998), then Dark Souls (2011), whose roll and backstep cost stamina.

How it works

An action of Walking. Starts from any state, on: Dodge. Committed until it recovers. Ends after its recovery, or off an edge, then the Walking mode.

Dodge: press Dodge on the ground to roll a set distance in the stick's direction, as in melee action role-playing games: fast for moveTime, then a short recoveryTime that slows to a stop. The body turns to the roll at once (locked on, it keeps facing the target). With the stick let go it is a backstep: a shorter hop backwards, still facing forward. A dodge cannot be cancelled or steered; running off an edge ends it in a fall. A Dodge pressed up to bufferTime early still counts, so presses during a dodge's recovery chain the next one.

With a Stamina module each dodge costs staminaCost and needs some stamina left. No invulnerability: that is a combat rule, not movement. Numbers from the action RPG measurements (D56; a medium roll).

Combine it

  • Needs: Ground Move. The Inspector warns while one is missing.
  • Priority 16: when several states could run, the highest priority wins (see How modules combine).
  • Used by the presets: Traversal Adventure, Action RPG.

Properties

PropertyDescriptionRangeDefault
CharacterThe character this module belongs to. Drag its Character Motor here.None
DistanceDistance the roll covers in its fast part, metres.0 or more3.2
Move TimeSeconds of the fast part of the roll.0.01 or more0.43
Backstep DistanceDistance the backstep covers in its fast part, metres.0 or more1.6
Backstep TimeSeconds of the fast part of the backstep.0.01 or more0.3
Recovery TimeSeconds after the fast part before the character can act again; it slows to a stop meanwhile.0 or more0.27
Recovery DistanceDistance slid while recovering, metres.0 or more0.3
Stamina CostWith a Stamina module: stamina points each dodge costs.0 or more12
Buffer TimeA Dodge press this many seconds before a dodge can start still starts one.0 or more0.25

Additional resources