@CurcuitStore
  @CurcuitStore
Curcuit Store | Wall Climbing w/ Float Perfect Wall Clip & Single Axis Collision Discrepancy @CurcuitStore | Uploaded 1 year ago | Updated 5 hours ago
Me when I'm mojang and I'm obsessed with the number 1e-7 and put it in every other line of collision code so that it will save me from scary float errors. Anyway here's a float precise wall clip that only works between certain powers of two and specifically right on the edge of one of those 1e-7 checks.

I won't claim to know every exact bit of what's going on here, the collision code is way over my head, but I kind of have an understanding of what has to happen.

First off the wall clip, which is just kind of silly:

If you just walk into a block hitbox(like i do with the sand), your hitbox gets be pressed completely flush against it. You can see this with the negZ value in the top left when i press against the sand, which shows the neg Z coord of my hitbox becoming exactly 270. But interestingly, the sides of each wall(i say wall but this means ceilings/floors/whatever too) are shrunken inwards by 1e-7m on their edges, leaving open corners on every side of the hitbox. You can use this to get your hitbox slightly inside the block, but unfortunately the walls also have some thickness that extends 1e-7m /into/ the block. So even though you can clip 1e-7m into the wall through one side, the 1e-7m thickness of the perpendicular will stop you from moving any farther into it(it won't push you out though). The kicker is though that sometimes there's a single float value wide gap between the two where you can sneak past both of them, which is what lets me in the wall. You can see in the video that the server still tries and eject/revert my position if I try to go any deeper into it, but it does show that I'm fully inside the hitbox. And if the server wasn't annoying I'd be able to completely walk completely through it.

This doesn't let me climb anything though, since like I said I'm sneaking past any of the walls/floors that i would climb on. But this is where the real funny part is, since all of that only applies when you're moving on more than 1 axis at once, which uses your/the block's actual hitbox positions to test collision. But if you're moving on just one axis, the game will actually just test your hitbox relative to the block hitbox. This introduces a discrepancy since subtracting a float like that creates small errors. And between certain powers of two this error can just barely makes your hitbox closer to 0 than before, making it possible to interact with walls that you couldn't with multi-axis movement(walking around counts as multi-axis movement on the client because gravity and sometimes weird trig errors are also pushing you in different directions. Not necessarily true on the server, which intrigues me, but doesn't really matter here).

So, to scale the wall, all I had to do was move around on multiple axes to make the ceilings/floors intangible and climb up a level, and then kill all but my y movement to make the floors tangible again and safely land. rinse and repeat. If I tried to walk at all I would simply fall through the ground since the floor disappears, even if I sneak.

Again this only works between certain powers of two, presumably because the precision doesn't always line up. I also don't think it works the on negative side(but does on negative axes), but don't quote me on that I'm no float expert. Although getting those inputs to align my hitbox on the exact float certainly made me feel powerful. idek how I managed that tbh but never again...


okay im done idc enough to proof read that enjo your day :)

music: mall - c418
Wall Climbing w/ Float Perfect Wall Clip & Single Axis Collision DiscrepancyLagged Pearl Vanilla ExampleDamage Tick Offset DemonstrationPreserving Velocity Over an EdgeTorch Portal Alternative w/ Double Place

Wall Climbing w/ Float Perfect Wall Clip & Single Axis Collision Discrepancy @CurcuitStore

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER