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’?

1.11K 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’ve already got some good answers explaining how physics work in 3D games and how the visual geometry may not always reflect the collision shape used “under the hood”. I want to add that the Unity engine actually *does have* a “thickness” parameter for terrain which controls how “deep” the collision actually goes. You can read about it [here](https://docs.unity3d.com/550/Documentation/Manual/terrain-OtherSettings.html), and see that it is in fact included to prevent high-speed objects from penetrating the surface.

However, recent versions of Unity actually obsolete this feature, for me in fact it happened in the middle of development and my objects started clipping through after I updated! The removal of the feature comes from internal changes to the physics engine, which is a shame. So you might wonder, how will we prevent clipping if we can’t have terrain thickness anymore? The solution is to use the “expensive” collision detection talked about in the link. Unity has a concept called “Continuous collision” which essentially shoots a physics line in the direction of the moving object (engines can easily do this because they know the velocity and direction of all physics objects) to see if it will move past a surface instead of merely checking discrete intersections. The performance hit actually isn’t too bad, especially if you don’t have many objects. As others mentioned, there are tons of other optimizations which improve physics performance in general, such as disregarding shapes not in use, or putting an object to “sleep” when it has stopped moving, which all leave more performance room for this line-based procedure to function.

It’s also worth noting that this is just how Unity specifically handles their own terrain system. It’s entirely possible to import your own terrain mesh and give it whatever thickness you want in the collision shape, if you know how to define it properly. This is how I imagine many AAA games do their terrains–they have better tools which add in thickness, or add in custom collision shapes themselves, or most likely they end up using continuous collision anyways because it helps safeguard errors with other thin colliders that aren’t terrains.

Anonymous 0 Comments

I feel like most answers here go into way too much detail compared to what is actually required to understand this.

The reason only the surface of the terrain (and other objects) is there is that it’s the only thing that matters. You only see the surface; you only interact with the surface. The volume below doesn’t matter to the player. So modelling it is a waste of resources, which are often scarce in computer games. Also, working with a volume is *way* more expensive than working with a surface.

Pretty much the only observable effect of this is the clipping you describe, which most games are able to work around easily enough.

Note that even for transparent objects (e.g. glass) only the surfaces are needed to create the image you see.

There is stuff that would need actual volume data, e.g. smoke, but it’s not usually done like that because it is too expensive; it is faked by rotating images or similar instead.

Anonymous 0 Comments

It would take too many triangles, so instead computer graphics just show triangles in your field of view.

Anonymous 0 Comments

Thicker terrain requires more resources. Clipping typically doesn’t occur when the minimum specs are met. So no need to waste resources on a scenario that shouldn’t occur.

Anonymous 0 Comments

VG engines have no inherent concept of thickness. You have to program that in.

First off even if you do, that won’t change anything by itself. Remember you have to create all the physics rule from scratch. Imagine designing a universe and having to come up with concepts like quarks, the weak and strong nuclear forces, speed of light and gravity. That’s how you design game engines, obviously on a much more limited scale. Want thickness? Sure, but you have to program the whole physics around it and what it actually does.

Speaking of which, programming an engine means you want it to be as effective as possible, because computer resources are limited. So you use crutches like this, simplifications and have to expect sometimes things just glitch out because you can’t afford to use more precise or slower calculations.

Anonymous 0 Comments

…That’s a misconception because you are thinking the collision happens with the texture, however the texture itself is just a bunch of colored pixels, there are some exceptions like Noita where every pixel is simulated and terrain is “realistic”…

In most games however, the terrain is just a piece of texture that has something else, invisible under it that causes the collision.

Adding more thickness inside the collider box does nothing, because the collision is detected (and prevented) at the edges…

If you fall through terrain it’s not because the terrain was “thin”, it’s because the physics engine did something it wasn’t supposed to.

Adding something else underneath the terrain to catch you from falling wouldn’t really solve the issue, because the physics engine still broke… whether you fall through the terrain into void or into something under the ground doesn’t really change anything.

If you make sure the physics engine works properly you won’t have to fill up people’s resources with things that would prevent you from going in the void if the physics engine doesn’t work properly.

Anonymous 0 Comments

I’ve seen a bunch of answers here that are quite difficult to understand, so I’ll take a stab at it.

You have to keep in mind that although a 3D video game gives the illusion of being similar to real life, it is completely different. Everything is done with math, resulting in something that feels like real life.

Visually, the game is just a camera that can move around and look at 3D graphics. This camera can go anywhere, and go right through any rendered object.

A 3D graphic is just some edges put together. When you think about it, even in real life you can only ever see the outside edges of an object. Yes, in real life there’s stuff inside, but a visual rendering is just some pixels to look at; there’s nothing beyond the edges you see. That’s why any 3D object or “terrain” is paper thin. What’s it gonna be filled with? Atoms? What would you see when you went inside it? Blackness? Visually, thickness doesn’t really exist.

The system of collisions (and other physics) has to be programmed in. A simplified way of thinking about a system that stops the camera from moving through an object is telling the computer: “Hey, if the camera’s position tries to go within the space taken up by that object, stop it! Push it back or something!” and this is where some of the more advanced answers about extensive collision systems with hardcore math come in.

So a collision in a video game is only as good as the system that prevents you from moving through an area you don’t wanna move through. You can collide with an invisible wall just the same as how you can collide with an object. It’s just a bunch of numbers and visuals, there’s no terrain or thickness at all.

TL;DR Minecraft blocks are hollow dude

Edit: This is from a programmer’s perspective, I’m not a game dev or a graphics engineer, but I believe this is an accurate explanation.

Anonymous 0 Comments

Because you don’t need to simulate the entire ground when the ground is meant to be completely static and unpassable; it only has to be a 2D plane that can not be passed. Making the ground thicker isn’t as important as having the physics update more often, but that would slow the game down. Making the ground thicker may be faster, but it would also still end up with things clipping through part of it. Instead, you can just add another check that says if they are beyond the threshold, treat it as at the line instead of under it. Or they simply check that you’re under the ground and teleport you to a safe spot, so you still see yourself fall through for a moment.

Anonymous 0 Comments

Noting is ever filled, or (thick) everything is made from planes arranged into polygons. Everything is basically a shell.