Ledge Grab

From Ukikipedia
Revision as of 02:22, 26 December 2024 by Dm ss (talk | contribs) (Add "is in the air")
Jump to navigation Jump to search

A ledge grab works as follows: While Mario's position is in the air and against a wall, and he has a non-positive vertical speed, the game checks two conditions.

  • There is a wall 30 units above Mario.
  • There is no wall 150 units above him.

If both conditions pass, the game searches for a potential ledge grab. From Mario's position, it considers a point 60 units in the direction perpendicular to the wall and 160 units above. This point ends up being 10 units into the wall due to Mario's 50 unit radius. From that point, it searches top-down for the first floor hitbox. If a floor hitbox is found, Mario will ledge grab onto it.

Given these conditions, a ledge grab normally raises Mario between 30 units (inclusive) and 150 units (exclusive). Note that despite the search point starting 160 units higher than Mario's position, only a 150 unit raise is ordinarily possible because there would otherwise be a wall at the point 150 units above Mario.

It's possible to exploit the logic to do a glitchy ledge grab, allowing Mario to ledge grab a floor up to 238 units above. However, glitchy ledge grabs are rarely possible in practice due to the fact that ledge grabs are not possible where there is a wall 150 units above Mario. Fortunately, minor deviations from perfect geometry can cause there to be no wall 150 units above Mario.

Examples include:

  1. The wall is slightly slanted forward
  2. There are 2 walls meant to be coplanar that aren't
  3. If there are 2 parallel walls with the lower one jutting out more