Clipping is basically just another name for hitbox, it refers to the values the game uses to determine whether two hitboxes are in contact or "clipping" into each other. There's two kinds of clipping values in SMW, based on the kind of interaction being processed.
For sprite-sprite interaction
, it uses square hitboxes defined by an X/Y offset, width, and height. All it has to check then is, are the two hitboxes separated by a distance wider than their height/width? If so, then they're not in contact. See $03B72B for the source code of that (along with the related routines at $03B664, $03B69F, and $03B6E5 which handle fetching the clipping data).
For sprite-object interaction
, it uses interaction points. These are single-pixel points defined around the sprite that each seperately process interaction with the tile they're touching. Because processing all
of these points would be taxing on the SNES's processor, it usually optimizes it a bit by skipping certain points when unnecessary.
- For non-Mario sprites
, the game assigns four interaction points at the middle of each edge of a square hitbox. It only processes two of these points per frame, one of the top/bottom points and one of the left/right points. If the sprite is moving along a particular axis, it processes the point in the direction of that movement. If the sprite is stationary along an axis, it alternates between left/top and right/bottom points each frame (this is what causes e.g. the "jittering" when you shove a carryable sprite inside a solid block).
- For Mario
, the game assigns six interaction points: one on top of Mario, one in the center of him, two on the side of him (one next to his head, and one next to his body), and two for each of his feet. For the two side points, it differentiates between left/right sides by which side of the block Mario is on (Smallhacker's document has a mistake in that it refers to this as "standing" vs "walking"; Mario's movement does not matter). Depending on what certain interaction points are touching, it may also skip processing certain other points (e.g. it skips the side points if the center point is inside a solid block, or the side-head point if the side-body point is inside a solid tile).
Now, the reason why Layer 3 interaction works a bit differently from Layer 1/2 interaction is that it doesn't process the interaction points for it. Instead, Layer 3 has its interaction hardcoded; for the tides it just checks if Mario's Y position is below a certain line or not. For more-advanced interaction, you'd want to do something similar to what is already done for the Layer 1/2 interaction. If you want to see the original game's routine for that, see $00EB77 (although I should warn you that that routine is a *mess* due to Nintendo just kinda cramming all of the tile interaction logic into it).
Professional frame-by-frame time wizard. YouTube
- SMW Glitch List
- SMW Randomizer