Idle: Difference between revisions

From Ukikipedia
Jump to navigation Jump to search
(→‎check_common_idle_cancels: fix Into transitions. All stationary: water plunge, squished, standing death, quicksand death. All check_common_idle_cancels: freefall, shockwave bounce, single jump, begin sliding, first person, walking, punching, start crouching)
(way too much detail)
Line 16: Line 16:
''Certain things here are more explained on their individual pages. If something lacks detail, check the link for more information.''
''Certain things here are more explained on their individual pages. If something lacks detail, check the link for more information.''


As with all stationary actions, a variety of "cancels" are checked prior to actually performing the idle action. These checks are as follows:<ref>https://github.com/n64decomp/sm64/blob/66018e9f3caaa67399218971d61366cb3f7ba7d7/src/game/mario_actions_stationary.c#L1083-L1115</ref>
Before performing the action, [[Idle#Stationary cancels|stationary cancels]] are checked.
 
When performing the Idle action, the following happens:
# If Mario has sunk more than 30 units into quicksand, his action is set to [[In Quicksand|in quicksand]].
# If Mario is in poison gas, his action is set to [[coughing]].
# If Mario is not against a wall and has low health, his action is set to the [[panting action]].
# [[Idle#Check%20common%20idle%20cancels|check_common_idle_cancels]]
# If Mario's animation has just ended, his head has turned 10 times, and there is ground behind him (that is not an object)
## If Mario is in a cold environment, he starts to [[Shivering|shiver]], else he goes into the [[Start Sleeping|start sleeping]] action.
# If Mario is against a wall, Mario has his animation changed to be standing against the wall. Otherwise, Mario's animation is set depending on which way he is turning his head.
 
== Stationary cancels ==
A variety of "cancels" are checked prior to actually performing any stationary action. These checks are as follows:<ref>https://github.com/n64decomp/sm64/blob/66018e9f3caaa67399218971d61366cb3f7ba7d7/src/game/mario_actions_stationary.c#L1083-L1115</ref>
 
# Water - If Mario's height is lower than 100 units below the water height:
# Water - If Mario's height is lower than 100 units below the water height:
#* The camera preset is updated.
#* The camera preset is updated.
#* Mario's forward velocity is divided by 4.
#* Mario's y velocity is divided by 2.
#* Mario's height is set to 100 units below the water height.
#* Mario's action is set to [[Water Plunge|water plunge]].
#* Mario's action is set to [[Water Plunge|water plunge]].
# Squish - If Mario is supposed to be squished:
# Squish - If Mario is supposed to be squished:
Line 25: Line 41:
# If the action is not the unused [[0x0E action]] (always true) and Mario has less than 0x100 health:
# If the action is not the unused [[0x0E action]] (always true) and Mario has less than 0x100 health:
#* The camera preset is updated.
#* The camera preset is updated.
#* Mario's action is changed to the [[Standing Death|standing death]] action.
#* Mario's action is changed to [[Standing Death|standing death]].
# Lastly, Mario interacts with [[quicksand]] if his floor is a quicksand floor.
# Lastly, Mario can interact with quicksand on a quicksand floor. '''This only cancels if Mario's action is set to quicksand death'''.
With the Idle action occurring, the following happens:
#* Nothing happens if Mario is riding on a shell (though of course, riding a shell isn't a stationary action).
# If Mario has sunk more than 30 units into quicksand, his action is set to [[In Quicksand|in quicksand]].
#* If Mario's floor isn't quicksand, the quicksand depth is set to 0, and nothing happens.
# If Mario is in poison gas, his action is set to [[coughing]].
#* Else:
# If Mario is not against a wall and has low health, his action is set to the [[panting action]].
#** If Mario's quicksand depth is less than 1.1, it is set to 1.1
# [[Idle#Check%20common%20idle%20cancels|check_common_idle_cancels]]
#** Mario's quicksand depth is increased by 0.5
# If Mario's animation has just ended, his head has turned 10 times, and there is ground behind him (that is not an object)
#** If Mario's floor type is SURFACE_SHALLOW_QUICKSAND, SURFACE_SHALLOW_MOVING_QUICKSAND, or (SURFACE_QUICKSAND or SURFACE_MOVING_QUICKSAND), then his quicksand depth is capped to at most 10, 25, and 60 units respectively.
## If Mario is in a cold environment, he starts to [[Shivering|shiver]], else he goes into the [[Start Sleeping|start sleeping]] action.
#** If (Mario's floor type is SURFACE_DEEP_QUICKSAND or SURFACE_DEEP_MOVING_QUICKSAND, and his quicksand depth is at least 160) '''or''' (Mario's floor type is SURFACE_INSTANT_QUICKSAND or SURFACE_INSTANT_MOVING_QUICKSAND):
# If Mario is against a wall, Mario has his animation changed to be standing against the wall. Otherwise, Mario's animation is set depending on which way he is turning his head.
#*** The camera preset is updated.
#*** Mario's action is set to [[Quicksand Death]].
 
The processing goes:
 
# Somehow, m->action is set to a stationary action.
# Right before executing the action, stationary cancels are checked.
# The action is executed.
 
Technically, m->action was set to the stationary action. So although the action doesn't really do anything, there is still a "transition" between such stationary action and [[Water Plunge]], [[Squished]], [[Standing Death]], or [[Quicksand Death]]. So invariably, for all stationary actions, the infobox contains those 4 actions under "Transitions > Into" first (see top right of page if you don't know what I'm talking about).
 
== check_common_idle_cancels ==
== check_common_idle_cancels ==
Note: This is used only in Idle, [[Start Sleeping]], [[Coughing]], [[In Quicksand]], and [[Panting]].
Note: This is used only in Idle, [[Start Sleeping]], [[Coughing]], [[In Quicksand]], and [[Panting]].

Revision as of 00:06, 7 March 2023

Idle
Properties
Hex 0x0C400201
Action Flags Stationary, Idle, Allow First Person, Pause Exit
Action Group Stationary
ID 0x001
Transitions
Into Water Plunge, Squished, Standing Death, Quicksand Death, In Quicksand, Coughing, Panting, Freefall, Shockwave Bounce, Jump, Begin Sliding, First Person Action, Walking, Punching, Start Crouching, Shivering, Start Sleeping

Idle is the action where Mario stands still, turning his head left to right while not moving.

Behavior

Certain things here are more explained on their individual pages. If something lacks detail, check the link for more information.

Before performing the action, stationary cancels are checked.

When performing the Idle action, the following happens:

  1. If Mario has sunk more than 30 units into quicksand, his action is set to in quicksand.
  2. If Mario is in poison gas, his action is set to coughing.
  3. If Mario is not against a wall and has low health, his action is set to the panting action.
  4. check_common_idle_cancels
  5. If Mario's animation has just ended, his head has turned 10 times, and there is ground behind him (that is not an object)
    1. If Mario is in a cold environment, he starts to shiver, else he goes into the start sleeping action.
  6. If Mario is against a wall, Mario has his animation changed to be standing against the wall. Otherwise, Mario's animation is set depending on which way he is turning his head.

Stationary cancels

A variety of "cancels" are checked prior to actually performing any stationary action. These checks are as follows:[1]

  1. Water - If Mario's height is lower than 100 units below the water height:
    • The camera preset is updated.
    • Mario's forward velocity is divided by 4.
    • Mario's y velocity is divided by 2.
    • Mario's height is set to 100 units below the water height.
    • Mario's action is set to water plunge.
  2. Squish - If Mario is supposed to be squished:
    • The camera preset is updated.
    • Mario's action is set to squished.
  3. If the action is not the unused 0x0E action (always true) and Mario has less than 0x100 health:
    • The camera preset is updated.
    • Mario's action is changed to standing death.
  4. Lastly, Mario can interact with quicksand on a quicksand floor. This only cancels if Mario's action is set to quicksand death.
    • Nothing happens if Mario is riding on a shell (though of course, riding a shell isn't a stationary action).
    • If Mario's floor isn't quicksand, the quicksand depth is set to 0, and nothing happens.
    • Else:
      • If Mario's quicksand depth is less than 1.1, it is set to 1.1
      • Mario's quicksand depth is increased by 0.5
      • If Mario's floor type is SURFACE_SHALLOW_QUICKSAND, SURFACE_SHALLOW_MOVING_QUICKSAND, or (SURFACE_QUICKSAND or SURFACE_MOVING_QUICKSAND), then his quicksand depth is capped to at most 10, 25, and 60 units respectively.
      • If (Mario's floor type is SURFACE_DEEP_QUICKSAND or SURFACE_DEEP_MOVING_QUICKSAND, and his quicksand depth is at least 160) or (Mario's floor type is SURFACE_INSTANT_QUICKSAND or SURFACE_INSTANT_MOVING_QUICKSAND):

The processing goes:

  1. Somehow, m->action is set to a stationary action.
  2. Right before executing the action, stationary cancels are checked.
  3. The action is executed.

Technically, m->action was set to the stationary action. So although the action doesn't really do anything, there is still a "transition" between such stationary action and Water Plunge, Squished, Standing Death, or Quicksand Death. So invariably, for all stationary actions, the infobox contains those 4 actions under "Transitions > Into" first (see top right of page if you don't know what I'm talking about).

check_common_idle_cancels

Note: This is used only in Idle, Start Sleeping, Coughing, In Quicksand, and Panting.

  1. If Mario is on a steep cliff, he is pushed off (into freefall).
  2. If Mario is hit by a shockwave, his action is set to the shockwave bounce action.
  3. If A is pressed, Mario's action is set to jump.
  4. If Mario is off the floor, Mario's action is set to freefall.
  5. If Mario is above a slide, he begins sliding.
  6. If Mario goes into first-person mode, his action is set to first person.
  7. If the joystick is held in a direction, Mario's action is set to walking.
  8. If B is pressed, Mario's action is set to punching.
  9. If Z is pressed, Mario's action is set to start crouching.[2]