246
edits
m (MMMMMMMMMMMMM moved page Movement Steps to Movement steps: Sentence casify the wiki) |
Icecream17 (talk | contribs) (add stationary step) |
||
Line 2: | Line 2: | ||
Steps are also responsible for detecting collision with [[surfaces]], updating Mario's [[referenced surfaces]], and updating Mario's [[Water|water level]]. However, quarter steps don't detect object collisions or warps. | Steps are also responsible for detecting collision with [[surfaces]], updating Mario's [[referenced surfaces]], and updating Mario's [[Water|water level]]. However, quarter steps don't detect object collisions or warps. | ||
== Stationary Step == | |||
https://github.com/n64decomp/sm64/blob/66018e9f3caaa67399218971d61366cb3f7ba7d7/src/game/mario_step.c#L236 | |||
# Mario's x and z forward velocity and sliding velocity is set to 0 | |||
# mario_update_moving_sand | |||
# mario_update_windy_ground | |||
# If updated by moving sand or windy ground, return perform_ground_step | |||
# Else, set Mario's y position to the floor, (possibly causing a [[downwarp]]), and update graphics. Return GROUND_STEP_NONE. | |||
== Air Step == | == Air Step == | ||
Line 7: | Line 16: | ||
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. | 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 === | === 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: | ||
# The position a quarter of Mario's velocity ahead of Mario is checked for cancels/outcomes. Anything in bold is an exit out of the rest of the checks. | # The position a quarter of Mario's velocity ahead of Mario is checked for cancels/outcomes. Anything in bold is an exit out of the rest of the checks. | ||
Line 42: | Line 49: | ||
# 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. | # 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. | 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. | * If Mario's velocity is not negative, his "peak height" is updated. | ||
Line 50: | Line 56: | ||
* Mario's visual position is updated to Mario's position. | * Mario's visual position is updated to Mario's position. | ||
* Mario's yaw is updated to match the in-game angle. | * Mario's yaw is updated to match the in-game angle. | ||
=== Common Air Step Results === | === 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: | 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''': | * '''Nothing Happens''': | ||
** Mario's animation is now applied. | ** Mario's animation is now applied. | ||
* '''Lands''': | * '''Lands''': | ||
Line 77: | Line 82: | ||
*** Mario plays a noise depending on whether or not he is wearing a metal cap. | *** 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): | ** 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. | *** A different sound is played, but Mario's yaw is not reflected. | ||
** If Mario is in contact with a wall, his action is set to the [[Air Hit Wall|air hit wall]] action. | ** 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): | ** If Mario is not in contact with a wall (i.e. hitting OOB): | ||
Line 94: | Line 99: | ||
** If Mario is not wearing a metal cap, he is hurt 12 (or 18 without his hat). | ** If Mario is not wearing a metal cap, he is hurt 12 (or 18 without his hat). | ||
** Mario plays the noise for being burned. | ** Mario plays the noise for being burned. | ||
** The camera preset is set to the area's default preset. | ** The camera preset is set to the area's default preset. | ||
** Mario enters the [[Lava Boost|lava boost]] action while dropping any held objects and no longer riding a shell. | ** Mario enters the [[Lava Boost|lava boost]] action while dropping any held objects and no longer riding a shell. | ||
[[Category:Action Mechanics]] | [[Category:Action Mechanics]] |
edits