I’ve learned that video game ‘clipping’ is caused by high velocity, thin colliders, and too-slow physics updates. Why are terrain surfaces in most 3D video games paper-thin? Why isn’t terrain given extra fill/thickness inside and under it to prevent ‘falling through the map into the void’?

2.80K views

I could see why you might not want to fill under the terrain in a game that features things like underground caves, but thin terrain seems to be present in a huge majority of 3D games (even those without underground features) and is not engine-specific. Why is terrain almost always a fragile piece of origami that’s so easily punctured?

In: Technology

39 Answers

Anonymous 0 Comments

You’re thinking about the ground wrong.

You’re thinking about the surface of the ground as its volume, but those aren’t the same thing. The ground in games is not necessarily thin, it’s often quite thick – sometimes infinitely thick (ignoring technical details like integer limits).

What does it mean for something to be thick? Think of the thickness defined by two flat surfaces, and the volume between them is considered the “interior”, and the thickness is the distance between them. Any point between the coordinates of those surfaces is inside the object, otherwise it’s outside.

Now look at the ground in a video game. Sometimes it really is thin, even infinitely thin, so if a given volume does clip past it, you don’t trigger any code to deal with clipping inside something, and instead you just “fall” until something else happens (you hit a kill plane, an integer overflows, etc.). This isn’t necessarily a huge problem so long as you consider the collision detection and the size and speed of the objects that might collide with the ground.

But often *all* points below the surface of the ground are considered inside the ground, and that thin “origami” isn’t the geometry of the ground, it’s the geometry of just one surface of the ground, and the ground is in fact so thick that *any* point below it is considered to be within it. If the whole world has a defined floor surface, you might simply clamp the vertical position of everything according to that surface instead of even checking for collision, which is functionally equivalent to doing collision detection checks with an infinitely thick ground.

The thing that is tricking you is that, because we model things as rigid colliders, unless you’re doing something like destructible terrain, we usually don’t bother specifying what things look like on the “inside”. If collision is rigid, and the camera is subject to collision, only the outside should ever be visible. So if you do manage to clip the camera into the ground (because the collision simulation fails), you discover that, unlike real-life solid objects, only the surface is visible, and often only one side of it. You could also just assume that inside of things, all light is blocked, so the screen should just be black, and occasionally games will do this, but that’s useless to the player who accidentally clips inside something (and makes it harder for them to get the camera back out), and makes debugging potentially harder.

So visually it looks kind of like the ground is thin, but *geometrically* the ground may actually be very thick.

You are viewing 1 out of 39 answers, click here to view all answers.