Surface: Difference between revisions

4,482 bytes added ,  26 February 2023
→‎Surface Types: explain surface types
(Some stuff)
(→‎Surface Types: explain surface types)
 
(16 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{stub}}
{{stub}}
Every surface in Super Mario 64 is made up of triangles. Every triangle falls into one of three categories: a floor triangle, a wall triangle, or a ceiling triangle. However, a triangle does not store what category it is. Instead, its category is determined based on the y component of the triangle's [[wikipedia:normal vector|normal vector]]. If y component > 0.01, then it is a floor. If y component < -0.01, then it is a ceiling. Otherwise, it is a wall<ref>https://www.youtube.com/watch?v=UnU7DJXiMAQ</ref>.
A '''surface''' or '''triangle''' in Super Mario 64 is a piece of geometry that exerts some kind of force or effect on Mario. Every triangle falls into one of three categories: a floor triangle, a wall triangle, or a ceiling triangle. However, a triangle does not store what category it is. Instead, its category is determined based on the y component of the triangle's [[wikipedia:normal vector|normal vector]]<ref>[https://www.youtube.com/watch?v=UnU7DJXiMAQ "Walls, Floors, & Ceilings" by UncommentatedPannen]</ref>. If y component > 0.01, then it is a floor. If y component < -0.01, then it is a ceiling. Otherwise, it is a wall.
==Walls==
==Walls==
The majority of walls in the game are perfectly vertical, but not all. [[File:Non-Vertical Wall.png|300px|right|thumb|This wall in [[BoB]] is not quite vertical.]]
A triangle is a wall triangle if and only if -0.01 < normal.y < 0.01.
'''hitbox stuff'''
===Hitbox===
[[File:wall hitbox.png|300px|right|thumb|The hitbox of a wall during both the initial handle and a ground quarter step, simplified]][[File:wall hitbox air.png|300px|right|thumb|The hitbox of a wall during an air quarter step, simplified]][[File:wall hitbox water.png|300px|right|thumb|The hitbox of a wall in the water, including both the inital handle and the single frame movement, simplified]]
All wall hitboxes are handled once per [[frame]] and once per [[Quarter Steps|quarter step]] of Mario's movement. Most of the time, a wall has two separate hitboxes handled one after the other within a frame or quarter step.
* A wall hitbox's initial frame handle has a hitbox extending 50 [[unit]]s forward and 50 units backward, offset down 60, and then a hitbox extending 24 units in each direction offset down 30.
* A quarter step of ground movement has a hitbox extending 24 [[unit]]s forward and 24 units backward, offset down 30, and then a hitbox extending 50 units in each direction offset down 60. This is the opposite order from the initial handle, but the outcome is the same.
* A quarter step of air movement gives the wall a hitbox of 50 units in each direction offset down 150, and then a hitbox of 50 units offset down 30.
* Water movement does not implement quarter steps. After one frame of water movement, a wall hitbox extends 110 units in each direction, offset down 10. Since both the water handle and the initial handle both happen once per frame, the hitboxes can be overlaid.
===Non-vertical walls===
[[File:Non-Vertical Wall.png|300px|right|thumb|This wall in [[BoB]] is not quite vertical.]] The majority of walls in the game are perfectly vertical, but not all. Walls that are not vertical are one cause of [[Glitchy Ledge Grab]]s.
==Floors==
==Floors==
A floor triangle is a triangle with normal.y > 0.01.
===Hitbox===
A floor's hitbox extends 78 units below and 100 units above the floor triangle. This allows Mario to move vertically along floors; if he is moving up or down a slope or stairs, he will be off the floor after his horizontal motion but still in its hitbox, which will snap him to the floor. He will always be snapped up if he's in a floor's hitbox below the floor, but he'll only be snapped down while above a floor if he is in a ground movement state. When walking on a slope, Mario will move horizontally at a rate slower than his actual speed, known as his [[De Facto Speed]].
Any location that is not inside or above a floor hitbox is considered out of bounds; Mario will not be able to move into it of his own volition, and if forced into it, he will die.
==Ceilings==
==Ceilings==
A ceiling hitbox extends from 160 units below the ceiling to infinitely above. For ground and air movement, the ceiling will try its best to keep Mario out of it. If Mario walks into the ceiling, his quarter step will be canceled, and he will remain in place and do the pushing animation. If Mario is moving upwards in the air when coming in contact with the ceiling, his quarter step will be canceled and his vertical speed will be set to 0. On the contrary, when Mario falls onto a ceiling while airborne, his quarter step will be canceled and his horizontal speed will get set to 0, making him fall straight down. Although a ceiling will extend upwards infinitely, a floor can overwrite the ceiling hitbox, meaning that its hitbox will stop right when the floor hitbox starts.
On the American release of the game, there is an interesting ceiling example found in [[Rainbow Ride]], where [https://youtu.be/UnU7DJXiMAQ?t=1466 the top of the chimney is not capped off], making the ceiling go up forever, softlocking Mario if he ends up sliding into it.
Even though ceilings try to push Mario outwards, they can still be accessed using various techniques, such as getting pushed by an enemy. Note that once Mario is standing inside the ceiling, he is no longer able to move anywhere due to his quarter steps being cancelled.
For Water movement, Mario instead gets warped downward by ceilings. These downwarps are used in various TASes and speedruns.
==Surface Types==
While the surface type of a surface is not restricted to only floors, walls, or ceilings, in practice they are only used in certain scenarios, or wouldn't have any affect if such surface was of a different type, i.e. there could be a vertical wind ceiling or a death barrier wall, but those surfaces would have the behaviour. Todo: Explain what slipperiness means.
{{Surface_Types}}
==References==
==References==
<references />
<references />
[[Category:Mechanics]]
246

edits