Surface

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 normal vector[1]. 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

A triangle is a wall triangle if and only if -0.01 < normal.y < 0.01.

Hitbox

 
The hitbox of a wall during both the initial handle and a ground quarter step, simplified
 
The hitbox of a wall during an air quarter step, simplified
 
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 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 units 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 units 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

 
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 Grabs.

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

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 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.

Table of Surface Types
Type Surface Hex Behavior Slipperiness Unused Sample Level Description/Notes
Floor/Wall/Ceiling 0x00 Default Default Most Regular Ground
Floor/Wall 0x01 Lava Default LLL/BitFS/SL/RR Lava that burns Mario
Floor 0x04 Default X Has Exertion
Ceiling 0x05 Climbable Default Many Ceilings that Mario can climb on
Floor 0x09 Slow Movement Default X Slows movement for Mario when he moves
Floor 0x0A Death Plane Default Many Triggers death, used in most stages where you can fall off
Floor 0x0B Default BoB/SSL Pyramid Camera mode 1025, close camera
Floor 0x0D Default Courtyard (fountain) For camera behavior
Floor 0x0E Flowing Water Default Basement/Outside/CotMC Has exertion and pushes Mario in water
Floor 0x12 Intangible Default BBH Seperates BBH mansion from merry-go-round, for room usage
Floor 0x13 Slide Default Slide Most The default slide floor
Floor 0x14 Slippery Default Slippery Most The default slippery floor
Floor 0x15 Non-slippery Default Non-Slippery Most The default non-slippery floor
Floor 0x1A Different Noise Default BBH Has a varied noise depending on terrain (mostly unused)
Floor 0x1B Loading Zone Default Endless Stairs/WDW Changes Mario's position/can load new level
Floor 0x1C Loading Zone Default WDW Changes Mario's position/can load new level
Floor 0x1D Loading Zone Default SSL Pyramid/DDD Changes Mario's position/can load new level
Floor 0x1E Loading Zone Default SSL Pyramid/DDD Changes Mario's position/can load new level
Floor 0x21 Shallow Quicksand Default THI Huge/TTM Has a depth of 10 units
Floor 0x22 Deep Quicksand Default SSL Pyramid Has a depth of 160, kills Mario at the bottom
Floor 0x23 Instant Quicksand Default SSL Instant death quicksand, underneath mist
Floor 0x24 Deep Moving Quicksand Default SSL Has a depth of 160, kills Mario at the bottom, has exertion
Floor 0x25 Shallow Moving Quicksand Default SSL Has a depth of 25, has exertion
Floor 0x26 Quicksand Default SSL Has a depth of 60
Floor 0x27 Moving Quicksand Default SSL Has a depth of 60, has exertion
Floor/Wall 0x28 Constructions Default Most Fences, cannons
Floor 0x29 Default with Noise Default BoB/WF/BBH Default floor with different noises
Floor 0x2A Slippery with Noise Slippery BoB/Outside Slippery floor with different noises
Floor 0x2C Horizontal Wind Default SL/BitS/RR/THI Huge Creates sideways wind
Floor 0x2D Instant Moving Quicksand Default SSL Instant death quicksand, has exertion
Floor 0x2E Ice Slide CCM/SL/THI Is slippery, transparent, and has a unique shadow
Floor 0x2F TotWC Trigger/Sun Carpet Default Lobby Floor to trigger TotWC
Floor 0x30 Hard Default Default CCM/SSL/SL Always has fall damage, regardless of terrain
Floor 0x32 Surface Warp Default TotWC/DDD/JRB Warp with no height check (moving above triggers it)
Floor 0x33 Slide Timer Start Default PSS Starts the timer for the slide
Floor 0x34 Slide Timer End Default PSS Ends the timer for the slide
Floor 0x35 Hard Slippery Surface Slippery SSL Always has fall damage, slippery
Floor 0x36 Hard Slide Surface Slide SL Always has fall damage, slide
Floor 0x37 Hard Non-Slippery Surface Non-Slippery CCM/SL/WMotR Always has fall damage, Non-Slippery
Floor 0x38 Upwards Wind Default CCM/THI/TTM Creates upward wind, also acts as a death barrier
0x40 Vertices Information - Beginning of the vertices information in the level data
0x41 Continue -
0x42 End - Marks the end of level data
0x43 Objects - Beginning of some object information in the level data
0x44 Waterlike Collision - Beginning of the waterlike information in the level data
Floor 0x65 Default BoB/WF Camera mode 2817, zoomed out
Floor 0x66 Default SSL Pyramid/TTC/THI For camera behavior
Floor 0x68 Default THI Wiggler For camera behavior
Floor 0x69 Default THI Tiny For camera behavior
Floor 0x6E Default WF/SSL For camera behavior
Floor 0x6F Default BitDW/THI For camera behavior
Floor 0x70 Default BoB/TTM For camera behavior
Floor/Wall/Ceiling 0x72 Camera-only Surface Default Basement/CotMC/SL Intangible as a surface for Mario, however restricts camera movement
Floor 0x73 Slide with Noise Slide X Has noises, unused
Floor 0x74 Slide with Noise Slide X Has noises, unused
Floor 0x75 Snowman's Path Slide CCM Snowmans head race path; has noise
Floor/Wall 0x76 Surfaces with Flags Default Most Most surfaces that have flags use this type
Floor 0x77 Default X Can have flags
Floor 0x78 Slide THI Huge Possibly for camera behavior, has noise
Floor 0x79 Slippery CCM For camera behavior
Floor 0x7A Switch Surface Non-Slippery Many Switches and Dorrie use this surface
Wall 0x7B Invisi-Cap Mesh's Default Many Passible with invisible cap
Floor 0xA6 BoB Painting/TTM Slide Entrance Default Lobby/TTM Wobbles camera, locks it
Floor 0xA7 BoB Painting/TTM Slide Entrance Default Lobby/TTM Wobbles camera, locks it
Floor 0xA8 BoB Painting/TTM Slide Entrance Default Lobby/TTM Wobbles camera, locks it
Floor 0xA9 CCM Painting Default Lobby Wobbles camera, locks it
Floor 0xAA CCM Painting Default Lobby Wobbles camera, locks it
Floor 0xAB CCM Painting Default Lobby Wobbles camera, locks it
Floor 0xAC WF Painting Default Lobby Wobbles camera, locks it
Floor 0xAD WF Painting Default Lobby Wobbles camera, locks it
Floor 0xAE WF Painting Default Lobby Wobbles camera, locks it
Floor 0xAF JRB Painting Default Lobby Wobbles camera, locks it
Floor 0xB0 JRB Painting Default Lobby Wobbles camera, locks it
Floor 0xB1 JRB Painting Default Lobby Wobbles camera, locks it
Floor 0xB2 LLL Painting Default Basement Wobbles camera, locks it
Floor 0xB3 LLL Painting Default Basement Wobbles camera, locks it
Floor 0xB4 LLL Painting Default Basement Wobbles camera, locks it
Floor 0xB5 SSL Wall Default Basement Wobbles camera, locks it
Floor 0xB6 SSL Wall Default Basement Wobbles camera, locks it
Floor 0xB7 SSL Wall Default Basement Wobbles camera, locks it
Floor 0xB8 Unused HMC Wall? Default X Wobbles camera, locks it
Floor 0xB9 Unused HMC Wall? Default X Wobbles camera, locks it
Floor 0xBA Unused HMC Wall? Default X Wobbles camera, locks it
Floor 0xBB DDD Wall Default Basement Wobbles camera, locks it
Floor 0xBC Unused DDD Wall? Default X Wobbles camera, locks it
Floor 0xBD Unused DDD Wall? Default X Wobbles camera, locks it
Floor 0xBE WDW Painting Default Upstairs Wobbles camera, locks it
Floor 0xBF WDW Painting Default Upstairs Wobbles camera, locks it
Floor 0xC0 WDW Painting Default Upstairs Wobbles camera, locks it
Floor 0xC1 THI-Tiny Painting Default Upstairs Wobbles camera, locks it
Floor 0xC2 THI-Tiny Painting Default Upstairs Wobbles camera, locks it
Floor 0xC3 THI-Tiny Painting Default Upstairs Wobbles camera, locks it
Floor 0xC4 TTM Painting Default Upstairs Wobbles camera, locks it
Floor 0xC5 TTM Painting Default Upstairs Wobbles camera, locks it
Floor 0xC6 TTM Painting Default Upstairs Wobbles camera, locks it
Floor 0xC7 Default X Wobbles camera, locks it
Floor 0xC8 Default X Wobbles camera, locks it
Floor 0xC9 Default X Wobbles camera, locks it
Floor 0xCA Unused SL Painting? Default X Wobbles camera, locks it
Floor 0xCB Unused SL Painting? Default X Wobbles camera, locks it
Floor 0xCC Unused SL Painting? Default X Wobbles camera, locks it
Floor 0xCD THI-Large Painting Default Upstairs Wobbles camera, locks it
Floor 0xCE THI-Large Painting Default Upstairs Wobbles camera, locks it
Floor 0xCF THI-Large Painting Default Upstairs Wobbles camera, locks it
Floor 0xD0 HMC/CotMC Pool Loading Default Basement/HMC Possibly for triggering the pool graphic to load
Floor 0xD1 Default X
Floor 0xD2 Default X
Floor 0xD3 BoB Painting/TTM Slide Entrance Default Lobby Horizontal Course Warp
Floor 0xD4 BoB Painting/TTM Slide Entrance Default Lobby Horizontal Course Warp
Floor 0xD5 BoB Painting/TTM Slide Entrance Default Lobby Horizontal Course Warp
Floor 0xD6 CCM Painting Default Lobby Horizontal Course Warp
Floor 0xD7 CCM Painting Default Lobby Horizontal Course Warp
Floor 0xD8 CCM Painting Default Lobby Horizontal Course Warp
Floor 0xD9 WF Painting Default Lobby Horizontal Course Warp
Floor 0xDA WF Painting Default Lobby Horizontal Course Warp
Floor 0xDB WF Painting Default Lobby Horizontal Course Warp
Floor 0xDC JRB Painting Default Lobby Horizontal Course Warp
Floor 0xDD JRB Painting Default Lobby Horizontal Course Warp
Floor 0xDE JRB Painting Default Lobby Horizontal Course Warp
Floor 0xDF LLL Painting Default Basement Horizontal Course Warp
Floor 0xE0 LLL Painting Default Basement Horizontal Course Warp
Floor 0xE1 LLL Painting Default Basement Horizontal Course Warp
Floor 0xE2 SSL Wall Default Basement Horizontal Course Warp
Floor 0xE3 SSL Wall Default Basement Horizontal Course Warp
Floor 0xE4 SSL Wall Default Basement Horizontal Course Warp
Floor 0xE8 DDD Wall Default Basement Horizontal Course Warp
Floor 0xE9 DDD Wall Default Basement Horizontal Course Warp
Floor 0xEA DDD Wall Default Basement Horizontal Course Warp
Floor 0xEB WDW Painting Default Upstairs Horizontal Course Warp
Floor 0xEC WDW Painting Default Upstairs Horizontal Course Warp
Floor 0xED WDW Painting Default Upstairs Horizontal Course Warp
Floor 0xEE THI Tiny Painting Default Upstairs Horizontal Course Warp
Floor 0xEF THI Tiny Painting Default Upstairs Horizontal Course Warp
Floor 0xF0 THI Tiny Painting Default Upstairs Horizontal Course Warp
Floor 0xF1 TTM Painting Default Upstairs Horizontal Course Warp
Floor 0xF2 TTM Painting Default Upstairs Horizontal Course Warp
Floor 0xF3 TTM Painting Default Upstairs Horizontal Course Warp
Floor 0xF4 TTC Painting Default Upstairs Horizontal Course Warp
Floor 0xF5 TTC Painting Default Upstairs Horizontal Course Warp
Floor 0xF6 TTC Painting Default Upstairs Horizontal Course Warp
Floor 0xF7 SL Wall Default Upstairs Horizontal Course Warp
Floor 0xF8 SL Wall Default Upstairs Horizontal Course Warp
Floor 0xF9 SL Wall Default Upstairs Horizontal Course Warp
Floor 0xFA THI Huge Painting Default Upstairs Horizontal Course Warp
Floor 0xFB THI Huge Painting Default Upstairs Horizontal Course Warp
Floor 0xFC THI Huge Painting Default Upstairs Horizontal Course Warp
Floor 0xFD Hole Course Entry Default Basement/HMC Flat Course Entry
Floor 0xFF BitDW Entry (Not a Warp) Default Lobby BitDW Entry

References