CMCharacter Modules 0.1.0

Slide

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

Slides down slopes too steep to stand on. Steep ground becomes a fast way down instead of a wall.

Sliding down a slope too steep to stand on, or sliding along the floor after crouching at a run. Steep ground stops being a wall and becomes a fast way down.

Inspector
▼Slide⋮
CharacterCharacter (Character Motor)
Crouch Slide Speed0.3
Crouch Slide Kept0
Crouch Slide Stop Speed0
Crouch Slide Boost1
Max Slide Angle73
Stop Speed1.35
Steer Rate86
Facing Turn Rate84
Stick Kept0.02
Speed Limit33.75
Wall Bounce Kept0.9
Rollout Speed10.8
The Slide component in the Inspector, with its defaults.
Origin. Super Mario 64 (1996): the slope slide, and the crouch slide that starts the long jump.

How it works

An action of Walking. Starts from any state, on: Crouch while moving, or a steep floor. Ends when it slows on level ground, then Crouch and the Walking mode.

Happens on: jump in a belly slide (rollout), from Slide. Its flight forbids pounds and hanging.

Slide: sliding down a floor too steep to walk on, as in classic 3D platformers. It starts on a floor past its class's slide angle (Surface Classes) when the character faces downhill, moves backwards or stands still, and when another module asks for it (a ground pound landing there). On ground too steep to stand on, up to maxSlideAngle, it always slides; steeper than that, the character falls. Pressing crouch while walking starts a crouch slide with the same physics, which runs out on flat ground into a crouch, and in its first moments allows a Long Jump. Facing within 90 degrees of downhill it is a butt slide, feet first; otherwise a belly slide. Jumping out of a butt slide is a jump at the slide's speed; out of a belly slide, a low rollout.

The velocity is free to point anywhere along the slope. Each 1/30 s, the original's frame, the slope pushes it downhill and friction keeps a share of it (both from the ground's surface class); the stick steers it a little and changes that share slightly. Speeds are stepped in the original's frames, so they match its slide speeds exactly: 9.3 m/s on a normal 20 degree slope. It stops once the floor no longer counts as a slope for its class and the speed is low. Fast slides on steep floors bounce off walls. Numbers from the classic 3D platformer study (D33).

Combine it

  • Needs: Surface Classes. The Inspector warns while one is missing.
  • Priority 17: when several states could run, the highest priority wins (see How modules combine).
  • Jump rank 35: when a jump starts, the highest-ranked shape that applies chooses its launch.
  • Body facing: works with characters whose body faces States.
  • Used by the presets: Retro Platformer, Modern Platformer.

Properties

PropertyDescriptionRangeDefault
CharacterThe character this module belongs to. Drag its Character Motor here.None
Crouch Slide SpeedPressing crouch while walking at least this fast starts a crouch slide, m/s.0 or more0.3
Crouch Slide KeptShare of a crouch slide's speed kept every 1/30 s on flat ground. 0: the surface class's slide friction.0 to 10
Crouch Slide Stop SpeedA crouch slide stops below this speed, m/s. 0: Stop Speed.0 or more0
Crouch Slide BoostA crouch slide starts at this share of the speed it came in with (modern 3D platformers: 1.2).0 or more1
Max Slide AngleGround too steep to stand on is still slid on up to this angle, degrees; steeper is fallen down.0 to 9073
Stop SpeedA slide on a floor that is no longer a slope stops below this speed, m/s.0 or more1.35
Steer RateHow fast a full sideways stick turns the slide, degrees per second.0 or more86
Facing Turn RateHow fast the body turns to face along the slide, degrees per second.0 or more84
Stick KeptShare added to the kept speed per 1/30 s by a full stick along the slide (taken away pulling back).0 to 0.10.02
Speed LimitFastest slide, m/s.0 or more33.75
Wall Bounce KeptA fast slide on a steep floor bounces off a wall keeping this share of its speed.0 to 10.9
Rollout SpeedUpward speed of the rollout out of a belly slide, m/s.0 or more10.8

Additional resources