Gravity

From Ukikipedia
Jump to navigation Jump to search

Gravity is a force that draws matter together, which in everyday life causes objects to accelerate down towards the Earth's center of mass. Simulation of gravity in Super Mario 64 is less consistent than real life and depends significantly on the object and the situation. This could be an acceleration or more of a velocity depending on the situation.

Mario

Mario generally does a series of checks and changes his velocity depending on the situation. Once Mario performs any changes to his vertical speed, he is done with gravity and applies no more changes. As such, at the end of each main condition branch, Mario explicitly skips the rest of the gravity checks, making them mutually exclusive.

  1. If Mario is in the twirling action and has negative Y-speed:
    1. If Mario is spinning with a yaw speed faster than 1024:
      • Mario's terminal velocity is set to −75 × 1024 / Mario's yaw speed.
      • Mario's vertical speed is increased by −4 × 1024 / Mario's yaw speed.
    2. Otherwise:
      • Mario's terminal velocity is set to −75.
      • Mario's vertical speed is decreased by 4.
    3. Mario's vertical speed is clamped to the terminal velocity.
  2. Or, if Mario is in the shot from cannon action:
    1. Mario's vertical speed is decreased by 1.
    2. Mario's vertical speed is clamped to −75.
  3. Or, if Mario is in the long jump, slide kick, or BBH enter spin actions:
    1. Mario's vertical speed is decreased by 2.
    2. Mario's vertical speed is clamped to −75.
  4. Or, if Mario is in the lava boost or fall from star grab actions:
    1. Mario's vertical speed is decreased by 3.2.
    2. Mario's vertical speed is clamped to −65.
  5. Or, if Mario is in the getting blown action:
    1. Mario's vertical speed is decreased by his unkC4, some number that is set elsewhere.[elaborate when documented]
    2. Mario's vertical speed is clamped to −75.
  6. Or, if Mario has the 0x100 flag, his action does not have the "invulnerable" or "intangible" but has the "control jump height" action flags, his vertical speed is more than 20, and A is not held:
    1. Mario's vertical speed is set to a quarter of its value.
  7. Or, if Mario's action has the "metal water" flag (Metal Cap and underwater):
    1. Mario's vertical speed is decreased by 1.6.
    2. Mario's vertical speed is clamped to −16.
  8. Or, if Mario has the Wing Cap, A is held, and Mario's vertical speed is negative:
    1. Mario's animation is changed[clarification needed]
    2. Mario's vertical speed is decreased by 2.
    3. If Mario's vertical speed is less than −37.5, it is increased by 4.
      • Then it is clamped to −37.5.
  9. Or, if none of the other branch conditions were true:
    1. Mario's vertical speed is decreased by 4.
    2. Mario's vertical speed is clamped to −75.