Tuesday, April 22, 2014

Corner Clipping Without Max Speed

A corner clip without max speed is not widely known.  Basically, it functions exactly like a regular corner clip, except it requires a strict y location instead of a strict x location.
To initially have some values, we need to have a way of referencing the top of the block.  We'll use what I like to call the "theoretical" top, just meaning that it works perfectly for checks (like the theoretical right and left in corner clip prediction, see below).  To find the theoretical top/left, you must first find the lowest 16th multiple that the block is at (pos - pos % 16), and then subtract 14.  To find the theoretical right/bottom, take the lowest 16th multiple based on the given axis, and add 13.

To corner clip, the player must go into the theoretical right/left of the block by 2 pixels and 1 subpixel (47 subpixels), but his speed must be 49...normally.  If you were to somehow achieve the same values but without max speed, you would get the same results.  Getting the correct x values when without max speed is easy, as you will need to jump towards the upper right (as a demonstration, also works from left) of the block, and doing so will achieve those values.  However, you must also go into the theoretical top position of the block by 418 subpixels.
The values we are looking for must be achieved on the exact frame that the player's speed goes from negative to positive.  The reason for that is that the block only checks collision from the top if the player's speed is positive (he is falling).

Approaching the block should look something like this.  I like to line yoshi's feet up with the top of the block when he is turning, as it is the most accurate representation of yoshi's hitbox.  Make sure that you are not being hit by the side of the block as you just strafe by the top of it.

The frame I am just before the block.  Note my x position and my y position.  Both are important, but the y position is more strict.

This is the frame that I am in the block.  My y speed is going to turn positive on the next frame and I am also going to be more than enough subpixels into the block on the x axis.  Also note that I am not hitting the side of the block.  You want to be as low as possible when clipping, as the y position manipulation causes you to be higher than you would expect in the end.

This is the frame I have clipped the block.  My y position is exactly 418 subpixels into the theoretical top of the block, and my y speed is positive, which means that I will be going more into the block on the next frame.  Also, my x position is more than enough to clip (required is 47 subpixels into it, I have gone 78 subpixels into it).

And, on top of this, if your x position increase is just right, you are able to walk right through the block (from the right or the left), which is what distinguishes this from a yoshi mount or a yoshi drop mount.

Another thing that distinguishes it from those is that you can do it without a ceiling, and without needing a block to be exactly one tile above the ground.  From the ground, you are able to do this with a block 3, 4, or 5 tiles above the ground.  Theoretically, any block that you can reach can be corner clipped without max speed without any specific oscillation pattern, as long as it is correct.

No comments:

Post a Comment