Movement steps: Difference between revisions

no edit summary
(WIP but i am out of time)
No edit summary
Line 6: Line 6:


== Air Step ==
== Air Step ==
When an action performs an air step, the first thing Mario does is update his horizontal velocity/sideways position via [[straining]].
''Certain things here are more explained on their individual pages. If something lacks detail, check the link for more information.''
 
When an action performs a ''common'' air step, the first thing Mario does is update his horizontal velocity/sideways position via [[straining]]. This is only for the common air step and is not part of the quarter-frame checks.
 
=== Quarter-Frame Checks ===


After that is updated, the movement is split into "quarter-steps" that breakdown Mario's movement and determine what his outcome of each step is. The checks for the quarter-steps are as follows:
After that is updated, the movement is split into "quarter-steps" that breakdown Mario's movement and determine what his outcome of each step is. The checks for the quarter-steps are as follows:
Line 39: Line 43:
## If no other exit has occurred, '''nothing happens'''.
## If no other exit has occurred, '''nothing happens'''.
# This repeats until Mario encounters something besides '''nothing happens''', up to four times including the initial time.
# This repeats until Mario encounters something besides '''nothing happens''', up to four times including the initial time.
# Mario tracks his "exit", with '''nothing happens''' being tracked if the whole process completed four times.
With the outcome selected and the movement mostly done, a series of things happen.
* If Mario's velocity is not negative, his "peak height" is updated.
* Mario's step noise is updated based on his floor.
* If Mario is not flying, [[gravity]] is applied.
* [[Vertical Wind|Vertical wind]] is now applied/accounted for.
* Mario's visual position is updated to Mario's position.
* Mario's yaw is updated to match the in-game angle.


From here, the outcome chooses the next action and some other things are applied.
=== Common Air Step Results ===
If doing a common air step, Mario now decides what to do based off the "exit" from the quarter-frame checks before. Here is what he does for each exit:
* '''Nothing Happens''':
** Mario's animation is now applied.
* '''Lands''':
** If Mario is not over a hard [[surface]], the [[terrain]] is either snow or desert, Mario's peak height is more than 1000 units above him, the surface does not belong to an object, and the Y normal of the surface is not less than .8660254 (square root of 3 divided by 2):
*** Mario plays an OOF noise, dependent on which [[Version Differences|version of the game]].
*** Mario spawns particles.
*** Mario's action is set to the [[Feet Stuck in Ground|feet stuck in ground]] action and the '''lands''' checks stop.
** If Mario's action is not twirling, the floor is not lava, his negative velocity is less than -55, and the distance from the peak height to Mario is more than 3000 units:
*** Mario is hurt by 16 (24 without his hat).
*** The camera shakes.
*** Mario plays the "attacked" noise.
*** Mario is set to the [[Hard Backward Ground Knockback|hard backward ground knockback]] action and the '''lands''' checks stop.
** If Mario's action is not twirling, the floor is not lava, his negative velocity is less than -55, and the distance from the peak height to Mario is more than 1150 units:
*** Mario is hurt by 8 (12 without his hat).
*** Mario is squished for 30.
*** The camera shakes.
*** Mario plays the "attacked" noise.
** Mario is set to his action's landing action.
* '''Hits a Wall''':
** Mario's animation is now applied.
** If Mario's forward velocity is more than 16 and is in contact with a physical wall/surface:
*** Mario's yaw is "reflected" across the most recent wall Mario collided with, up to the first 4 walls. (This can be glitchy with more than 1 wall, i.e. [[Unreferenced Walls|unreferenced walls]]).
*** Mario plays a noise depending on whether or not he is wearing a metal cap.
** If Mario's forward velocity is more than 16 and he is not in contact with a physical wall/surface (i.e. OOB):
*** A different sound is played, but Mario's yaw is not reflected. <!-- Some of these reflection calculations may be wrong -->
** If Mario is in contact with a wall, his action is set to the [[Air Hit Wall|air hit wall]] action.
** If Mario is not in contact with a wall (i.e. hitting OOB):
*** Any positive vertical speed is capped to 0.
*** If Mario's forward velocity is 38 or more, spawn particles and set his action to the [[Backward Air Knockback|backward air knockback]] action.
*** If Mario's forward velocity is more than 8 but less than 38, set Mario's forward speed to -8 and set his action to the [[Soft Bonk|soft bonk]] action.
** If Mario's forward velocity is 16 or less (initially, not after these other changes), set the forward velocity to 0.
* '''Ledge Grabs'''
** Mario's animation is set the idle ledge grab animation.
** Mario enters the [[Ledge Grab|ledge grab]] action while dropping any held objects and no longer riding a shell.
* '''Hangs'''
** Mario's action is set to the [[Start Hanging|start hanging]] action.
* '''Lava Wall Boosts'''
** Mario's yaw is set perpendicular to the wall.
** Mario's forward speed is capped to 24.
** If Mario is not wearing a metal cap, he is hurt 12 (or 18 without his hat).
** Mario plays the noise for being burned.
** The camera preset is set to the area's default preset. <!-- This is overly simplified, perhaps best put on the camera page -->
** Mario enters the [[Lava Boost|lava boost]] action while dropping any held objects and no longer riding a shell.